mirror of
https://github.com/SomboChea/ui
synced 2024-11-05 06:04:28 +07:00
53 lines
1.2 KiB
TypeScript
53 lines
1.2 KiB
TypeScript
import React from 'react';
|
|
|
|
import { Wrapper, Left, Right, Earth, Flags, Love, Flag, Logo, Inner, ToolTip } from './styles';
|
|
import { goToVerdaccioWebsite } from '../../utils/windows';
|
|
|
|
const renderTooltip = (): JSX.Element => (
|
|
<ToolTip>
|
|
<Earth name="earth" size="md" />
|
|
<Flags>
|
|
<Flag name="spain" size="md" />
|
|
<Flag name="nicaragua" size="md" />
|
|
<Flag name="india" size="md" />
|
|
<Flag name="brazil" size="md" />
|
|
<Flag name="china" size="md" />
|
|
<Flag name="austria" size="md" />
|
|
</Flags>
|
|
</ToolTip>
|
|
);
|
|
const POWERED_LABEL = 'Powered by';
|
|
const MADEWITH_LABEL = ' Made with';
|
|
const ON_LABEL = 'on';
|
|
const HEARTH_EMOJI = '♥';
|
|
|
|
const renderRight = (version = window.VERDACCIO_VERSION): JSX.Element => {
|
|
return (
|
|
<Right>
|
|
{POWERED_LABEL}
|
|
<Logo img={true} name="verdaccio" onClick={goToVerdaccioWebsite} pointer={true} size="md" />
|
|
{`/ ${version}`}
|
|
</Right>
|
|
);
|
|
};
|
|
|
|
const renderLeft = (): JSX.Element => (
|
|
<Left>
|
|
{MADEWITH_LABEL}
|
|
<Love>{HEARTH_EMOJI}</Love>
|
|
{ON_LABEL}
|
|
{renderTooltip()}
|
|
</Left>
|
|
);
|
|
|
|
const Footer: React.FC = () => (
|
|
<Wrapper>
|
|
<Inner>
|
|
{renderLeft()}
|
|
{renderRight()}
|
|
</Inner>
|
|
</Wrapper>
|
|
);
|
|
|
|
export default Footer;
|