diff --git a/src/components/menu.tsx b/src/components/menu.tsx index 3549e9a..3805237 100644 --- a/src/components/menu.tsx +++ b/src/components/menu.tsx @@ -1,12 +1,12 @@ +import { useAppContext } from "@/providers/AuthProvider"; +import apiClient from "@/services/api"; import { cn } from "@/utils/class-merge"; import { CalendarDaysIcon, ListBulletIcon, UserIcon } from "@heroicons/react/24/solid"; import { FunctionComponent, h } from "preact"; import { useLocation } from "preact-iso"; +import { useEffect, useState } from "preact/hooks"; import { tv } from "tailwind-variants"; import classes from "./menu.module.scss"; -import { useEffect, useState } from "preact/hooks"; -import apiClient from "@/services/api"; -import { useAppContext } from "@/providers/AuthProvider"; interface UserProfile { username: string; @@ -72,7 +72,7 @@ const Avatar: FunctionComponent = () => { } }, [isLoggedIn.value]); - return ( + return username ? ( - ); + ) : null; }; interface MenuItems { diff --git a/src/pages/profile_calendar.tsx b/src/pages/profile_calendar.tsx index 41277e8..dc828eb 100644 --- a/src/pages/profile_calendar.tsx +++ b/src/pages/profile_calendar.tsx @@ -374,223 +374,215 @@ const ProfileCalendar: FunctionComponent = () => { month: { className: calendarStyles.month }, year: { className: calendarStyles.year }, }; + if (isLoading) + return ( +