Skip to content

Commit 43933e5

Browse files
committed
refactor(tsx): convert Footer component
1 parent 500ecb6 commit 43933e5

File tree

4 files changed

+62
-53
lines changed

4 files changed

+62
-53
lines changed

src/ui/assets/jss/material-dashboard-react/components/footerStyle.js

Lines changed: 0 additions & 49 deletions
This file was deleted.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import { Theme } from '@material-ui/core/styles';
2+
import { createStyles } from '@material-ui/styles';
3+
import { defaultFont, container, primaryColor, grayColor } from '../../material-dashboard-react';
4+
5+
const footerStyle = (theme: Theme) =>
6+
createStyles({
7+
block: {
8+
color: 'inherit',
9+
padding: '15px',
10+
textTransform: 'uppercase',
11+
borderRadius: '3px',
12+
textDecoration: 'none',
13+
position: 'relative',
14+
display: 'block',
15+
...defaultFont,
16+
fontWeight: 500,
17+
fontSize: '12px',
18+
},
19+
left: {
20+
float: 'left !important' as 'left',
21+
display: 'block',
22+
},
23+
right: {
24+
padding: '15px 0',
25+
margin: '0',
26+
fontSize: '14px',
27+
float: 'right !important' as 'right',
28+
},
29+
footer: {
30+
bottom: '0',
31+
borderTop: `1px solid ${grayColor[11]}`,
32+
padding: '15px 0',
33+
...defaultFont,
34+
},
35+
container: {
36+
...container,
37+
},
38+
a: {
39+
color: primaryColor[0],
40+
textDecoration: 'none',
41+
backgroundColor: 'transparent',
42+
},
43+
list: {
44+
marginBottom: '0',
45+
padding: '0',
46+
marginTop: '0',
47+
},
48+
inlineBlock: {
49+
display: 'inline-block',
50+
padding: '0px',
51+
width: 'auto',
52+
},
53+
});
54+
55+
export default footerStyle;

src/ui/components/Footer/Footer.jsx renamed to src/ui/components/Footer/Footer.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ import { MarkGithubIcon } from '@primer/octicons-react';
77

88
const useStyles = makeStyles(styles);
99

10-
export default function Footer() {
10+
const Footer: React.FC = () => {
1111
const classes = useStyles();
12+
1213
return (
1314
<footer className={classes.footer}>
1415
<div className={classes.container}>
@@ -27,9 +28,11 @@ export default function Footer() {
2728
</List>
2829
</div>
2930
<p className={classes.right}>
30-
<span>&copy; {1900 + new Date().getYear()} GitProxy</span>
31+
<span>&copy; {new Date().getFullYear()} GitProxy</span>
3132
</p>
3233
</div>
3334
</footer>
3435
);
35-
}
36+
};
37+
38+
export default Footer;

src/ui/components/Navbars/Navbar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Menu from '@material-ui/icons/Menu';
99
import DashboardNavbarLinks from './DashboardNavbarLinks';
1010
import styles from '../../assets/jss/material-dashboard-react/components/headerStyle';
1111

12-
const useStyles = makeStyles(styles);
12+
const useStyles = makeStyles(styles as any);
1313

1414
interface Route {
1515
component: any;

0 commit comments

Comments
 (0)