Splitted sidebar skeletons

This commit is contained in:
Linus Flood
2024-12-17 07:45:55 +01:00
parent daa677d605
commit c45ef9d4a7
7 changed files with 81 additions and 18 deletions
+9 -1
View File
@@ -1,7 +1,11 @@
import { Suspense } from "react"
import { getName } from "@/lib/trpc/memoizedRequests"
import MyPagesSidebar from "@/components/MyPages/Sidebar"
import SidebarNavigationSkeleton from "../MyPages/Sidebar/SidebarNavigationSkeleton"
export default async function MyPagesNavigation() {
const user = await getName()
@@ -9,5 +13,9 @@ export default async function MyPagesNavigation() {
if (!user) {
return null
}
return <MyPagesSidebar />
return (
<Suspense fallback={<SidebarNavigationSkeleton />}>
<MyPagesSidebar />
</Suspense>
)
}
+11
View File
@@ -0,0 +1,11 @@
import SkeletonShimmer from "../SkeletonShimmer"
import styles from "./sidebar.module.css"
export default function SidebarSkeleton() {
return (
<aside className={styles.aside}>
<SkeletonShimmer width="100%" height="500px" />
</aside>
)
}