Disable SSR on /home (#839)
This commit is contained in:
parent
21b9d0efab
commit
b1bb6fab5b
|
@ -4,23 +4,14 @@ import { PencilAltIcon } from '@heroicons/react/solid'
|
||||||
import { Page } from 'web/components/page'
|
import { Page } from 'web/components/page'
|
||||||
import { Col } from 'web/components/layout/col'
|
import { Col } from 'web/components/layout/col'
|
||||||
import { ContractSearch } from 'web/components/contract-search'
|
import { ContractSearch } from 'web/components/contract-search'
|
||||||
import { User } from 'common/user'
|
|
||||||
import { getUserAndPrivateUser } from 'web/lib/firebase/users'
|
|
||||||
import { useTracking } from 'web/hooks/use-tracking'
|
import { useTracking } from 'web/hooks/use-tracking'
|
||||||
|
import { useUser } from 'web/hooks/use-user'
|
||||||
import { track } from 'web/lib/service/analytics'
|
import { track } from 'web/lib/service/analytics'
|
||||||
import { authenticateOnServer } from 'web/lib/firebase/server-auth'
|
|
||||||
import { useSaveReferral } from 'web/hooks/use-save-referral'
|
import { useSaveReferral } from 'web/hooks/use-save-referral'
|
||||||
import { GetServerSideProps } from 'next'
|
|
||||||
import { usePrefetch } from 'web/hooks/use-prefetch'
|
import { usePrefetch } from 'web/hooks/use-prefetch'
|
||||||
|
|
||||||
export const getServerSideProps: GetServerSideProps = async (ctx) => {
|
const Home = () => {
|
||||||
const creds = await authenticateOnServer(ctx)
|
const user = useUser()
|
||||||
const auth = creds ? await getUserAndPrivateUser(creds.uid) : null
|
|
||||||
return { props: { auth } }
|
|
||||||
}
|
|
||||||
|
|
||||||
const Home = (props: { auth: { user: User } | null }) => {
|
|
||||||
const user = props.auth ? props.auth.user : null
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
useTracking('view home')
|
useTracking('view home')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user