Add gists page loading skeleton

This commit is contained in:
DefectingCat
2023-03-23 11:07:49 +08:00
parent bbfbd0487e
commit 0a28d00efa
2 changed files with 46 additions and 0 deletions

View File

@ -0,0 +1,33 @@
import clsx from 'clsx';
export default function FileContentLoading() {
return (
<div className={clsx('pb-4')}>
{/* Username */}
<h1
className={clsx(
'md:text-lg h-7 bg-gray-200',
'animate-pulse w-48 rounded-lg',
'dark:bg-rua-gray-700',
'mb-2'
)}
></h1>
{/* last active */}
<div
className={clsx(
'h-4 w-72 bg-gray-200',
'animate-pulse rounded-lg',
'dark:bg-rua-gray-700'
)}
></div>
{/* code block */}
<div
className={clsx(
'w-full h-[488px] rounded-lg',
'animate-pulse dark:bg-rua-gray-700',
'mt-3 bg-gray-200'
)}
></div>
</div>
);
}

13
app/gists/loading.tsx Normal file
View File

@ -0,0 +1,13 @@
import FileContentLoading from './file-content-skeleton';
export default function Loading() {
const num = Array(3).fill(null);
return (
<>
{num.map((_, i) => (
<FileContentLoading key={i} />
))}
</>
);
}