♻️ refactor(atoms): standalone icon links
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
import { Email, LinkedIn, GitHub, Description } from '@mui/icons-material'
|
||||
import { IconButtonProps } from '@mui/material'
|
||||
|
||||
import IconButton from '../IconButton'
|
||||
|
||||
interface IconLinkProps extends IconButtonProps {
|
||||
href: string
|
||||
fontSize?: 'small' | 'large' | 'medium' | 'inherit'
|
||||
}
|
||||
|
||||
export const DescriptionIconLink = ({ href: to, fontSize, ...props }: IconLinkProps) => {
|
||||
return (
|
||||
<IconButton aria-label="Email-button" onClick={() => window.open(to, '_blank')} {...props}>
|
||||
<Description fontSize={fontSize} />
|
||||
</IconButton>
|
||||
)
|
||||
}
|
||||
|
||||
export const EmailIconLink = ({ href: to, fontSize, ...props }: IconLinkProps) => {
|
||||
return (
|
||||
<IconButton aria-label="Email-button" onClick={() => window.open(to, '_blank')} {...props}>
|
||||
<Email fontSize={fontSize} />
|
||||
</IconButton>
|
||||
)
|
||||
}
|
||||
|
||||
export const GitHubIconLink = ({ href: to, fontSize, ...props }: IconLinkProps) => {
|
||||
return (
|
||||
<IconButton aria-label="GitHub-button" onClick={() => window.open(to, '_blank')} {...props}>
|
||||
<GitHub fontSize={fontSize} />
|
||||
</IconButton>
|
||||
)
|
||||
}
|
||||
|
||||
export const LinkedInIconLink = ({ href: to, fontSize, ...props }: IconLinkProps) => {
|
||||
return (
|
||||
<IconButton aria-label="LinkedIn-button" onClick={() => window.open(to, '_blank')} {...props}>
|
||||
<LinkedIn fontSize={fontSize} />
|
||||
</IconButton>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export * from './IconLinks'
|
||||
@@ -1 +1,2 @@
|
||||
export { default as IconLinks } from './IconButton'
|
||||
export * from './IconLinks'
|
||||
|
||||
@@ -1,27 +1,15 @@
|
||||
import { Box, IconButton as MuiIconButton, Stack, Typography, styled } from '@mui/material'
|
||||
import { Email as EmailIcon, LinkedIn as LinkedInIcon, GitHub as GitHubIcon } from '@mui/icons-material'
|
||||
import { Box, Stack, Typography } from '@mui/material'
|
||||
|
||||
const IconButton = styled(MuiIconButton)(({ theme }) => ({
|
||||
':hover': {
|
||||
backgroundColor: 'transparent',
|
||||
color: theme.palette.primary.main,
|
||||
},
|
||||
}))
|
||||
import { EmailIconLink, GitHubIconLink, LinkedInIconLink } from 'components/atoms'
|
||||
|
||||
const Footer = () => {
|
||||
const year = new Date().getFullYear()
|
||||
return (
|
||||
<Box sx={{ bgcolor: 'background.paper', p: 6, display: 'flex', alignItems: 'center', flexDirection: 'column' }} component="footer">
|
||||
<Stack direction="row">
|
||||
<IconButton size="large" aria-label="LinkedIn-button" onClick={() => window.open('https://www.linkedin.com/in/m-tartari/', '_blank')}>
|
||||
<LinkedInIcon fontSize="large" />
|
||||
</IconButton>
|
||||
<IconButton size="large" aria-label="GitHub-button" onClick={() => window.open('https://www.github.com/m-tartari/', '_blank')}>
|
||||
<GitHubIcon fontSize="large" />
|
||||
</IconButton>
|
||||
<IconButton size="large" aria-label="Email-button" onClick={() => window.open('mailto:michele.tartari+web@live.com', '_blank')}>
|
||||
<EmailIcon fontSize="large" />
|
||||
</IconButton>
|
||||
<LinkedInIconLink size="large" fontSize="large" href="https://www.linkedin.com/in/m-tartari/" />
|
||||
<GitHubIconLink size="large" fontSize="large" href="https://www.github.com/m-tartari/" />
|
||||
<EmailIconLink size="large" fontSize="large" href="mailto:michele.tartari+web@live.com" />
|
||||
</Stack>
|
||||
<Typography variant="subtitle2" align="center" color="text.secondary" component="em" mt={3}>
|
||||
© {year} Michele Tartari. All rights reserved.
|
||||
|
||||
Reference in New Issue
Block a user