fix: clean up field values display (#855)

This commit is contained in:
Jon Nicholson 2019-05-12 20:07:50 +01:00 committed by Roman Hotsiy
parent 5dd5d6d704
commit 5c915906c8
2 changed files with 7 additions and 3 deletions

View File

@ -17,9 +17,11 @@ export class EnumValues extends React.PureComponent<EnumValuesProps> {
<div> <div>
<FieldLabel> <FieldLabel>
{type === 'array' ? 'Items' : ''} {values.length === 1 ? 'Value' : 'Enum'}: {type === 'array' ? 'Items' : ''} {values.length === 1 ? 'Value' : 'Enum'}:
</FieldLabel> </FieldLabel>{' '}
{values.map((value, idx) => ( {values.map((value, idx) => (
<ExampleValue key={idx}>{JSON.stringify(value)} </ExampleValue> <ExampleValue key={idx}>
{JSON.stringify(value)}
</ExampleValue>
))} ))}
</div> </div>
); );

View File

@ -14,7 +14,9 @@ export class FieldDetail extends React.PureComponent<FieldDetailProps> {
return ( return (
<div> <div>
<FieldLabel> {this.props.label} </FieldLabel>{' '} <FieldLabel> {this.props.label} </FieldLabel>{' '}
<ExampleValue> {JSON.stringify(this.props.value)} </ExampleValue> <ExampleValue>
{JSON.stringify(this.props.value)}
</ExampleValue>
</div> </div>
); );
} }