Connect, collaborate, and grow with a community of TypeScript developers
chore: update loading skeletons on profile pages (#1213)
__aadamw53bc57f815a6
diff --git a/apps/web/src/app/[locale]/(profile)/[username]/_components/profile-skeleton.tsx b/apps/web/src/app/[locale]/(profile)/[username]/_components/profile-skeleton.tsxindex e86706db..b07334a6 100644--- a/apps/web/src/app/[locale]/(profile)/[username]/_components/profile-skeleton.tsx+++ b/apps/web/src/app/[locale]/(profile)/[username]/_components/profile-skeleton.tsx@@ -1,40 +1,30 @@import { Skeleton } from '@repo/ui/components/skeleton';-export function ProfileSkeleton() {+export function PageContentSkeleton() {return (- <div className="container flex h-full flex-col gap-8 py-8 md:flex-row">- <div className="flex flex-col gap-4 md:flex-row">- <div className="flex flex-col items-center gap-4 md:items-start">- <Skeleton className="h-32 w-32 rounded-3xl bg-cover md:h-64 md:w-64" />- <Skeleton className="mt-4 h-10 w-60 rounded-lg bg-zinc-300 dark:bg-zinc-700 dark:text-white" />- <div className="mt-4 flex gap-4 md:w-full md:flex-col">- {Array.from({ length: 3 }, (_, idx) => (- <TabsTriggerSkeleton key={idx} />- ))}- </div>- </div>+ <div className="relative flex w-full shrink grow flex-col gap-8">+ <div className=" flex h-1/2 shrink grow flex-col items-center justify-center space-y-4 rounded-3xl border border-zinc-700 py-10 md:h-2/5 md:w-4/5">+ <Skeleton className="max-w-80 h-4 w-5/6 rounded-2xl bg-zinc-300 text-neutral-900 dark:bg-zinc-700 dark:text-white" />+ <Skeleton className="h-4 w-60 rounded-2xl bg-zinc-300 text-neutral-900 dark:bg-zinc-700 dark:text-white" />+ <Skeleton className="h-4 w-20 rounded-2xl bg-zinc-300 text-neutral-900 dark:bg-zinc-700 dark:text-white" /></div>- <div className="relative flex shrink grow flex-col gap-8 md:w-2/3">- <div className=" flex h-1/2 shrink grow flex-col items-center justify-center space-y-4 rounded-3xl border border-zinc-700 py-10 md:h-2/5 md:w-4/5">- <Skeleton className="max-w-80 h-4 w-5/6 rounded-2xl bg-zinc-300 text-neutral-900 dark:bg-zinc-700 dark:text-white" />- <Skeleton className="h-4 w-60 rounded-2xl bg-zinc-300 text-neutral-900 dark:bg-zinc-700 dark:text-white" />- <Skeleton className="h-4 w-20 rounded-2xl bg-zinc-300 text-neutral-900 dark:bg-zinc-700 dark:text-white" />- </div>- <div className="relative flex shrink grow flex-col items-center justify-center space-y-4 rounded-3xl border border-zinc-700 py-20 md:h-3/5">- <Skeleton className="max-w-80 h-4 w-5/6 rounded-2xl bg-zinc-300 text-neutral-900 dark:bg-zinc-700 dark:text-white" />- <Skeleton className="h-4 w-60 rounded-2xl bg-zinc-300 text-neutral-900 dark:bg-zinc-700 dark:text-white" />- <Skeleton className="h-4 w-20 rounded-2xl bg-zinc-300 text-neutral-900 dark:bg-zinc-700 dark:text-white" />- </div>+ <div className="relative flex shrink grow flex-col items-center justify-center space-y-4 rounded-3xl border border-zinc-700 py-20 md:h-3/5">+ <Skeleton className="max-w-80 h-4 w-5/6 rounded-2xl bg-zinc-300 text-neutral-900 dark:bg-zinc-700 dark:text-white" />+ <Skeleton className="h-4 w-60 rounded-2xl bg-zinc-300 text-neutral-900 dark:bg-zinc-700 dark:text-white" />+ <Skeleton className="h-4 w-20 rounded-2xl bg-zinc-300 text-neutral-900 dark:bg-zinc-700 dark:text-white" /></div></div>);}-export function TabsTriggerSkeleton() {+export function TableSkeleton() {return (- <div className="flex h-6 flex-row items-center gap-2 rounded-xl border border-zinc-700 px-2 py-4 md:w-64">- <Skeleton className="h-4 w-4 rounded-md border border-zinc-300 bg-zinc-300 dark:bg-zinc-700" />- <Skeleton className="h-4 w-20 rounded-2xl bg-zinc-300 text-neutral-900 dark:bg-zinc-700 dark:text-white" />+ <div className="relative flex h-[300px] w-full shrink grow flex-col gap-8 md:h-[600px]">+ <div className="relative flex shrink grow flex-col items-center justify-center space-y-4 rounded-3xl border border-zinc-700 py-20 md:h-3/5">+ <Skeleton className="max-w-80 h-4 w-5/6 rounded-2xl bg-zinc-300 text-neutral-900 dark:bg-zinc-700 dark:text-white" />+ <Skeleton className="h-4 w-60 rounded-2xl bg-zinc-300 text-neutral-900 dark:bg-zinc-700 dark:text-white" />+ <Skeleton className="h-4 w-20 rounded-2xl bg-zinc-300 text-neutral-900 dark:bg-zinc-700 dark:text-white" />+ </div></div>);}diff --git a/apps/web/src/app/[locale]/(profile)/[username]/bookmarks/loading.tsx b/apps/web/src/app/[locale]/(profile)/[username]/bookmarks/loading.tsxnew file mode 100644index 00000000..b63146bf--- /dev/null+++ b/apps/web/src/app/[locale]/(profile)/[username]/bookmarks/loading.tsx@@ -0,0 +1 @@+export { TableSkeleton as default } from '../_components/profile-skeleton';diff --git a/apps/web/src/app/[locale]/(profile)/[username]/completed/loading.tsx b/apps/web/src/app/[locale]/(profile)/[username]/completed/loading.tsxnew file mode 100644index 00000000..b63146bf--- /dev/null+++ b/apps/web/src/app/[locale]/(profile)/[username]/completed/loading.tsx@@ -0,0 +1 @@+export { TableSkeleton as default } from '../_components/profile-skeleton';diff --git a/apps/web/src/app/[locale]/(profile)/[username]/in-progress/loading.tsx b/apps/web/src/app/[locale]/(profile)/[username]/in-progress/loading.tsxnew file mode 100644index 00000000..b63146bf--- /dev/null+++ b/apps/web/src/app/[locale]/(profile)/[username]/in-progress/loading.tsx@@ -0,0 +1 @@+export { TableSkeleton as default } from '../_components/profile-skeleton';diff --git a/apps/web/src/app/[locale]/(profile)/[username]/loading.tsx b/apps/web/src/app/[locale]/(profile)/[username]/loading.tsxindex b2f2057d..156b3eef 100644--- a/apps/web/src/app/[locale]/(profile)/[username]/loading.tsx+++ b/apps/web/src/app/[locale]/(profile)/[username]/loading.tsx@@ -1 +1 @@-export { ProfileSkeleton as default } from './_components/profile-skeleton';+export { PageContentSkeleton as default } from './_components/profile-skeleton';diff --git a/apps/web/src/app/[locale]/(profile)/[username]/shared-solutions/loading.tsx b/apps/web/src/app/[locale]/(profile)/[username]/shared-solutions/loading.tsxnew file mode 100644index 00000000..b63146bf--- /dev/null+++ b/apps/web/src/app/[locale]/(profile)/[username]/shared-solutions/loading.tsx@@ -0,0 +1 @@+export { TableSkeleton as default } from '../_components/profile-skeleton';diff --git a/apps/web/src/app/[locale]/settings/_components/settings-skeleton.tsx b/apps/web/src/app/[locale]/settings/_components/settings-skeleton.tsxindex 7e9b4122..87ddbcfe 100644--- a/apps/web/src/app/[locale]/settings/_components/settings-skeleton.tsx+++ b/apps/web/src/app/[locale]/settings/_components/settings-skeleton.tsx@@ -27,7 +27,7 @@ export function TabsTriggerSkeleton() {return (<div className="flex h-6 flex-row items-center gap-2 rounded-xl border border-zinc-700 px-2 py-4 md:w-64"><Skeleton className="h-4 w-4 rounded-md border border-zinc-300 bg-zinc-300 dark:bg-zinc-700" />- <Skeleton className="h-4 w-20 rounded-2xl bg-zinc-300 text-neutral-900 dark:bg-zinc-700 dark:text-white" />+ <Skeleton className="hidden h-4 w-16 rounded-2xl bg-zinc-300 text-neutral-900 dark:bg-zinc-700 dark:text-white md:block" /></div>);}