Created embed page for analytics

This commit is contained in:
James Grugett 2022-03-20 17:21:28 -05:00
parent 087a2a1f8f
commit ee6f91a52f
3 changed files with 35 additions and 8 deletions

View File

@ -86,7 +86,7 @@ export default function Analytics(props: {
) )
} }
function CustomAnalytics(props: { export function CustomAnalytics(props: {
startDate: number startDate: number
monthlyActiveUsers: number[] monthlyActiveUsers: number[]
dailyActiveUsers: number[] dailyActiveUsers: number[]
@ -104,27 +104,27 @@ function CustomAnalytics(props: {
} = props } = props
return ( return (
<Col> <Col>
<Title text="Monthly Active users" /> <Title text="Monthly Active Users" />
<DailyCountChart dailyCounts={monthlyActiveUsers} startDate={startDate} /> <DailyCountChart dailyCounts={monthlyActiveUsers} startDate={startDate} />
<Title text="Daily Active users" /> <Title text="Daily Active Users" />
<DailyCountChart dailyCounts={dailyActiveUsers} startDate={startDate} /> <DailyCountChart dailyCounts={dailyActiveUsers} startDate={startDate} />
<Title text="Bets count" /> <Title text="Trades" />
<DailyCountChart <DailyCountChart
dailyCounts={dailyBetCounts} dailyCounts={dailyBetCounts}
startDate={startDate} startDate={startDate}
small small
/> />
<Title text="Markets count" /> <Title text="Markets created" />
<DailyCountChart <DailyCountChart
dailyCounts={dailyContractCounts} dailyCounts={dailyContractCounts}
startDate={startDate} startDate={startDate}
small small
/> />
<Title text="Comments count" /> <Title text="Comments" />
<DailyCountChart <DailyCountChart
dailyCounts={dailyCommentCounts} dailyCounts={dailyCommentCounts}
startDate={startDate} startDate={startDate}
@ -134,7 +134,7 @@ function CustomAnalytics(props: {
) )
} }
function FirebaseAnalytics() { export function FirebaseAnalytics() {
// Edit dashboard at https://datastudio.google.com/u/0/reporting/faeaf3a4-c8da-4275-b157-98dad017d305/page/Gg3/edit // Edit dashboard at https://datastudio.google.com/u/0/reporting/faeaf3a4-c8da-4275-b157-98dad017d305/page/Gg3/edit
return ( return (
<iframe <iframe

View File

@ -80,7 +80,7 @@ function ContractEmbed(props: { contract: Contract; bets: Bet[] }) {
return ( return (
<Col className="w-full flex-1 bg-white py-2"> <Col className="w-full flex-1 bg-white py-2">
<div className="px-3 text-xl text-indigo-700"> <div className="px-3 text-xl md:text-2xl text-indigo-700">
<Linkify text={question} /> <Linkify text={question} />
</div> </div>

View File

@ -0,0 +1,27 @@
import { Col } from '../../components/layout/col'
import { Spacer } from '../../components/layout/spacer'
import { fromPropz } from '../../hooks/use-propz'
import {
CustomAnalytics,
FirebaseAnalytics,
getStaticPropz,
} from '../analytics'
export const getStaticProps = fromPropz(getStaticPropz)
export default function AnalyticsEmbed(props: {
startDate: number
dailyActiveUsers: number[]
dailyBetCounts: number[]
dailyContractCounts: number[]
dailyCommentCounts: number[]
monthlyActiveUsers: number[]
}) {
return (
<Col className="w-full px-2 bg-white">
<CustomAnalytics {...props} />
<Spacer h={8} />
<FirebaseAnalytics />
</Col>
)
}