sendou.ink/app/components/layout/SideNav.tsx
Kalle 323a1ea5e3 Remove useTranslation wrapper Closes #1595
This broke after upgrading deps and couldn't figure it out with a quick look.

It just makes it a bit more convenient when adding new pages & debugging
but not really that necessary so decided to delete it for now.
2023-12-07 20:33:59 +02:00

33 lines
901 B
TypeScript

import { Link } from "@remix-run/react";
import navItems from "~/components/layout/nav-items.json";
import { useTranslation } from "react-i18next";
import { navIconUrl } from "~/utils/urls";
import { Image } from "../Image";
export function SideNav() {
const { t } = useTranslation(["common"]);
return (
<nav className="layout__side-nav layout__item_size">
{navItems.map((item) => {
return (
<Link
to={`/${item.url}`}
key={item.name}
prefetch={item.prefetch ? "render" : undefined}
>
<div className="layout__side-nav-image-container">
<Image
path={navIconUrl(item.name)}
height={32}
width={32}
alt={t(`common:pages.${item.name}` as any)}
/>
</div>
</Link>
);
})}
</nav>
);
}