Open convo menu when tapping on chat with deleted account (#4470)

* Open menu on click

* Remove useless util

* Improve label

* s/press/click

* Tweak message

---------

Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
zio/stable
Eric Bailey 2024-06-10 20:36:42 -05:00 committed by GitHub
parent c73ad43a80
commit 212f5750e3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 11 deletions

View File

@ -179,12 +179,13 @@ function ChatListItemReady({
(e: GestureResponderEvent) => {
if (isDeletedAccount) {
e.preventDefault()
menuControl.open()
return false
} else {
logEvent('chat:open', {logContext: 'ChatsList'})
}
},
[isDeletedAccount],
[isDeletedAccount, menuControl],
)
const onLongPress = useCallback(() => {
@ -206,7 +207,9 @@ function ChatListItemReady({
accessibilityHint={
!isDeletedAccount
? _(msg`Go to conversation with ${profile.handle}`)
: undefined
: _(
msg`This conversation is with a deleted or a deactivated account. Press for options.`,
)
}
accessibilityActions={
isNative
@ -218,12 +221,7 @@ function ChatListItemReady({
}
onPress={onPress}
onLongPress={isNative ? onLongPress : undefined}
onAccessibilityAction={onLongPress}
style={[
web({
cursor: isDeletedAccount ? 'default' : 'pointer',
}),
]}>
onAccessibilityAction={onLongPress}>
{({hovered, pressed, focused}) => (
<View
style={[
@ -233,9 +231,7 @@ function ChatListItemReady({
a.px_lg,
a.py_md,
a.gap_md,
(hovered || pressed || focused) &&
!isDeletedAccount &&
t.atoms.bg_contrast_25,
(hovered || pressed || focused) && t.atoms.bg_contrast_25,
t.atoms.border_contrast_low,
]}>
<UserAvatar