events
This commit is contained in:
@@ -732,6 +732,9 @@ export type Events = {
|
||||
'verification:settings:hideBadges': {}
|
||||
'verification:settings:unHideBadges': {}
|
||||
|
||||
'bot:label:toggle': {state: 'add' | 'remove'}
|
||||
'bot:badge:click': {}
|
||||
|
||||
'live:create': {duration: number}
|
||||
'live:edit': {}
|
||||
'live:remove': {}
|
||||
|
||||
@@ -3,6 +3,7 @@ import {type ComAtprotoLabelDefs} from '@atproto/api'
|
||||
import {msg} from '@lingui/core/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
|
||||
import {useAnalytics} from '#/analytics'
|
||||
import {isBotAccount} from '#/lib/bots'
|
||||
import {atoms as a, useBreakpoints, useTheme} from '#/alf'
|
||||
import {BotAccountInfoDialog} from '#/components/BotAccountInfoDialog'
|
||||
@@ -40,6 +41,7 @@ export function BotBadgeButton({
|
||||
size: 'lg' | 'md' | 'sm'
|
||||
}) {
|
||||
const t = useTheme()
|
||||
const ax = useAnalytics()
|
||||
const {_} = useLingui()
|
||||
const {gtPhone} = useBreakpoints()
|
||||
const control = useDialogControl()
|
||||
@@ -62,6 +64,7 @@ export function BotBadgeButton({
|
||||
hitSlop={20}
|
||||
onPress={evt => {
|
||||
evt.preventDefault()
|
||||
ax.metric('bot:badge:click', {})
|
||||
control.open()
|
||||
}}>
|
||||
{({hovered}) => (
|
||||
|
||||
@@ -6,6 +6,7 @@ import {useLingui} from '@lingui/react'
|
||||
import {Trans} from '@lingui/react/macro'
|
||||
import {type NativeStackScreenProps} from '@react-navigation/native-stack'
|
||||
|
||||
import {useAnalytics} from '#/analytics'
|
||||
import {type CommonNavigatorParams} from '#/lib/routes/types'
|
||||
import {
|
||||
useProfileQuery,
|
||||
@@ -29,6 +30,7 @@ type Props = NativeStackScreenProps<
|
||||
>
|
||||
export function AutomationLabelSettingsScreen({}: Props) {
|
||||
const t = useTheme()
|
||||
const ax = useAnalytics()
|
||||
const {_} = useLingui()
|
||||
const {currentAccount} = useSession()
|
||||
const {data: profile} = useProfileQuery({did: currentAccount?.did})
|
||||
@@ -45,6 +47,7 @@ export function AutomationLabelSettingsScreen({}: Props) {
|
||||
return
|
||||
}
|
||||
let wasAdded = false
|
||||
ax.metric('bot:label:toggle', {state: isBotLabeled ? 'remove' : 'add'})
|
||||
updateProfile.mutate({
|
||||
profile,
|
||||
updates: existing => {
|
||||
|
||||
Reference in New Issue
Block a user