diff --git a/web/pages/analytics.tsx b/web/pages/analytics.tsx index 268c0d51..cbd7b725 100644 --- a/web/pages/analytics.tsx +++ b/web/pages/analytics.tsx @@ -5,11 +5,13 @@ import { Col } from '../components/layout/col' import { Spacer } from '../components/layout/spacer' import { Page } from '../components/page' import { Title } from '../components/title' +import { usePropz } from '../hooks/use-propz' import { getDailyBets } from '../lib/firebase/bets' import { getDailyComments } from '../lib/firebase/comments' import { getDailyContracts } from '../lib/firebase/contracts' +import { IS_PRIVATE_MANIFOLD } from '../lib/firebase/init' -export async function getStaticProps() { +export async function getStaticPropz() { const numberOfDays = 80 const today = dayjs(dayjs().format('YYYY-MM-DD')) const startDate = today.subtract(numberOfDays, 'day') @@ -54,11 +56,18 @@ export default function Analytics(props: { dailyContractCounts: number[] dailyCommentCounts: number[] }) { + props = usePropz(getStaticPropz) ?? { + startDate: 0, + dailyActiveUsers: [], + dailyBetCounts: [], + dailyContractCounts: [], + dailyCommentCounts: [], + } return ( - + {!IS_PRIVATE_MANIFOLD && } ) }