mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-22 16:46:34 +03:00
fix: tidy up non-redoc vendor extension presentation (#847)
This commit is contained in:
parent
26f6b3d5c9
commit
b21cd3d366
|
@ -88,6 +88,8 @@ export const ExampleValue = styled(FieldLabel)`
|
|||
${extensionsHook('ExampleValue')};
|
||||
`;
|
||||
|
||||
export const ExtensionValue = styled(ExampleValue)``;
|
||||
|
||||
export const ConstraintItem = styled(FieldLabel)`
|
||||
border-radius: 2px;
|
||||
${({ theme }) => `
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
import * as React from 'react';
|
||||
|
||||
import { ExtensionValue, FieldLabel } from '../../common-elements/fields';
|
||||
|
||||
import styled from '../../styled-components';
|
||||
|
||||
import { OptionsContext } from '../OptionsProvider';
|
||||
|
@ -6,14 +9,9 @@ import { OptionsContext } from '../OptionsProvider';
|
|||
import { StyledMarkdownBlock } from '../Markdown/styled.elements';
|
||||
|
||||
const Extension = styled(StyledMarkdownBlock)`
|
||||
opacity: 0.9;
|
||||
margin: 2px 0;
|
||||
`;
|
||||
|
||||
const ExtensionLable = styled.span`
|
||||
font-style: italic;
|
||||
`;
|
||||
|
||||
export interface ExtensionsProps {
|
||||
extensions: {
|
||||
[k: string]: any;
|
||||
|
@ -29,8 +27,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> {key.substring(2)}: </FieldLabel>{' '}
|
||||
<ExtensionValue>
|
||||
{JSON.stringify(this.props.extensions[key]).replace(/(^")|("$)/g, '')}
|
||||
</ExtensionValue>
|
||||
</Extension>
|
||||
))}
|
||||
</>
|
||||
|
|
Loading…
Reference in New Issue
Block a user