Skip to content

Commit

Permalink
add suspense to coingecko info
Browse files Browse the repository at this point in the history
  • Loading branch information
saml33 committed Dec 18, 2023
1 parent 8f3da63 commit 97161c8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 28,386 deletions.
17 changes: 12 additions & 5 deletions app/(pages)/token/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import Links from '../../../components/explore/token-page/Links'
import TokenInfo from '../../../components/explore/token-page/TokenInfo'
import dynamic from 'next/dynamic'
import DataDisclaimer from '../../../components/explore/DataDisclaimer'
import { Suspense } from 'react'
const TokenPriceChart = dynamic(
() => import('../../../components/explore/token-page/TokenPriceChart'),
{ ssr: false },
Expand Down Expand Up @@ -61,6 +62,10 @@ export async function generateMetadata(
}
}

function Fallback() {
return <></>
}

async function TokenPage({ params }: TokenPageProps) {
const tokenPageData = await fetchTokenPage({
slug: params.slug,
Expand Down Expand Up @@ -133,11 +138,13 @@ async function TokenPage({ params }: TokenPageProps) {
<TokenPriceChart latestChartData={latestChartData} mint={mint} />
</div>
<div className="col-span-12 lg:col-span-4 bg-th-bkg-2 p-6 rounded-xl lg:rounded-none">
<TokenInfo
coingeckoData={coingeckoData}
tokenPageData={tokenPageData}
birdeyeData={birdeyeData}
/>
<Suspense fallback={<Fallback />}>
<TokenInfo
coingeckoData={coingeckoData}
tokenPageData={tokenPageData}
birdeyeData={birdeyeData}
/>
</Suspense>
</div>
</div>
<div className="mt-6">
Expand Down
Loading

1 comment on commit 97161c8

@vercel
Copy link

@vercel vercel bot commented on 97161c8 Dec 18, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.