log shares of starter packs

This commit is contained in:
Hailey
2024-06-16 01:02:42 -07:00
parent 07f485f566
commit 2ab3c039ab
3 changed files with 21 additions and 0 deletions
@@ -10,6 +10,7 @@ import {useLingui} from '@lingui/react'
import {nanoid} from 'nanoid/non-secure'
import {saveImageToMediaLibrary} from 'lib/media/manip'
import {logEvent} from 'lib/statsig/statsig'
import {isNative} from 'platform/detection'
import * as Toast from '#/view/com/util/Toast'
import {atoms as a} from '#/alf'
@@ -84,6 +85,11 @@ export function QrCodeDialog({
link.click()
}
logEvent('starterPack:share', {
starterPack: starterPack.uri,
shareType: 'qrcode',
qrShareType: 'save',
})
Toast.show(_(msg`QR code saved to your camera roll!`))
control.close()
})
@@ -103,6 +109,11 @@ export function QrCodeDialog({
})
}
logEvent('starterPack:share', {
starterPack: starterPack.uri,
shareType: 'qrcode',
qrShareType: 'copy',
})
Toast.show(_(msg`QR code copied to your clipboard!`))
control.close()
})
+5
View File
@@ -150,6 +150,11 @@ export type LogEvents = {
| 'ChatsList'
| 'SendViaChatDialog'
}
'starterPack:share': {
starterPack: string
shareType: 'link' | 'qrcode'
qrShareType?: 'save' | 'copy'
}
'test:all:always': {}
'test:all:sometimes': {}
@@ -10,6 +10,7 @@ import {useQueryClient} from '@tanstack/react-query'
import {makeProfileLink, makeStarterPackLink} from 'lib/routes/links'
import {CommonNavigatorParams, NavigationProp} from 'lib/routes/types'
import {shareUrl} from 'lib/sharing'
import {logEvent} from 'lib/statsig/statsig'
import {isWeb} from 'platform/detection'
import {useSetUsedStarterPack} from 'state/preferences/starter-pack'
import {RQKEY} from 'state/queries/list-members'
@@ -235,6 +236,10 @@ function Header({
label={_(msg`Share link`)}
testID="shareStarterPackLinkBtn"
onPress={() => {
logEvent('starterPack:share', {
starterPack: starterPack.uri,
shareType: 'link',
})
shareUrl(makeStarterPackLink(name, rkey))
}}>
<Menu.ItemText>