mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-11 03:16:48 +03:00
chore: minor refactor
This commit is contained in:
parent
b21cd3d366
commit
dc77d8f25e
|
@ -20,16 +20,17 @@ export interface ExtensionsProps {
|
|||
|
||||
export class Extensions extends React.PureComponent<ExtensionsProps> {
|
||||
render() {
|
||||
const exts = this.props.extensions;
|
||||
return (
|
||||
<OptionsContext.Consumer>
|
||||
{options => (
|
||||
<>
|
||||
{options.showExtensions &&
|
||||
Object.keys(this.props.extensions).map(key => (
|
||||
Object.keys(exts).map(key => (
|
||||
<Extension key={key}>
|
||||
<FieldLabel> {key.substring(2)}: </FieldLabel>{' '}
|
||||
<ExtensionValue>
|
||||
{JSON.stringify(this.props.extensions[key]).replace(/(^")|("$)/g, '')}
|
||||
{typeof exts[key] === 'string' ? exts[key] : JSON.stringify(exts[key])}
|
||||
</ExtensionValue>
|
||||
</Extension>
|
||||
))}
|
||||
|
|
Loading…
Reference in New Issue
Block a user