mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-05-18 01:01:49 -05:00
* Add to nav * Allow nav items on front page to take full width * Initial+ * Fix vods page title * Add page title * Common art type * ArtGrid to a different component * User arts page initial * Add art tab to user page * Preview initial * Fix art counting * Fix link and onclick overlapping * Link to user art page to arts they made * Artist role initial * Show description * Make toggle in art page saved in search params * Add white-space pre-wrap to plus comments Not sure why it was removed in the first place? * Commission open / text and edit those * Add simple pagination * New art link display logic * New art initial * Upload art * Hide art from side nav too * Show banner when waiting for approval * Edit art * Fix art sub nav link not showing active * Relocate unvalidated art text * Delete art * Extract ImagePreview component * Eliminate some layout shift * BigImageDialog extract component + prevent layout shift * i18n * Fix unused var * Fix tests
41 lines
1.2 KiB
TypeScript
41 lines
1.2 KiB
TypeScript
import { Link } from "@remix-run/react";
|
|
import navItems from "~/components/layout/nav-items.json";
|
|
import { useTranslation } from "~/hooks/useTranslation";
|
|
import { navIconUrl } from "~/utils/urls";
|
|
import { Image } from "../Image";
|
|
import { temporaryCanAccessArtCheck } from "~/features/art";
|
|
import { useUser } from "~/modules/auth";
|
|
|
|
export function SideNav() {
|
|
const user = useUser();
|
|
const { t } = useTranslation(["common"]);
|
|
|
|
return (
|
|
<nav className="layout__side-nav layout__item_size">
|
|
{navItems
|
|
.filter(
|
|
(navItem) =>
|
|
temporaryCanAccessArtCheck(user) || navItem.name !== "art"
|
|
)
|
|
.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>
|
|
);
|
|
}
|