This repository was archived by the owner on Jan 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 74
Expand file tree
/
Copy pathFooter.tsx
More file actions
88 lines (81 loc) · 2.29 KB
/
Footer.tsx
File metadata and controls
88 lines (81 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import styled from '@emotion/styled';
import React from 'react';
import { useTranslation, Trans } from 'react-i18next';
import { Austria, Brazil, Earth, Nicaragua, Spain, Germany, India, China, Taiwan } from 'verdaccio-ui/components/Icons';
import Logo from 'verdaccio-ui/components/Logo';
import { Theme } from 'verdaccio-ui/design-tokens/theme';
import { useConfig } from 'verdaccio-ui/providers/config';
import { goToVerdaccioWebsite } from 'verdaccio-ui/utils/windows';
import { Wrapper, Left, Right, Love, Inner } from './styles';
/* eslint-disable react/jsx-key */
const Footer = () => {
const { t } = useTranslation();
const { configOptions } = useConfig();
return (
<Wrapper>
<Inner>
<Left>
<Trans components={[<Love />]} i18nKey="footer.made-with-love-on" />
<ToolTip>
<StyledEarth />
<Flags>
<Spain />
<Nicaragua />
<India />
<Brazil />
<China />
<Austria />
<Germany />
<Taiwan />
</Flags>
</ToolTip>
</Left>
<Right>
{configOptions?.version && (
<>
{t('footer.powered-by')}
<Logo onClick={goToVerdaccioWebsite} size="x-small" />
{`/ ${configOptions.version}`}
</>
)}
</Right>
</Inner>
</Wrapper>
);
};
export default Footer;
const StyledEarth = styled(Earth)<{ theme?: Theme }>(({ theme }) => ({
margin: theme.spacing(0, 1),
}));
const Flags = styled('span')<{ theme?: Theme }>(({ theme }) => ({
display: 'inline-grid',
gridTemplateColumns: 'repeat(8, max-content)',
gridGap: theme.spacing(0, 1),
position: 'absolute',
background: theme?.palette.greyAthens,
padding: '1px 4px',
borderRadius: 3,
height: 20,
alignItems: 'center',
visibility: 'hidden',
top: -2,
':before': {
content: "''",
position: 'absolute',
top: '29%',
left: -4,
marginLeft: -5,
border: '5px solid',
borderColor: `${theme?.palette.greyAthens} transparent transparent transparent`,
transform: 'rotate(90deg)',
},
}));
const ToolTip = styled('span')({
position: 'relative',
height: '18px',
':hover': {
[`${Flags}`]: {
visibility: 'visible',
},
},
});