fix: Redocly logo (#2109)

This commit is contained in:
Anastasiia Derymarko 2022-08-02 14:13:41 +03:00 committed by GitHub
parent 428fd6983d
commit a35bb3ff26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 2 deletions

View File

@ -0,0 +1,18 @@
import { useEffect, useState } from 'react';
import * as React from 'react';
export default function RedoclyLogo(): JSX.Element | null {
const [isDisplay, setDisplay] = useState(false);
useEffect(() => {
setDisplay(true);
}, []);
return isDisplay ? (
<img
alt={'redocly logo'}
onError={() => setDisplay(false)}
src={'https://cdn.redoc.ly/redoc/logo-mini.svg'}
/>
) : null;
}

View File

@ -8,6 +8,7 @@ import { MenuItems } from './MenuItems';
import { PerfectScrollbarWrap } from '../../common-elements/perfect-scrollbar';
import { RedocAttribution } from './styled.elements';
import RedoclyLogo from './Logo';
@observer
export class SideMenu extends React.Component<{ menu: MenuStore; className?: string }> {
@ -27,8 +28,8 @@ export class SideMenu extends React.Component<{ menu: MenuStore; className?: str
<MenuItems items={store.items} onActivate={this.activate} root={true} />
<RedocAttribution>
<a target="_blank" rel="noopener noreferrer" href="https://redocly.com/redoc/">
<img src={'https://cdn.redoc.ly/redoc/logo-mini.svg'} alt={'redocly logo'} /> API docs
by Redocly
<RedoclyLogo />
API docs by Redocly
</a>
</RedocAttribution>
</PerfectScrollbarWrap>