Skip to content

Commit

Permalink
fix: Redocly logo (#2109)
Browse files Browse the repository at this point in the history
  • Loading branch information
anastasiia-developer authored Aug 2, 2022
1 parent 428fd69 commit a35bb3f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
18 changes: 18 additions & 0 deletions src/components/SideMenu/Logo.tsx
Original file line number Diff line number Diff line change
@@ -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;
}
5 changes: 3 additions & 2 deletions src/components/SideMenu/SideMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 }> {
Expand All @@ -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>
Expand Down

0 comments on commit a35bb3f

Please sign in to comment.