Added files and folders into /src directory.

This commit is contained in:
Lucid Kobold
2022-04-22 20:58:15 -05:00
parent 17d90ce958
commit 436f79b933
24 changed files with 11 additions and 11 deletions

View File

@@ -0,0 +1,56 @@
import React, { FC, Fragment } from "react";
import {
Button,
Link,
MenuDivider,
MenuItem,
MenuList
} from "@chakra-ui/react";
import navItems, { NavItem } from "./navItems";
interface MobileNavProps {
updateOpen: React.Dispatch<React.SetStateAction<boolean>>;
}
const MobileNav: FC<MobileNavProps> = ({ updateOpen }: MobileNavProps) => {
return (
<MenuList
as="nav"
d={{ base: "block", lg: "none" }}
bg="brand.main"
h="auto"
w="100%"
p={0}
border="none"
boxShadow="none"
>
{navItems.map((navItem: NavItem, index: number) => {
return (
<MenuItem
id={"mobile-" + navItem[0]}
key={navItem[0]}
w="auto"
h="auto"
p={0}
_hover={{
backgroundColor: "none"
}}
_focus={{
backgroundColor: "none"
}}
>
<Link onClick={() => updateOpen(false)} href={navItem[1]}>
{index === 0 ? <MenuDivider /> : <Fragment></Fragment>}
<Button w="100vw" variant={"nav"} p={0} m="auto">
{navItem[0]}
</Button>
<MenuDivider />
</Link>
</MenuItem>
);
})}
</MenuList>
);
};
export default MobileNav;