Skip to content

Commit f8c0ced

Browse files
committed
feat: enhance footer component to display version information
1 parent e6be108 commit f8c0ced

File tree

1 file changed

+39
-14
lines changed

1 file changed

+39
-14
lines changed

src/ui/shared/footer.tsx

Lines changed: 39 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,55 @@
1-
import { Box, Link, SxProps, Theme } from '@mui/material';
1+
import { Box, Link, SxProps, Theme, Typography } from '@mui/material';
2+
import { useEffect, useState } from 'react';
3+
import Browser from 'webextension-polyfill';
24

35
export function Footer() {
6+
const [version, setVersion] = useState<string>('');
7+
8+
useEffect(() => {
9+
const manifest = Browser.runtime.getManifest();
10+
setVersion(manifest.version);
11+
}, []);
12+
413
const styles: SxProps<Theme> = {
514
width: '100%',
615
color: 'text.primary',
716
borderRadius: 0,
817
display: 'flex',
9-
justifyContent: 'center',
18+
flexDirection: 'column',
19+
alignItems: 'center',
1020
gap: '.5rem',
1121
padding: '1rem 0',
1222
};
1323

24+
const linksStyles: SxProps<Theme> = {
25+
display: 'flex',
26+
justifyContent: 'center',
27+
gap: '.5rem',
28+
};
29+
30+
const versionStyles: SxProps<Theme> = {
31+
fontSize: '0.75rem',
32+
color: 'text.secondary',
33+
opacity: 0.6,
34+
};
35+
1436
return (
1537
<Box sx={styles}>
16-
<Link
17-
target='_blank'
18-
href='https://github.com/material-extensions/material-icons-browser-extension'
19-
>
20-
GitHub
21-
</Link>
22-
<Link
23-
target='_blank'
24-
href='https://github.com/material-extensions/material-icons-browser-extension/issues'
25-
>
26-
Report Issue
27-
</Link>
38+
<Box sx={linksStyles}>
39+
<Link
40+
target='_blank'
41+
href='https://github.com/material-extensions/material-icons-browser-extension'
42+
>
43+
GitHub
44+
</Link>
45+
<Link
46+
target='_blank'
47+
href='https://github.com/material-extensions/material-icons-browser-extension/issues'
48+
>
49+
Report Issue
50+
</Link>
51+
</Box>
52+
{version && <Typography sx={versionStyles}>v{version}</Typography>}
2853
</Box>
2954
);
3055
}

0 commit comments

Comments
 (0)