diff options
Diffstat (limited to 'src/components/ScrollTopArrow/ScrollTopArrow.tsx')
-rw-r--r-- | src/components/ScrollTopArrow/ScrollTopArrow.tsx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/components/ScrollTopArrow/ScrollTopArrow.tsx b/src/components/ScrollTopArrow/ScrollTopArrow.tsx index dfa573f..08b8591 100644 --- a/src/components/ScrollTopArrow/ScrollTopArrow.tsx +++ b/src/components/ScrollTopArrow/ScrollTopArrow.tsx @@ -27,7 +27,7 @@ const ScrollTopArrow: React.FC = () => { const [showScroll, setShowScroll] = useState(false); const theme = useTheme(); const classes = useStyles(); - const isMobile = useMediaQuery(theme.breakpoints.down("sm")); + const isMobile = useMediaQuery(theme.breakpoints.down('sm')); const checkScrollTop = () => { if (!showScroll && window.pageYOffset > 400) { @@ -45,8 +45,11 @@ const ScrollTopArrow: React.FC = () => { return ( <div className={classes.root}> - {showScroll && !isMobile && - <ArrowUpwardIcon className={classes.icon} color="primary" onClick={scrollTop} />} + { + showScroll + && !isMobile + && <ArrowUpwardIcon className={classes.icon} color="primary" onClick={scrollTop} /> + } </div> ); }; |