Skip to content

Commit e4b3c54

Browse files
committed
Fix broken footer tsc
1 parent d244be3 commit e4b3c54

File tree

2 files changed

+49
-71
lines changed

2 files changed

+49
-71
lines changed

src/Footer.tsx

Lines changed: 27 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,30 @@
1-
import logo from './assets/images/logo.png';
1+
import { type ReactElement} from 'react'
2+
import logo from './assets/images/logo.png'
23
import { Link } from 'react-router-dom'
3-
import { Box, Grid, Typography, Avatar } from '@mui/material';
4-
import Icons from './Icons';
4+
import { Box, Avatar } from '@mui/material'
5+
import Icons from './Icons'
56

6-
const Footer = () => {
7-
return (
8-
<Box
9-
sx={{
10-
backgroundColor: 'black',
11-
padding: 5,
12-
color: 'white',
13-
position: "sticky",
14-
}}
15-
>
16-
<Grid container justifyContent="space-between" alignItems="center" >
17-
<Grid
18-
item
19-
xs={12}
20-
md={6}
21-
sx={{
22-
display: { xs: 'none', md: 'block' },
23-
textAlign: 'left',
24-
}}
25-
>
26-
<Link to="/" style={{ textDecoration: 'none', paddingLeft: '5rem', flexShrink: 0 }}>
27-
<Avatar src={logo} alt="Logo WDT" sx={{ width: '100%', height: '100%', maxWidth: '100px' }} />
28-
</Link>
29-
</Grid>
30-
<Grid
31-
item
32-
xs={12}
33-
md={6}
34-
sx={{
35-
textAlign: { xs: 'center', md: 'right' },
36-
}}
37-
>
38-
<Icons color={"#ffff"}/>
39-
</Grid>
40-
</Grid>
41-
</Box>
42-
);
43-
};
7+
const Footer = (): ReactElement => {
8+
return (
9+
<Box
10+
sx={{
11+
backgroundColor: theme => theme.palette.primary.main,
12+
px: 6,
13+
py: 1,
14+
color: 'white',
15+
position: "sticky",
16+
display: 'flex',
17+
justifyContent: { xs: 'center', md: 'space-between' }
18+
}}
19+
>
20+
<Box sx={{ display: { xs: 'none', md: 'flex' } }} >
21+
<Link to="/" style={{ textDecoration: 'none', flexShrink: 0 }}>
22+
<Avatar src={logo} alt="Logo WDT" sx={{ width: '100%', height: '100%', maxWidth: '50px' }} />
23+
</Link>
24+
</Box>
25+
<Icons color={"#ffff"}/>
26+
</Box>
27+
)
28+
}
4429

45-
export default Footer;
30+
export default Footer

src/Icons.tsx

Lines changed: 22 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,69 @@
1-
import { FC, ReactElement } from 'react';
2-
import { Box, IconButton, Link } from '@mui/material';
3-
import FacebookIcon from '@mui/icons-material/Facebook';
4-
import InstagramIcon from '@mui/icons-material/Instagram';
5-
import XIcon from '@mui/icons-material/X';
6-
import LinkedInIcon from '@mui/icons-material/LinkedIn';
7-
import EmailIcon from '@mui/icons-material/Email';
8-
import PatreonIcon from './PatreonIcon';
1+
import { FC, type ReactElement } from 'react'
2+
import { Box, IconButton, Link } from '@mui/material'
3+
import FacebookIcon from '@mui/icons-material/Facebook'
4+
import InstagramIcon from '@mui/icons-material/Instagram'
5+
import XIcon from '@mui/icons-material/X'
6+
import LinkedInIcon from '@mui/icons-material/LinkedIn'
7+
import EmailIcon from '@mui/icons-material/Email'
8+
import PatreonIcon from './PatreonIcon'
99

1010
interface IconsProps {
11-
color: {
12-
facebook?: string;
13-
instagram?: string;
14-
twitter?: string;
15-
linkedin?: string;
16-
patreon?: string;
17-
email?: string;
18-
};
19-
}
11+
color: string
12+
}
2013

21-
const Icons: FC<IconsProps> = ({ color }) => {
14+
const Icons: FC<IconsProps> = ({ color }): ReactElement => {
2215
return (
23-
<Box>
16+
<Box sx={{ display: 'flex' }}>
2417
<IconButton
2518
component={Link}
2619
href="https://www.facebook.com/ColimaWebDevTalks"
2720
target="_blank"
28-
sx={{ color: color?.facebook || 'inherit' }}
21+
sx={{ color: color ?? 'inherit' }}
2922
>
3023
<FacebookIcon fontSize="large" />
3124
</IconButton>
3225
<IconButton
3326
component={Link}
3427
href="https://www.instagram.com/webdevtalksmx"
3528
target="_blank"
36-
sx={{ color: color?.instagram || 'inherit' }}
29+
sx={{ color: color ?? 'inherit' }}
3730
>
3831
<InstagramIcon fontSize="large" />
3932
</IconButton>
4033
<IconButton
4134
component={Link}
4235
href="https://twitter.com/webdevtalksmx"
4336
target="_blank"
44-
sx={{ color: color?.twitter || 'inherit' }}
37+
sx={{ color: color ?? 'inherit' }}
4538
>
4639
<XIcon fontSize="large" />
4740
</IconButton>
4841
<IconButton
4942
component={Link}
5043
href="https://www.linkedin.com/company/web-dev-talks"
5144
target="_blank"
52-
sx={{ color: color?.linkedin || 'inherit' }}
45+
sx={{ color: color ?? 'inherit' }}
5346
>
5447
<LinkedInIcon fontSize="large" />
5548
</IconButton>
5649
<IconButton
5750
component={Link}
5851
href="https://patreon.com/WebDevTalksColima"
5952
target="_blank"
60-
sx={{ color: color?.patreon || 'inherit' }}
53+
sx={{ color: color ?? 'inherit' }}
6154
>
6255
<PatreonIcon />
6356
</IconButton>
6457
<IconButton
6558
component={Link}
6659
href="mailto:[email protected]"
6760
target="_blank"
68-
sx={{ color: color?.email || 'inherit' }}
61+
sx={{ color: color ?? 'inherit' }}
6962
>
7063
<EmailIcon fontSize="large" />
7164
</IconButton>
7265
</Box>
73-
) as ReactElement;
74-
};
75-
76-
export default Icons;
66+
)
67+
}
68+
69+
export default Icons

0 commit comments

Comments
 (0)