feat: display Value instead of Enum for one-item enum

This commit is contained in:
Roman Hotsiy 2018-06-26 18:56:28 +03:00
parent 1812775cd0
commit 78fa31225a
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0

View File

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