log shares of starter packs
This commit is contained in:
@@ -10,6 +10,7 @@ import {useLingui} from '@lingui/react'
|
|||||||
import {nanoid} from 'nanoid/non-secure'
|
import {nanoid} from 'nanoid/non-secure'
|
||||||
|
|
||||||
import {saveImageToMediaLibrary} from 'lib/media/manip'
|
import {saveImageToMediaLibrary} from 'lib/media/manip'
|
||||||
|
import {logEvent} from 'lib/statsig/statsig'
|
||||||
import {isNative} from 'platform/detection'
|
import {isNative} from 'platform/detection'
|
||||||
import * as Toast from '#/view/com/util/Toast'
|
import * as Toast from '#/view/com/util/Toast'
|
||||||
import {atoms as a} from '#/alf'
|
import {atoms as a} from '#/alf'
|
||||||
@@ -84,6 +85,11 @@ export function QrCodeDialog({
|
|||||||
link.click()
|
link.click()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logEvent('starterPack:share', {
|
||||||
|
starterPack: starterPack.uri,
|
||||||
|
shareType: 'qrcode',
|
||||||
|
qrShareType: 'save',
|
||||||
|
})
|
||||||
Toast.show(_(msg`QR code saved to your camera roll!`))
|
Toast.show(_(msg`QR code saved to your camera roll!`))
|
||||||
control.close()
|
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!`))
|
Toast.show(_(msg`QR code copied to your clipboard!`))
|
||||||
control.close()
|
control.close()
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -150,6 +150,11 @@ export type LogEvents = {
|
|||||||
| 'ChatsList'
|
| 'ChatsList'
|
||||||
| 'SendViaChatDialog'
|
| 'SendViaChatDialog'
|
||||||
}
|
}
|
||||||
|
'starterPack:share': {
|
||||||
|
starterPack: string
|
||||||
|
shareType: 'link' | 'qrcode'
|
||||||
|
qrShareType?: 'save' | 'copy'
|
||||||
|
}
|
||||||
|
|
||||||
'test:all:always': {}
|
'test:all:always': {}
|
||||||
'test:all:sometimes': {}
|
'test:all:sometimes': {}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import {useQueryClient} from '@tanstack/react-query'
|
|||||||
import {makeProfileLink, makeStarterPackLink} from 'lib/routes/links'
|
import {makeProfileLink, makeStarterPackLink} from 'lib/routes/links'
|
||||||
import {CommonNavigatorParams, NavigationProp} from 'lib/routes/types'
|
import {CommonNavigatorParams, NavigationProp} from 'lib/routes/types'
|
||||||
import {shareUrl} from 'lib/sharing'
|
import {shareUrl} from 'lib/sharing'
|
||||||
|
import {logEvent} from 'lib/statsig/statsig'
|
||||||
import {isWeb} from 'platform/detection'
|
import {isWeb} from 'platform/detection'
|
||||||
import {useSetUsedStarterPack} from 'state/preferences/starter-pack'
|
import {useSetUsedStarterPack} from 'state/preferences/starter-pack'
|
||||||
import {RQKEY} from 'state/queries/list-members'
|
import {RQKEY} from 'state/queries/list-members'
|
||||||
@@ -235,6 +236,10 @@ function Header({
|
|||||||
label={_(msg`Share link`)}
|
label={_(msg`Share link`)}
|
||||||
testID="shareStarterPackLinkBtn"
|
testID="shareStarterPackLinkBtn"
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
|
logEvent('starterPack:share', {
|
||||||
|
starterPack: starterPack.uri,
|
||||||
|
shareType: 'link',
|
||||||
|
})
|
||||||
shareUrl(makeStarterPackLink(name, rkey))
|
shareUrl(makeStarterPackLink(name, rkey))
|
||||||
}}>
|
}}>
|
||||||
<Menu.ItemText>
|
<Menu.ItemText>
|
||||||
|
|||||||
Reference in New Issue
Block a user