diff --git a/src/components/molecules/CookieConsent/index.tsx b/src/components/molecules/CookieConsent/index.tsx index 331dbed..bcd27c3 100644 --- a/src/components/molecules/CookieConsent/index.tsx +++ b/src/components/molecules/CookieConsent/index.tsx @@ -62,6 +62,9 @@ const CookieConsent = () => { mb: theme.spacing(1), p: theme.spacing(3), zIndex: 9999, + '@media print': { + display: 'none', + }, })}> diff --git a/src/components/molecules/CurriculumItem/CurriculumItem.tsx b/src/components/molecules/CurriculumItem/CurriculumItem.tsx index 2192e1f..237921d 100644 --- a/src/components/molecules/CurriculumItem/CurriculumItem.tsx +++ b/src/components/molecules/CurriculumItem/CurriculumItem.tsx @@ -32,10 +32,16 @@ const CurriculumItem = (props: CurriculumEntryProps) => { // '& .MuiAccordionSummary-expandIconWrapper .MuiSvgIcon-root': { color: 'primary.dark' }, // use summary hover icon color }, '&.Mui-expanded': { + bgcolor: 'background.paper', // use summary hover background borderBottom: '1px solid', borderTop: '1px solid', - bgcolor: 'background.paper', // use summary hover background elevation: 1, + '@media print': { + bgcolor: 'background.default', + borderBottom: 0, + borderTop: 0, + elevation: 0, + }, // '& .MuiAccordionSummary-expandIconWrapper .MuiSvgIcon-root': { color: 'primary.dark' }, // use summary hover icon color }, }}> @@ -48,6 +54,9 @@ const CurriculumItem = (props: CurriculumEntryProps) => { }, '& .MuiAccordionSummary-expandIconWrapper.Mui-expanded': { transform: 'rotate(0deg)', + '@media print': { + transform: 'rotate(-90deg)', + }, }, '& .MuiAccordionSummary-content': { marginLeft: 2, diff --git a/src/components/molecules/Footer/index.tsx b/src/components/molecules/Footer/index.tsx index a34a5de..ec145fc 100644 --- a/src/components/molecules/Footer/index.tsx +++ b/src/components/molecules/Footer/index.tsx @@ -14,7 +14,17 @@ type FooterProps = { const Footer: React.FC = ({ showCookieConsent = true }) => { const year = new Date().getFullYear() return ( - + diff --git a/src/components/molecules/ProjectSpotlight/ProjectSpotlight.tsx b/src/components/molecules/ProjectSpotlight/ProjectSpotlight.tsx index 05d2d3c..a02114d 100644 --- a/src/components/molecules/ProjectSpotlight/ProjectSpotlight.tsx +++ b/src/components/molecules/ProjectSpotlight/ProjectSpotlight.tsx @@ -1,6 +1,6 @@ import React from 'react' import { ParallaxBanner, ParallaxProvider } from 'react-scroll-parallax' -import { Box, Grid, IconButton, Typography, useTheme } from '@mui/material' +import { Box, Grid, IconButton, Typography } from '@mui/material' import { ExpandMore } from '@mui/icons-material' import { useViewport } from 'components/utils/viewport/index.js' @@ -125,79 +125,91 @@ const Description = (props: Props) => { } } -const DesktopComponent = React.forwardRef((props, ref) => { - return ( -
- - ((props, ref) => { + const { width } = useViewport() - height: '100vh', - overflow: 'hidden', - }}> - - {props.scrollTarget && ( - (props.scrollTarget as React.RefObject).current?.scrollIntoView()} - sx={{ position: 'absolute', p: 1, bottom: 2, left: '50%', transform: 'translate(-50%, 0)' }}> - - - )} - - -
- ) -}) - -const MobileComponent = React.forwardRef((props, ref) => { return ( - - + ({ - mt: theme.spacing(-1.05), - borderTopStyle: 'solid', - borderTopWidth: theme.spacing(0.5), - borderTopColor: theme.palette.primary.main, - p: `${theme.spacing(7)} ${theme.spacing(5)} ${theme.spacing(5.5)} ${theme.spacing(5)}`, + display: width < theme.breakpoints.values.md ? 'none' : 'inline', + '@media print': { display: 'none' }, })}> - {props.title} - {props.caption} - {props.children} + + + + {props.scrollTarget && ( + (props.scrollTarget as React.RefObject).current?.scrollIntoView()} + sx={{ position: 'absolute', p: 1, bottom: 2, left: '50%', transform: 'translate(-50%, 0)' }}> + + + )} + + + + ({ + display: width >= theme.breakpoints.values.md ? 'none' : 'inline', + '@media print': { + display: 'inline', + height: '100%', + }, + })}> + + ({ + mt: theme.spacing(-1.05), + borderTopStyle: 'solid', + borderTopWidth: theme.spacing(0.5), + borderTopColor: theme.palette.primary.main, + p: `${theme.spacing(7)} ${theme.spacing(5)} ${theme.spacing(5.5)} ${theme.spacing(5)}`, + '@media print': { + backgroundColor: 'background.default', + }, + })}> + {props.title} + {props.caption} + {props.children} + ) }) -const ProjectSpotlight = React.forwardRef((props, ref) => { - const { width } = useViewport() - const theme = useTheme() - - return width < theme.breakpoints.values.md ? : -}) - export default ProjectSpotlight diff --git a/src/components/molecules/Toolbar/index.tsx b/src/components/molecules/Toolbar/index.tsx index aeaeeb5..aeb701d 100644 --- a/src/components/molecules/Toolbar/index.tsx +++ b/src/components/molecules/Toolbar/index.tsx @@ -15,22 +15,30 @@ import { Stack, Toolbar, Typography, + TypographyProps, styled, useScrollTrigger, useTheme, } from '@mui/material' import MenuIcon from '@mui/icons-material/Menu' -const AppBarButton = styled(Button)(({ theme }) => ({ - textTransform: 'none', - color: theme.palette.mode === 'dark' ? 'inherit' : 'text.secondary', - ':hover': { - backgroundColor: 'transparent', - ...(theme.palette.mode === 'dark' && { +const TypographyLink = styled(Typography)(({ theme }) => ({ + role: 'link', + textDecoration: 'none', + ...(theme.palette.mode === 'dark' && { + color: 'inherit', + ':hover': { color: theme.palette.primary.main, - }), - }, + }, + }), + ...(theme.palette.mode === 'light' && { + color: theme.palette.text.primary, + ':hover': { + color: theme.palette.primary.dark, + }, + }), })) +const AppBarLink = (props: TypographyProps & { to: string }) => const DrawerButton = styled(ListItemButton)(({ theme }) => ({ textTransform: 'none', color: 'inherit', @@ -102,6 +110,7 @@ const CustomToolbar: React.FC = ({ drawerWidth = 240, window {...props} sx={{ backgroundColor: trigger ? 'background.paper' : 'transparent', + '@media print': { backgroundColor: 'background.default' }, ...(theme.palette.mode === 'light' && { backgroundColor: 'hsla(0, 0%, 100%, 0.75)', backdropFilter: 'blur(8px)', @@ -115,6 +124,7 @@ const CustomToolbar: React.FC = ({ drawerWidth = 240, window theme.breakpoints.values.lg, mx: 'auto' }, }}> @@ -123,58 +133,47 @@ const CustomToolbar: React.FC = ({ drawerWidth = 240, window aria-label="open drawer" edge="start" onClick={handleDrawerToggle} - sx={{ mr: 2, display: { md: 'none' }, position: 'absolute', backgroundColor: 'primary' }}> + sx={{ + mr: 2, + display: { md: 'none' }, + position: 'absolute', + backgroundColor: 'primary', + '@media print': { display: 'none' }, + }}> - ({ - color: theme.palette.text.primary, [theme.breakpoints.down('md')]: { mx: 'auto' }, [theme.breakpoints.up('md')]: { mr: 'auto' }, })}> - Michele Tartari - - - - Home - - - Projects - - - Curriculum - - - + + {drawer} + ) } diff --git a/src/components/templates/Page/Page.tsx b/src/components/templates/Page/Page.tsx index 9508681..b4d776a 100644 --- a/src/components/templates/Page/Page.tsx +++ b/src/components/templates/Page/Page.tsx @@ -19,11 +19,17 @@ const Page: React.FC = ({ title, children, showCookieConsent, ...prop }, [title]) return ( - + {title && ( <> = ({ title, children, showCookieConsent, ...prop )}