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