Skip to content

Commit

Permalink
chore: refactor MediaTypesSwitch
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanHotsiy committed Jul 14, 2018
1 parent 95e3c4a commit e6ebdb7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/common-elements/dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export const SimpleDropdown = StyledDropdown.extend`
text-transform: none;
font-size: 0.929em;
.Dropdown-control {
.Dropdown-control {
font-size: 1em;
border: none;
padding: 0 1.2em 0 0;
Expand All @@ -112,6 +112,7 @@ export const SimpleDropdown = StyledDropdown.extend`
color: ${props => props.theme.colors.main};
box-shadow: none;
}
}
`;

export const MimeLabel = styled.span`
Expand Down
4 changes: 2 additions & 2 deletions src/components/MediaTypeSwitch/MediaTypesSwitch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ export class MediaTypesSwitch extends React.Component<MediaTypesSwitchProps> {
});

return (
<div>
<>
{this.props.renderDropdown({
value: options[activeMimeIdx],
options,
onChange: this.switchMedia,
})}
{this.props.children(content.active)}
</div>
</>
);
}
}
2 changes: 1 addition & 1 deletion src/components/RequestSamples/RequestSamples.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class RequestSamples extends React.Component<RequestSamplesProps> {
</TabList>
{hasBodySample && (
<TabPanel key="payload">
<PayloadSamples content={requestBodyContent!} />
<div> <PayloadSamples content={requestBodyContent!} /> </div>
</TabPanel>
)}
{samples.map(sample => (
Expand Down
4 changes: 3 additions & 1 deletion src/components/ResponseSamples/ResponseSamples.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ export class ResponseSamples extends React.Component<ResponseSamplesProps> {
</TabList>
{responses.map(response => (
<TabPanel key={response.code}>
<PayloadSamples content={response.content!} />
<div>
<PayloadSamples content={response.content!} />
</div>
</TabPanel>
))}
</Tabs>
Expand Down

0 comments on commit e6ebdb7

Please sign in to comment.