challenge bet tracking
This commit is contained in:
parent
f11c9a3341
commit
5e89628593
|
@ -19,6 +19,7 @@ import { QRCode } from '../qr-code'
|
||||||
import { copyToClipboard } from 'web/lib/util/copy'
|
import { copyToClipboard } from 'web/lib/util/copy'
|
||||||
import { AmountInput } from '../amount-input'
|
import { AmountInput } from '../amount-input'
|
||||||
import { getProbability } from 'common/calculate'
|
import { getProbability } from 'common/calculate'
|
||||||
|
import { track } from 'web/lib/service/analytics'
|
||||||
|
|
||||||
type challengeInfo = {
|
type challengeInfo = {
|
||||||
amount: number
|
amount: number
|
||||||
|
@ -55,7 +56,14 @@ export function CreateChallengeModal(props: {
|
||||||
outcome: newChallenge.outcome,
|
outcome: newChallenge.outcome,
|
||||||
contract: contract,
|
contract: contract,
|
||||||
})
|
})
|
||||||
challenge && setChallengeSlug(getChallengeUrl(challenge))
|
if (challenge) {
|
||||||
|
setChallengeSlug(getChallengeUrl(challenge))
|
||||||
|
track('challenge created', {
|
||||||
|
creator: user.username,
|
||||||
|
amount: newChallenge.amount,
|
||||||
|
contractId: contract.id,
|
||||||
|
})
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
challengeSlug={challengeSlug}
|
challengeSlug={challengeSlug}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -9,6 +9,7 @@ import { CreateChallengeModal } from '../challenges/create-challenge-modal'
|
||||||
import { User } from 'common/user'
|
import { User } from 'common/user'
|
||||||
import { CHALLENGES_ENABLED } from 'common/challenge'
|
import { CHALLENGES_ENABLED } from 'common/challenge'
|
||||||
import { ShareModal } from './share-modal'
|
import { ShareModal } from './share-modal'
|
||||||
|
import { withTracking } from 'web/lib/service/analytics'
|
||||||
|
|
||||||
export function ShareRow(props: {
|
export function ShareRow(props: {
|
||||||
contract: Contract
|
contract: Contract
|
||||||
|
@ -47,7 +48,10 @@ export function ShareRow(props: {
|
||||||
<Button
|
<Button
|
||||||
size="lg"
|
size="lg"
|
||||||
color="gray-white"
|
color="gray-white"
|
||||||
onClick={() => setIsOpen(true)}
|
onClick={withTracking(
|
||||||
|
() => setIsOpen(true),
|
||||||
|
'click challenge button'
|
||||||
|
)}
|
||||||
className="animate-bounce"
|
className="animate-bounce"
|
||||||
>
|
>
|
||||||
⚔️ Challenge
|
⚔️ Challenge
|
||||||
|
|
Loading…
Reference in New Issue
Block a user