mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-08 14:14:56 +03:00
Tidy up non-redoc extension presentation
This commit is contained in:
parent
178ff4c365
commit
cb86e41251
|
@ -1,4 +1,9 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
|
|
||||||
|
import { startCase } from 'lodash';
|
||||||
|
|
||||||
|
import { FieldLabel } from '../../common-elements/fields';
|
||||||
|
|
||||||
import styled from '../../styled-components';
|
import styled from '../../styled-components';
|
||||||
|
|
||||||
import { OptionsContext } from '../OptionsProvider';
|
import { OptionsContext } from '../OptionsProvider';
|
||||||
|
@ -10,10 +15,6 @@ const Extension = styled(StyledMarkdownBlock)`
|
||||||
margin: 2px 0;
|
margin: 2px 0;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const ExtensionLable = styled.span`
|
|
||||||
font-style: italic;
|
|
||||||
`;
|
|
||||||
|
|
||||||
export interface ExtensionsProps {
|
export interface ExtensionsProps {
|
||||||
extensions: {
|
extensions: {
|
||||||
[k: string]: any;
|
[k: string]: any;
|
||||||
|
@ -29,8 +30,10 @@ export class Extensions extends React.PureComponent<ExtensionsProps> {
|
||||||
{options.showExtensions &&
|
{options.showExtensions &&
|
||||||
Object.keys(this.props.extensions).map(key => (
|
Object.keys(this.props.extensions).map(key => (
|
||||||
<Extension key={key}>
|
<Extension key={key}>
|
||||||
<ExtensionLable>{key}</ExtensionLable>:{' '}
|
<FieldLabel>{startCase(key.substring(2))}</FieldLabel>:{' '}
|
||||||
<code>{JSON.stringify(this.props.extensions[key])}</code>
|
<code>
|
||||||
|
{JSON.stringify(this.props.extensions[key]).replace(/(^")|("$)/g, '')}
|
||||||
|
</code>
|
||||||
</Extension>
|
</Extension>
|
||||||
))}
|
))}
|
||||||
</>
|
</>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user