This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

feat: dashboard skeleton

+74 -1
+2 -1
src/webapp/components/navigation/dashboard/Dashboard.tsx
··· 2 2 3 3 import AppLayout from '../appLayout/AppLayout'; 4 4 import GuestAppLayout from '../guestAppLayout/GuestAppLayout'; 5 + import DashboardSkeleton from './Skeleton.Dashboard'; 5 6 import { useAuth } from '@/hooks/useAuth'; 6 7 7 8 interface Props { ··· 11 12 export default function Dashboard(props: Props) { 12 13 const { isAuthenticated, isLoading } = useAuth(); 13 14 14 - if (isLoading) return null; 15 + if (isLoading) return <DashboardSkeleton />; 15 16 16 17 if (!isAuthenticated) 17 18 return <GuestAppLayout>{props.children}</GuestAppLayout>;
+23
src/webapp/components/navigation/dashboard/Skeleton.Dashboard.module.css
··· 1 + .fade { 2 + animation: fade 2s ease-in-out infinite; 3 + } 4 + 5 + @keyframes fade { 6 + 0%, 7 + 100% { 8 + opacity: 0.4; 9 + } 10 + 50% { 11 + opacity: 1; 12 + } 13 + } 14 + 15 + @keyframes sway { 16 + 0%, 17 + 100% { 18 + transform: rotate(-6deg); 19 + } 20 + 50% { 21 + transform: rotate(6deg); 22 + } 23 + }
+49
src/webapp/components/navigation/dashboard/Skeleton.Dashboard.tsx
··· 1 + 'use client'; 2 + 3 + import { AppShell, Center, Stack, Text } from '@mantine/core'; 4 + import { useNavbarContext } from '@/providers/navbar'; 5 + import { useMediaQuery } from '@mantine/hooks'; 6 + import NavbarSkeleton from '../navbar/Skeleton.Navbar'; 7 + import BottomBarSkeleton from '../bottomBar/Skeleton.BottomBar'; 8 + import classes from './Skeleton.Dashboard.module.css'; 9 + import Header from '../header/Header'; 10 + 11 + export default function DashboardSkeleton() { 12 + const { mobileOpened, desktopOpened } = useNavbarContext(); 13 + const isMobile = useMediaQuery('(max-width: 48em)', true); // "sm" breakpoint 14 + 15 + return ( 16 + <AppShell 17 + header={{ height: 0 }} 18 + navbar={{ 19 + width: 300, 20 + breakpoint: 'xs', 21 + collapsed: { mobile: !mobileOpened, desktop: !desktopOpened }, 22 + }} 23 + aside={{ 24 + width: 0, 25 + breakpoint: 'xl', 26 + collapsed: { mobile: true }, 27 + }} 28 + > 29 + <NavbarSkeleton /> 30 + 31 + <AppShell.Main> 32 + <Header /> 33 + 34 + <Center mih="100dvh"> 35 + <Stack align="center" gap="xs"> 36 + <Text size="lg" c="gray.6" className={classes.fade}> 37 + ⋆ ˚ ✿ ˚ ⋆ 38 + </Text> 39 + <Text fw={700} size="sm" c="dimmed" className={classes.fade}> 40 + loading 41 + </Text> 42 + </Stack> 43 + </Center> 44 + </AppShell.Main> 45 + 46 + <BottomBarSkeleton /> 47 + </AppShell> 48 + ); 49 + }