Skip to content

Commit

Permalink
Merge pull request #4847 from thematters/fix/disable-ssr
Browse files Browse the repository at this point in the history
fix(CampaignDetail): disable SSR at SideParticipants
  • Loading branch information
wlliaml authored Sep 4, 2024
2 parents 4b90abf + 5471dac commit 05b98d2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/views/CampaignDetail/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useQuery } from '@apollo/react-hooks'
import dynamic from 'next/dynamic'
import { useContext } from 'react'

import { toPath } from '~/common/utils'
Expand All @@ -17,7 +18,11 @@ import { CampaignDetailQuery } from '~/gql/graphql'
import ArticleFeeds from './ArticleFeeds'
import { CAMPAIGN_DETAIL } from './gql'
import InfoHeader from './InfoHeader'
import SideParticipants from './SideParticipants'

const DynamicSideParticipants = dynamic(() => import('./SideParticipants'), {
loading: () => <SpinnerBlock />,
ssr: false,
})

const CampaignDetail = () => {
const { lang } = useContext(LanguageContext)
Expand Down Expand Up @@ -58,7 +63,7 @@ const CampaignDetail = () => {
const path = toPath({ page: 'campaignDetail', campaign })

return (
<Layout.Main aside={<SideParticipants campaign={campaign} />}>
<Layout.Main aside={<DynamicSideParticipants campaign={campaign} />}>
<Head
title={
campaign[
Expand Down

0 comments on commit 05b98d2

Please sign in to comment.