mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-05-13 06:21:21 -05:00
* side layout initial * add elements to side nav * side buttons links * remove clog * calendar page initial * position sticky working * x trends page initial * new table * same mode selector * mobile friendly table * no underline for nav links * xsearch * x trends page outlined * sr initial * relocate calendar components * calendar fix flex * topnav fancier look * layout looking good edition * relocate xtrends * xtrends remove linecharts * x trends new * calender page new * delete headbanner, new login * remove calendar stuff from api * rename stuff in utils * fix user item margin * new home page initial * remove page concept * no pointer xtrends * remove xrank from app * xtrends service * move fa from app * move plus * maps tweaks * new table for plus history * navigational sidebar flex tweaks * builds page * analyzer * user page * free agents * plans * remove mx * tweaks * change layout to grid * home page finalized * mobile nav * restrict main content width * tweaks style * language switcher * container in css * sticky nav * use duplicate icons for now * change mapsketch width to old * chara tour vid * borzoic icons
65 lines
1.7 KiB
TypeScript
65 lines
1.7 KiB
TypeScript
import { Box, Flex } from "@chakra-ui/react";
|
|
import MyLink from "components/common/MyLink";
|
|
import { useActiveNavItem, useMyTheme } from "hooks/common";
|
|
import Image from "next/image";
|
|
import { useRouter } from "next/router";
|
|
import { navItems } from "utils/constants";
|
|
import UserItem from "./UserItem";
|
|
|
|
const Nav = () => {
|
|
const router = useRouter();
|
|
const navItem = useActiveNavItem();
|
|
const { bgColor, secondaryBgColor, themeColorHex } = useMyTheme();
|
|
|
|
if (router.pathname === "/") return null;
|
|
|
|
return (
|
|
<Box
|
|
as="nav"
|
|
flexShrink={0}
|
|
position="sticky"
|
|
alignSelf="flex-start"
|
|
display={["none", null, null, "block"]}
|
|
>
|
|
{navItems.map(({ code, name }) => {
|
|
const isActive =
|
|
code === "u" ? router.pathname === "/u" : navItem?.code === code;
|
|
return (
|
|
<Box
|
|
key={code}
|
|
borderLeft="4px solid"
|
|
borderColor={isActive ? themeColorHex : bgColor}
|
|
pl={2}
|
|
>
|
|
<MyLink href={"/" + code} isColored={false} noUnderline>
|
|
<Flex
|
|
width="100%"
|
|
rounded="lg"
|
|
p={2}
|
|
fontSize="sm"
|
|
fontWeight="bold"
|
|
align="center"
|
|
whiteSpace="nowrap"
|
|
_hover={{
|
|
bg: secondaryBgColor,
|
|
}}
|
|
>
|
|
<Image
|
|
src={`/layout/${code}.png`}
|
|
height={32}
|
|
width={32}
|
|
priority
|
|
/>
|
|
<Box ml={2}>{name}</Box>
|
|
</Flex>
|
|
</MyLink>
|
|
</Box>
|
|
);
|
|
})}
|
|
<UserItem />
|
|
</Box>
|
|
);
|
|
};
|
|
|
|
export default Nav;
|