[🐴] Add new chat metrics (#4130)
* remove a comment * add types for event, add log to profile button * add `chat:open` * add to chat list items * fix types * oops * oops 2.0
This commit is contained in:
parent
22522090c2
commit
516eb69637
6 changed files with 44 additions and 17 deletions
|
@ -46,7 +46,6 @@ export function MessageInput({
|
|||
const {height: keyboardHeight} = useReanimatedKeyboardAnimation()
|
||||
const maxHeight = useSharedValue<undefined | number>(undefined)
|
||||
const isInputScrollable = useSharedValue(false)
|
||||
// const [isInputScrollable, setIsInputScrollable] = React.useState(false)
|
||||
|
||||
const inputStyles = useSharedInputStyles()
|
||||
const [isFocused, setIsFocused] = React.useState(false)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import React, {useCallback, useState} from 'react'
|
||||
import {View} from 'react-native'
|
||||
import {GestureResponderEvent, View} from 'react-native'
|
||||
import {
|
||||
AppBskyActorDefs,
|
||||
ChatBskyConvoDefs,
|
||||
|
@ -13,6 +13,7 @@ import {isNative} from '#/platform/detection'
|
|||
import {useProfileShadow} from '#/state/cache/profile-shadow'
|
||||
import {useModerationOpts} from '#/state/preferences/moderation-opts'
|
||||
import {useSession} from '#/state/session'
|
||||
import {logEvent} from 'lib/statsig/statsig'
|
||||
import {sanitizeDisplayName} from 'lib/strings/display-names'
|
||||
import {TimeElapsed} from '#/view/com/util/TimeElapsed'
|
||||
import {UserAvatar} from '#/view/com/util/UserAvatar'
|
||||
|
@ -120,6 +121,18 @@ function ChatListItemReady({
|
|||
setShowActions(true)
|
||||
}, [])
|
||||
|
||||
const onPress = useCallback(
|
||||
(e: GestureResponderEvent) => {
|
||||
if (isDeletedAccount) {
|
||||
e.preventDefault()
|
||||
return false
|
||||
} else {
|
||||
logEvent('chat:open', {logContext: 'ChatsList'})
|
||||
}
|
||||
},
|
||||
[isDeletedAccount],
|
||||
)
|
||||
|
||||
const onLongPress = useCallback(() => {
|
||||
menuControl.open()
|
||||
}, [menuControl])
|
||||
|
@ -148,21 +161,14 @@ function ChatListItemReady({
|
|||
]
|
||||
: undefined
|
||||
}
|
||||
onPress={onPress}
|
||||
onLongPress={isNative ? menuControl.open : undefined}
|
||||
onAccessibilityAction={onLongPress}
|
||||
onPress={
|
||||
isDeletedAccount
|
||||
? e => {
|
||||
e.preventDefault()
|
||||
return false
|
||||
}
|
||||
: undefined
|
||||
}
|
||||
style={[
|
||||
web({
|
||||
cursor: isDeletedAccount ? 'default' : 'pointer',
|
||||
}),
|
||||
]}
|
||||
onLongPress={isNative ? menuControl.open : undefined}>
|
||||
]}>
|
||||
{({hovered, pressed, focused}) => (
|
||||
<View
|
||||
style={[
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue