Fix extrinsics app [object Object] (#1319)

This commit is contained in:
Jaco Greeff 2019-06-19 21:33:41 +02:00 committed by GitHub
parent 994c0fc86f
commit 31a78cef00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 22 deletions

View File

@ -61,10 +61,7 @@ class ExtrinsicDisplay extends React.PureComponent<Props, State> {
label={label}
onChange={this.onChangeMethod}
withLabel={withLabel}
help={
meta && meta.documentation
&& meta.documentation.join(' ')
}
help={meta && meta.documentation && meta.documentation.join(' ')}
/>
<Params
key={`${section}.${method}:params` /* force re-render on change */}
@ -94,9 +91,7 @@ class ExtrinsicDisplay extends React.PureComponent<Props, State> {
if (isValid) {
try {
method = methodfn(
...values.map(({ value }) =>
value
)
...values.map(({ value }) => value)
);
} catch (error) {
// swallow

View File

@ -34,11 +34,7 @@ class ExtrinsicDisplay extends React.PureComponent<Props> {
isDisabled={isDisabled}
isError={isError}
isPrivate={isPrivate}
label={t('{{label}} (extrinsic)', {
replace: {
label
}
})}
label={<>{label} {t('(extrinsic)')}</>}
onChange={this.onChange}
onEnter={onEnter}
style={style}

View File

@ -6,17 +6,12 @@ import { I18nProps } from '@polkadot/ui-app/types';
import { BaseProps, Props as ComponentProps, ComponentMap } from '../types';
import React from 'react';
import styled from 'styled-components';
import { classes } from '@polkadot/ui-app/util';
import translate from '@polkadot/ui-app/translate';
import { isUndefined } from '@polkadot/util';
import findComponent from './findComponent';
const Type = styled.span`
font-family: monospace;
`;
type Props = I18nProps & BaseProps & {
isDisabled?: boolean,
overrides?: ComponentMap
@ -55,11 +50,9 @@ class ParamComponent extends React.PureComponent<Props, State> {
key={`${name}:${type}`}
isDisabled={isDisabled}
label={
<Type>
{isUndefined(name)
? type.type
: `${name}: ${type.type}`}
</Type>
isUndefined(name)
? type.type
: `${name}: ${type.type}`
}
name={name}
onChange={onChange}

View File

@ -5,6 +5,10 @@
.ui--Params {
border-left: 0.25rem solid #f2f2f2;
label {
font-family: monospace;
}
.ui--row {
flex-wrap: wrap;
}