|
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' |
9 | 9 |
|
10 | 10 | 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 | +} |
20 | 13 |
|
21 | | - const Icons: FC<IconsProps> = ({ color }) => { |
| 14 | + const Icons: FC<IconsProps> = ({ color }): ReactElement => { |
22 | 15 | return ( |
23 | | - <Box> |
| 16 | + <Box sx={{ display: 'flex' }}> |
24 | 17 | <IconButton |
25 | 18 | component={Link} |
26 | 19 | href="https://www.facebook.com/ColimaWebDevTalks" |
27 | 20 | target="_blank" |
28 | | - sx={{ color: color?.facebook || 'inherit' }} |
| 21 | + sx={{ color: color ?? 'inherit' }} |
29 | 22 | > |
30 | 23 | <FacebookIcon fontSize="large" /> |
31 | 24 | </IconButton> |
32 | 25 | <IconButton |
33 | 26 | component={Link} |
34 | 27 | href="https://www.instagram.com/webdevtalksmx" |
35 | 28 | target="_blank" |
36 | | - sx={{ color: color?.instagram || 'inherit' }} |
| 29 | + sx={{ color: color ?? 'inherit' }} |
37 | 30 | > |
38 | 31 | <InstagramIcon fontSize="large" /> |
39 | 32 | </IconButton> |
40 | 33 | <IconButton |
41 | 34 | component={Link} |
42 | 35 | href="https://twitter.com/webdevtalksmx" |
43 | 36 | target="_blank" |
44 | | - sx={{ color: color?.twitter || 'inherit' }} |
| 37 | + sx={{ color: color ?? 'inherit' }} |
45 | 38 | > |
46 | 39 | <XIcon fontSize="large" /> |
47 | 40 | </IconButton> |
48 | 41 | <IconButton |
49 | 42 | component={Link} |
50 | 43 | href="https://www.linkedin.com/company/web-dev-talks" |
51 | 44 | target="_blank" |
52 | | - sx={{ color: color?.linkedin || 'inherit' }} |
| 45 | + sx={{ color: color ?? 'inherit' }} |
53 | 46 | > |
54 | 47 | <LinkedInIcon fontSize="large" /> |
55 | 48 | </IconButton> |
56 | 49 | <IconButton |
57 | 50 | component={Link} |
58 | 51 | href="https://patreon.com/WebDevTalksColima" |
59 | 52 | target="_blank" |
60 | | - sx={{ color: color?.patreon || 'inherit' }} |
| 53 | + sx={{ color: color ?? 'inherit' }} |
61 | 54 | > |
62 | 55 | <PatreonIcon /> |
63 | 56 | </IconButton> |
64 | 57 | <IconButton |
65 | 58 | component={Link} |
66 | 59 | href="mailto:contacto@webdevtalks.mx" |
67 | 60 | target="_blank" |
68 | | - sx={{ color: color?.email || 'inherit' }} |
| 61 | + sx={{ color: color ?? 'inherit' }} |
69 | 62 | > |
70 | 63 | <EmailIcon fontSize="large" /> |
71 | 64 | </IconButton> |
72 | 65 | </Box> |
73 | | - ) as ReactElement; |
74 | | - }; |
75 | | - |
76 | | - export default Icons; |
| 66 | + ) |
| 67 | + } |
| 68 | + |
| 69 | + export default Icons |
0 commit comments