mirror of
https://github.com/Redocly/redoc.git
synced 2025-06-29 00:33:04 +03:00
fix: Redocly logo (#2109)
This commit is contained in:
parent
428fd6983d
commit
a35bb3ff26
18
src/components/SideMenu/Logo.tsx
Normal file
18
src/components/SideMenu/Logo.tsx
Normal 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;
|
||||||
|
}
|
|
@ -8,6 +8,7 @@ import { MenuItems } from './MenuItems';
|
||||||
|
|
||||||
import { PerfectScrollbarWrap } from '../../common-elements/perfect-scrollbar';
|
import { PerfectScrollbarWrap } from '../../common-elements/perfect-scrollbar';
|
||||||
import { RedocAttribution } from './styled.elements';
|
import { RedocAttribution } from './styled.elements';
|
||||||
|
import RedoclyLogo from './Logo';
|
||||||
|
|
||||||
@observer
|
@observer
|
||||||
export class SideMenu extends React.Component<{ menu: MenuStore; className?: string }> {
|
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} />
|
<MenuItems items={store.items} onActivate={this.activate} root={true} />
|
||||||
<RedocAttribution>
|
<RedocAttribution>
|
||||||
<a target="_blank" rel="noopener noreferrer" href="https://redocly.com/redoc/">
|
<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
|
<RedoclyLogo />
|
||||||
by Redocly
|
API docs by Redocly
|
||||||
</a>
|
</a>
|
||||||
</RedocAttribution>
|
</RedocAttribution>
|
||||||
</PerfectScrollbarWrap>
|
</PerfectScrollbarWrap>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user