feat/sidebar-skeleton: added sidebar skeleton
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import { Suspense } from "react"
|
import { Suspense } from "react"
|
||||||
|
|
||||||
import LoadingSpinner from "@/components/LoadingSpinner"
|
|
||||||
import Sidebar from "@/components/MyPages/Sidebar"
|
import Sidebar from "@/components/MyPages/Sidebar"
|
||||||
|
import SidebarSkeleton from "@/components/MyPages/Sidebar/SidebarSkeleton"
|
||||||
import Surprises from "@/components/MyPages/Surprises"
|
import Surprises from "@/components/MyPages/Surprises"
|
||||||
|
|
||||||
import styles from "./layout.module.css"
|
import styles from "./layout.module.css"
|
||||||
@@ -17,7 +17,7 @@ export default async function MyPagesLayout({
|
|||||||
<section className={styles.layout}>
|
<section className={styles.layout}>
|
||||||
{breadcrumbs}
|
{breadcrumbs}
|
||||||
<section className={styles.content}>
|
<section className={styles.content}>
|
||||||
<Suspense fallback={<LoadingSpinner />}>
|
<Suspense fallback={<SidebarSkeleton />}>
|
||||||
<Sidebar />
|
<Sidebar />
|
||||||
</Suspense>
|
</Suspense>
|
||||||
{children}
|
{children}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { serverClient } from "@/lib/trpc/server"
|
|||||||
import Blocks from "@/components/Blocks"
|
import Blocks from "@/components/Blocks"
|
||||||
import Hero from "@/components/Hero"
|
import Hero from "@/components/Hero"
|
||||||
import MaxWidth from "@/components/MaxWidth"
|
import MaxWidth from "@/components/MaxWidth"
|
||||||
|
import SidebarSkeleton from "@/components/MyPages/Sidebar/SidebarSkeleton"
|
||||||
import Sidebar from "@/components/Sidebar"
|
import Sidebar from "@/components/Sidebar"
|
||||||
import Preamble from "@/components/TempDesignSystem/Text/Preamble"
|
import Preamble from "@/components/TempDesignSystem/Text/Preamble"
|
||||||
import Title from "@/components/TempDesignSystem/Text/Title"
|
import Title from "@/components/TempDesignSystem/Text/Title"
|
||||||
@@ -25,7 +26,9 @@ export default async function LoyaltyPage() {
|
|||||||
<>
|
<>
|
||||||
<section className={styles.content}>
|
<section className={styles.content}>
|
||||||
{loyaltyPage.sidebar?.length ? (
|
{loyaltyPage.sidebar?.length ? (
|
||||||
<Sidebar blocks={loyaltyPage.sidebar} />
|
<Suspense fallback={<SidebarSkeleton />}>
|
||||||
|
<Sidebar blocks={loyaltyPage.sidebar} />
|
||||||
|
</Suspense>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
<MaxWidth className={styles.blocks}>
|
<MaxWidth className={styles.blocks}>
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { Suspense } from "react"
|
|||||||
|
|
||||||
import Blocks from "@/components/Blocks"
|
import Blocks from "@/components/Blocks"
|
||||||
import Hero from "@/components/Hero"
|
import Hero from "@/components/Hero"
|
||||||
|
import SidebarSkeleton from "@/components/MyPages/Sidebar/SidebarSkeleton"
|
||||||
import Sidebar from "@/components/Sidebar"
|
import Sidebar from "@/components/Sidebar"
|
||||||
import LinkChips from "@/components/TempDesignSystem/LinkChips"
|
import LinkChips from "@/components/TempDesignSystem/LinkChips"
|
||||||
import Preamble from "@/components/TempDesignSystem/Text/Preamble"
|
import Preamble from "@/components/TempDesignSystem/Text/Preamble"
|
||||||
@@ -56,7 +57,9 @@ export default function StaticPage({
|
|||||||
</main>
|
</main>
|
||||||
|
|
||||||
{"sidebar" in content && content.sidebar?.length ? (
|
{"sidebar" in content && content.sidebar?.length ? (
|
||||||
<Sidebar blocks={content.sidebar} />
|
<Suspense fallback={<SidebarSkeleton />}>
|
||||||
|
<Sidebar blocks={content.sidebar} />
|
||||||
|
</Suspense>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
13
components/MyPages/Sidebar/SidebarSkeleton.tsx
Normal file
13
components/MyPages/Sidebar/SidebarSkeleton.tsx
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import SkeletonShimmer from "@/components/SkeletonShimmer"
|
||||||
|
|
||||||
|
import styles from "./sidebar.module.css"
|
||||||
|
|
||||||
|
export default function SidebarSkeleton() {
|
||||||
|
return (
|
||||||
|
<aside className={styles.sidebar}>
|
||||||
|
<nav className={styles.nav}>
|
||||||
|
<SkeletonShimmer width={"100%"} height="500px" />
|
||||||
|
</nav>
|
||||||
|
</aside>
|
||||||
|
)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user