Switch /analytics to propz
This commit is contained in:
parent
0fcfee6d77
commit
95e24e9b87
|
@ -5,11 +5,13 @@ import { Col } from '../components/layout/col'
|
||||||
import { Spacer } from '../components/layout/spacer'
|
import { Spacer } from '../components/layout/spacer'
|
||||||
import { Page } from '../components/page'
|
import { Page } from '../components/page'
|
||||||
import { Title } from '../components/title'
|
import { Title } from '../components/title'
|
||||||
|
import { usePropz } from '../hooks/use-propz'
|
||||||
import { getDailyBets } from '../lib/firebase/bets'
|
import { getDailyBets } from '../lib/firebase/bets'
|
||||||
import { getDailyComments } from '../lib/firebase/comments'
|
import { getDailyComments } from '../lib/firebase/comments'
|
||||||
import { getDailyContracts } from '../lib/firebase/contracts'
|
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 numberOfDays = 80
|
||||||
const today = dayjs(dayjs().format('YYYY-MM-DD'))
|
const today = dayjs(dayjs().format('YYYY-MM-DD'))
|
||||||
const startDate = today.subtract(numberOfDays, 'day')
|
const startDate = today.subtract(numberOfDays, 'day')
|
||||||
|
@ -54,11 +56,18 @@ export default function Analytics(props: {
|
||||||
dailyContractCounts: number[]
|
dailyContractCounts: number[]
|
||||||
dailyCommentCounts: number[]
|
dailyCommentCounts: number[]
|
||||||
}) {
|
}) {
|
||||||
|
props = usePropz(getStaticPropz) ?? {
|
||||||
|
startDate: 0,
|
||||||
|
dailyActiveUsers: [],
|
||||||
|
dailyBetCounts: [],
|
||||||
|
dailyContractCounts: [],
|
||||||
|
dailyCommentCounts: [],
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<Page>
|
<Page>
|
||||||
<CustomAnalytics {...props} />
|
<CustomAnalytics {...props} />
|
||||||
<Spacer h={8} />
|
<Spacer h={8} />
|
||||||
<FirebaseAnalytics />
|
{!IS_PRIVATE_MANIFOLD && <FirebaseAnalytics />}
|
||||||
</Page>
|
</Page>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user