Skip to content

Instantly share code, notes, and snippets.

@biancadragomir
Created October 8, 2021 16:50
Show Gist options
  • Save biancadragomir/3996e34a459b08378c7c42aae84ffc3d to your computer and use it in GitHub Desktop.
Save biancadragomir/3996e34a459b08378c7c42aae84ffc3d to your computer and use it in GitHub Desktop.
Layout component
// ...
export const Layout = () => {
// will be true on all devices smaller than a desktop
const isDesktopOrUp = useMediaQuery((theme: Theme) => theme.breakpoints.up('lg'));
return <Grid container direction="column">
<Header />
<Content />
// the bottom navigation will be visible on tablets and mobile phones
{!isDesktopOrUp && <BottomNavigationMenu pathname={pathname} />}
</Grid>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment