mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-24 01:23:43 +03:00
Merge branch 'master' of github.com:Redocly/redoc into feat/sideNavStyle-idonly
This commit is contained in:
commit
d291b69d99
|
@ -6,6 +6,23 @@ import { Link, UnderlinedHeader } from '../../common-elements/';
|
||||||
import { SecurityRequirementModel } from '../../services/models/SecurityRequirement';
|
import { SecurityRequirementModel } from '../../services/models/SecurityRequirement';
|
||||||
import { linksCss } from '../Markdown/styled.elements';
|
import { linksCss } from '../Markdown/styled.elements';
|
||||||
|
|
||||||
|
const ScopeNameList = styled.ul`
|
||||||
|
display: inline;
|
||||||
|
list-style: none;
|
||||||
|
padding: 0;
|
||||||
|
|
||||||
|
li {
|
||||||
|
display: inherit;
|
||||||
|
|
||||||
|
&:after {
|
||||||
|
content: ',';
|
||||||
|
}
|
||||||
|
&:last-child:after {
|
||||||
|
content: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
const ScopeName = styled.code`
|
const ScopeName = styled.code`
|
||||||
font-size: ${props => props.theme.typography.code.fontSize};
|
font-size: ${props => props.theme.typography.code.fontSize};
|
||||||
font-family: ${props => props.theme.typography.code.fontFamily};
|
font-family: ${props => props.theme.typography.code.fontFamily};
|
||||||
|
@ -14,13 +31,6 @@ const ScopeName = styled.code`
|
||||||
padding: 0.2em;
|
padding: 0.2em;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
|
|
||||||
&:after {
|
|
||||||
content: ',';
|
|
||||||
}
|
|
||||||
&:last-child:after {
|
|
||||||
content: none;
|
|
||||||
}
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const SecurityRequirementAndWrap = styled.span`
|
const SecurityRequirementAndWrap = styled.span`
|
||||||
|
@ -72,9 +82,13 @@ export class SecurityRequirement extends React.PureComponent<SecurityRequirement
|
||||||
<SecurityRequirementAndWrap key={scheme.id}>
|
<SecurityRequirementAndWrap key={scheme.id}>
|
||||||
<Link to={scheme.sectionId}>{scheme.displayName}</Link>
|
<Link to={scheme.sectionId}>{scheme.displayName}</Link>
|
||||||
{scheme.scopes.length > 0 && ' ('}
|
{scheme.scopes.length > 0 && ' ('}
|
||||||
|
<ScopeNameList>
|
||||||
{scheme.scopes.map(scope => (
|
{scheme.scopes.map(scope => (
|
||||||
<ScopeName key={scope}>{scope}</ScopeName>
|
<li key={scope}>
|
||||||
|
<ScopeName>{scope}</ScopeName>
|
||||||
|
</li>
|
||||||
))}
|
))}
|
||||||
|
</ScopeNameList>
|
||||||
{scheme.scopes.length > 0 && ') '}
|
{scheme.scopes.length > 0 && ') '}
|
||||||
</SecurityRequirementAndWrap>
|
</SecurityRequirementAndWrap>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user