mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-26 10:33:44 +03:00
Center logo
This commit is contained in:
parent
0faa66b6e6
commit
14566b3e30
|
@ -1,7 +1,7 @@
|
|||
import { OpenAPIInfo } from '../../types';
|
||||
import * as React from 'react';
|
||||
import { observer } from 'mobx-react';
|
||||
import { LogoImgEl } from './styled.elements';
|
||||
import { LogoImgEl, LogoWrap } from './styled.elements';
|
||||
|
||||
const LinkWrap = url => Component => <a href={url}>{Component}</a>;
|
||||
|
||||
|
@ -15,6 +15,10 @@ export class ApiLogo extends React.Component<{ info: OpenAPIInfo }> {
|
|||
const logo = (
|
||||
<LogoImgEl src={logoInfo.url} style={{ backgroundColor: logoInfo.backgroundColor }} />
|
||||
);
|
||||
return info.contact && info.contact.url ? LinkWrap(info.contact.url)(logo) : logo;
|
||||
return (
|
||||
<LogoWrap>
|
||||
{info.contact && info.contact.url ? LinkWrap(info.contact.url)(logo) : logo}{' '}
|
||||
</LogoWrap>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,3 +6,7 @@ export const LogoImgEl = styled.img`
|
|||
display: inline-block;
|
||||
max-width: 100%;
|
||||
`;
|
||||
|
||||
export const LogoWrap = styled.div`
|
||||
text-align: center;
|
||||
`;
|
||||
|
|
Loading…
Reference in New Issue
Block a user