This commit is contained in:
commit
8984aae42f
|
@ -7,6 +7,7 @@ import { CPMMBinaryContract } from 'common/contract'
|
|||
import { Customize, USAMap } from './usa-map'
|
||||
import { listenForContract } from 'web/lib/firebase/contracts'
|
||||
import { interpolateColor } from 'common/util/color'
|
||||
import { track } from 'web/lib/service/analytics'
|
||||
|
||||
export interface StateElectionMarket {
|
||||
creatorUsername: string
|
||||
|
@ -35,8 +36,13 @@ export function StateElectionMap(props: {
|
|||
market.state,
|
||||
{
|
||||
fill: probToColor(prob, market.isWinRepublican),
|
||||
clickHandler: () =>
|
||||
Router.push(`/${market.creatorUsername}/${market.slug}`),
|
||||
clickHandler: () => {
|
||||
Router.push(`/${market.creatorUsername}/${market.slug}`)
|
||||
track('state election map click', {
|
||||
state: market.state,
|
||||
slug: market.slug,
|
||||
})
|
||||
},
|
||||
},
|
||||
])
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ import { getUser, User } from 'web/lib/firebase/users'
|
|||
import { DateDocPost } from './[username]'
|
||||
import { NoSEO } from 'web/components/NoSEO'
|
||||
import { useDateDocs } from 'web/hooks/use-post'
|
||||
import { useTracking } from 'web/hooks/use-tracking'
|
||||
|
||||
export async function getStaticProps() {
|
||||
const dateDocs = await getDateDocs()
|
||||
|
@ -40,6 +41,7 @@ export default function DatePage(props: {
|
|||
|
||||
const dateDocs = useDateDocs() ?? props.dateDocs
|
||||
const hasDoc = dateDocs.some((d) => d.creatorId === user?.id)
|
||||
useTracking('view date docs page')
|
||||
|
||||
return (
|
||||
<Page>
|
||||
|
|
|
@ -8,6 +8,7 @@ import {
|
|||
StateElectionMarket,
|
||||
StateElectionMap,
|
||||
} from 'web/components/usa-map/state-election-map'
|
||||
import { useTracking } from 'web/hooks/use-tracking'
|
||||
import { getContractFromSlug } from 'web/lib/firebase/contracts'
|
||||
|
||||
const senateMidterms: StateElectionMarket[] = [
|
||||
|
@ -203,6 +204,8 @@ const App = (props: {
|
|||
}) => {
|
||||
const { senateContracts, governorContracts } = props
|
||||
|
||||
useTracking('view midterms 2022')
|
||||
|
||||
return (
|
||||
<Page className="">
|
||||
<Col className="items-center justify-center">
|
||||
|
|
Loading…
Reference in New Issue
Block a user