Skip to content

Commit

Permalink
feat: Add loading animation to storage page
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeroWave022 committed Aug 25, 2024
1 parent a3a95c8 commit 3507f29
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/app/[locale]/(default)/storage/loading.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { SkeletonCard } from '@/components/storage/SkeletonCard';
import { Skeleton } from '@/components/ui/Skeleton';

export default function StorageSkeleton() {
return (
<>
<div className='my-4 flex flex-col justify-center gap-2 lg:flex-row'>
<Skeleton className='h-10 w-full' />
<Skeleton className='h-10 w-full lg:w-[250px]' />
<Skeleton className='h-10 w-full lg:w-[250px]' />
</div>
<div className='grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4'>
<SkeletonCard />
<SkeletonCard />
<SkeletonCard />
<SkeletonCard />
<SkeletonCard />
<SkeletonCard />
<SkeletonCard />
<SkeletonCard />
</div>
</>
);
}
17 changes: 17 additions & 0 deletions src/components/storage/SkeletonCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Skeleton } from '@/components/ui/Skeleton';

export function SkeletonCard() {
return (
<div className='flex h-[350px] flex-col gap-5'>
<div className='flex flex-col items-center justify-center gap-2'>
<Skeleton className='h-[192px] w-[192px] rounded-lg' />
<Skeleton className='h-[24px] w-[120px] rounded-full' />
<Skeleton className='h-[14px] w-[70px] rounded-full' />
</div>
<div className='flex items-center justify-center gap-2'>
<Skeleton className='h-[14px] w-[70px] rounded-full' />
<Skeleton className='h-8 w-[100px] rounded-lg' />
</div>
</div>
);
}

0 comments on commit 3507f29

Please sign in to comment.