chore: refactor MediaTypesSwitch

This commit is contained in:
Roman Hotsiy 2018-07-14 16:37:36 +03:00
parent 95e3c4ad76
commit e6ebdb7095
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0
4 changed files with 8 additions and 5 deletions

View File

@ -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`

View File

@ -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> </>
); );
} }
} }

View File

@ -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 => (

View File

@ -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>