autonomic-zone-gatsby/src/components/nav-menu.js

37 lines
983 B
JavaScript
Raw Normal View History

2023-01-06 12:33:29 +00:00
import { Box, Link, Stack } from "@mui/material"
2023-01-05 10:54:28 +00:00
import { Link as GatsbyLink } from "gatsby"
import React from "react"
const navMenuItems = [
2023-01-06 12:33:29 +00:00
{ label: "Home", path: "/" },
{ label: "About", path: "/about" },
{ label: "Services", path: "/services" },
{ label: "Our work", path: "/work" },
{ label: "Handbook", path: "/handbook" },
{ label: "Blog", path: "/blog" },
2023-01-05 10:54:28 +00:00
]
2023-01-06 12:33:29 +00:00
const NavMenu = ({ location }) => {
2023-01-05 10:54:28 +00:00
return (
2023-01-06 12:33:29 +00:00
<Box pt={18} component="nav">
<Stack spacing={2} alignItems="flex-end" mr={8}>
{navMenuItems.map(({ label, path }) => (
<Link
component={GatsbyLink}
to={path}
key={label}
color={location.pathname === path ? "secondary.main" : "inherit"}
textTransform="uppercase"
fontFamily={`"Darker Grotesque", sans-serif`}
fontWeight={600}
>
{label}
</Link>
2023-01-05 10:54:28 +00:00
))}
2023-01-06 12:33:29 +00:00
</Stack>
</Box>
2023-01-05 10:54:28 +00:00
)
}
2023-01-06 12:33:29 +00:00
export default NavMenu