Skip to content

Commit

Permalink
fix: suspense
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <tukon479@gmail.com>
  • Loading branch information
Innei committed Jun 10, 2023
1 parent 31901df commit 7142d2f
Showing 1 changed file with 28 additions and 14 deletions.
42 changes: 28 additions & 14 deletions src/components/layouts/SiteLayout/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { FC } from 'react'
import React, {
memo,
Suspense,
useCallback,
useEffect,
useId,
Expand Down Expand Up @@ -133,7 +134,9 @@ export const SiteLayout: FC = memo(({ children }) => {
<div className="bg absolute inset-0 transform-gpu" />
</div>

<Header />
<Suspense fallback={null}>
<Header />
</Suspense>

<div className="app-content">{children}</div>

Expand All @@ -152,19 +155,30 @@ export const SiteLayout: FC = memo(({ children }) => {
}
/>

<Footer />
<MusicMiniPlayerStoreControlled />

{!isNarrowThanLaptop && <LampSwitch onClick={handleChangeColorMode} />}

<ColorModeNoticePanel
{...tip}
onExited={() => setNotice(false)}
in={showNotice}
key="panel"
/>

<SearchHotKey />
<Suspense fallback={null}>
<Footer />
</Suspense>

<Suspense fallback={null}>
<MusicMiniPlayerStoreControlled />
</Suspense>

<Suspense fallback={null}>
{!isNarrowThanLaptop && <LampSwitch onClick={handleChangeColorMode} />}
</Suspense>

<Suspense fallback={null}>
<ColorModeNoticePanel
{...tip}
onExited={() => setNotice(false)}
in={showNotice}
key="panel"
/>
</Suspense>

<Suspense fallback={null}>
<SearchHotKey />
</Suspense>
</ModalStackProvider>
)
})

1 comment on commit 7142d2f

@vercel
Copy link

@vercel vercel bot commented on 7142d2f Jun 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

kami – ./

kami-innei-dev.vercel.app
kami-psi.vercel.app
kami-git-master-innei-dev.vercel.app
dev.innei.ren

Please sign in to comment.