mirror of
https://github.com/Redocly/redoc.git
synced 2025-06-06 14:03:13 +03:00
chore: refactor MediaTypesSwitch
This commit is contained in:
parent
95e3c4ad76
commit
e6ebdb7095
|
@ -102,7 +102,7 @@ export const SimpleDropdown = StyledDropdown.extend`
|
||||||
text-transform: none;
|
text-transform: none;
|
||||||
font-size: 0.929em;
|
font-size: 0.929em;
|
||||||
|
|
||||||
.Dropdown-control {
|
.Dropdown-control {
|
||||||
font-size: 1em;
|
font-size: 1em;
|
||||||
border: none;
|
border: none;
|
||||||
padding: 0 1.2em 0 0;
|
padding: 0 1.2em 0 0;
|
||||||
|
@ -112,6 +112,7 @@ export const SimpleDropdown = StyledDropdown.extend`
|
||||||
color: ${props => props.theme.colors.main};
|
color: ${props => props.theme.colors.main};
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const MimeLabel = styled.span`
|
export const MimeLabel = styled.span`
|
||||||
|
|
|
@ -38,14 +38,14 @@ export class MediaTypesSwitch extends React.Component<MediaTypesSwitchProps> {
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<>
|
||||||
{this.props.renderDropdown({
|
{this.props.renderDropdown({
|
||||||
value: options[activeMimeIdx],
|
value: options[activeMimeIdx],
|
||||||
options,
|
options,
|
||||||
onChange: this.switchMedia,
|
onChange: this.switchMedia,
|
||||||
})}
|
})}
|
||||||
{this.props.children(content.active)}
|
{this.props.children(content.active)}
|
||||||
</div>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ export class RequestSamples extends React.Component<RequestSamplesProps> {
|
||||||
</TabList>
|
</TabList>
|
||||||
{hasBodySample && (
|
{hasBodySample && (
|
||||||
<TabPanel key="payload">
|
<TabPanel key="payload">
|
||||||
<PayloadSamples content={requestBodyContent!} />
|
<div> <PayloadSamples content={requestBodyContent!} /> </div>
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
)}
|
)}
|
||||||
{samples.map(sample => (
|
{samples.map(sample => (
|
||||||
|
|
|
@ -35,7 +35,9 @@ export class ResponseSamples extends React.Component<ResponseSamplesProps> {
|
||||||
</TabList>
|
</TabList>
|
||||||
{responses.map(response => (
|
{responses.map(response => (
|
||||||
<TabPanel key={response.code}>
|
<TabPanel key={response.code}>
|
||||||
<PayloadSamples content={response.content!} />
|
<div>
|
||||||
|
<PayloadSamples content={response.content!} />
|
||||||
|
</div>
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
))}
|
))}
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user