Display extrinsic meta documentation on hover (#1247)

* add help to Extrinsic component

* chain state documentation

* requested changes
This commit is contained in:
Bhanu Teja P 2019-05-31 19:41:48 +05:30 committed by Jaco Greeff
parent b39144d1d3
commit a986ca8285
2 changed files with 10 additions and 2 deletions

View File

@ -46,7 +46,7 @@ class Modules extends TxComponent<Props, State> {
render () {
const { t } = this.props;
const { isValid, key: { method, section }, params } = this.state;
const { isValid, key: { method, section, meta }, params } = this.state;
return (
<section className='storage--actionrow'>
@ -55,6 +55,10 @@ class Modules extends TxComponent<Props, State> {
defaultValue={this.defaultValue}
label={t('selected state query')}
onChange={this.onChangeKey}
help={
meta && meta.documentation
&& meta.documentation.join(' ')
}
/>
<Params
key={`${section}.${method}:params` /* force re-render on change */}

View File

@ -49,7 +49,7 @@ class ExtrinsicDisplay extends React.PureComponent<Props, State> {
render () {
const { defaultValue, isDisabled, isError, isPrivate, label, onEnter, withLabel } = this.props;
const { methodfn: { method, section }, params } = this.state;
const { methodfn: { method, section, meta }, params } = this.state;
return (
<div className='extrinsics--Extrinsic'>
@ -61,6 +61,10 @@ class ExtrinsicDisplay extends React.PureComponent<Props, State> {
label={label}
onChange={this.onChangeMethod}
withLabel={withLabel}
help={
meta && meta.documentation
&& meta.documentation.join(' ')
}
/>
<Params
key={`${section}.${method}:params` /* force re-render on change */}