mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-08 06:04: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 { startCase } from 'lodash';
|
||||
|
||||
import { FieldLabel } from '../../common-elements/fields';
|
||||
|
||||
import styled from '../../styled-components';
|
||||
|
||||
import { OptionsContext } from '../OptionsProvider';
|
||||
|
@ -10,10 +15,6 @@ const Extension = styled(StyledMarkdownBlock)`
|
|||
margin: 2px 0;
|
||||
`;
|
||||
|
||||
const ExtensionLable = styled.span`
|
||||
font-style: italic;
|
||||
`;
|
||||
|
||||
export interface ExtensionsProps {
|
||||
extensions: {
|
||||
[k: string]: any;
|
||||
|
@ -29,8 +30,10 @@ export class Extensions extends React.PureComponent<ExtensionsProps> {
|
|||
{options.showExtensions &&
|
||||
Object.keys(this.props.extensions).map(key => (
|
||||
<Extension key={key}>
|
||||
<ExtensionLable>{key}</ExtensionLable>:{' '}
|
||||
<code>{JSON.stringify(this.props.extensions[key])}</code>
|
||||
<FieldLabel>{startCase(key.substring(2))}</FieldLabel>:{' '}
|
||||
<code>
|
||||
{JSON.stringify(this.props.extensions[key]).replace(/(^")|("$)/g, '')}
|
||||
</code>
|
||||
</Extension>
|
||||
))}
|
||||
</>
|
||||
|
|
Loading…
Reference in New Issue
Block a user