mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-08 14:14:56 +03:00
Clean up how field values are displayed
This commit is contained in:
parent
2f65f051e0
commit
129fc1f0f8
|
@ -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}>
|
||||||
|
{typeof value === 'string' ? value : JSON.stringify(value)}
|
||||||
|
</ExampleValue>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
@ -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>
|
||||||
|
{typeof this.props.value === 'string' ? this.props.value : JSON.stringify(this.props.value)}
|
||||||
|
</ExampleValue>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user