diff --git a/app/components/layout/UserItem.tsx b/app/components/layout/UserItem.tsx index 210248308..973874360 100644 --- a/app/components/layout/UserItem.tsx +++ b/app/components/layout/UserItem.tsx @@ -5,8 +5,10 @@ import { userPage } from "~/utils/urls"; import { Avatar } from "../Avatar"; import { LogInIcon } from "../icons/LogIn"; import { LogInButtonContainer } from "./LogInButtonContainer"; +import { useRootLoaderData } from "~/hooks/useRootLoaderData"; export function UserItem() { + const data = useRootLoaderData(); const { t } = useTranslation(); const user = useUser(); @@ -25,6 +27,10 @@ export function UserItem() { ); } + if (data.loginDisabled) { + return false; + } + return ( - - {t("common:header.login")} - - )} - + {navItems.map((item) => ( + + {t("common:pages.myPage")} + + ); + } + + if (data.loginDisabled) return null; + + return ( +
+ + + + {t("common:header.login")} +
+ ); +} + function Drawings({ filters, }: {