summaryrefslogtreecommitdiff
path: root/src/components/NavBar.tsx
blob: f050d7ace3487a24664a43577ee0c130908ea0ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { Link } from 'react-router-dom';
import { AppBar, Toolbar, Typography } from '@mui/material';
import useMediaQuery from '@mui/material/useMediaQuery';
import Desktop from './Desktop';
import Mobile from './Mobile';

function NavBar() {
  const isMobile = useMediaQuery('(max-width: 1000px)');

  return (
    <AppBar position="relative">
      <Toolbar>
        <Typography
          variant="h5"
          component={Link}
          to="/"
          color="inherit"
          sx={{ textDecoration: 'none' }}
        >
          Madison and Michael's Wedding
        </Typography>
        {isMobile ? <Mobile /> : <Desktop />}
      </Toolbar>
    </AppBar>
  );
}

export default NavBar;