sendou.ink/app/components/layout/SideNav.tsx
Kalle 35168111a6
Art (#1412)
* 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
2023-07-09 11:48:28 +03:00

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>
);
}