[🐴] Screenreader accessibility actions for individual chat items (#4116)
* add accessibility tap to messages * add a label for the accessibility action * improve accessibility actions on chat list items * adjust types * more consistent wording * make the strings localizable
This commit is contained in:
parent
24f8794d4d
commit
492216a584
2 changed files with 25 additions and 3 deletions
|
@ -9,6 +9,8 @@ import Animated, {
|
|||
withTiming,
|
||||
} from 'react-native-reanimated'
|
||||
import {ChatBskyConvoDefs} from '@atproto/api'
|
||||
import {msg} from '@lingui/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
|
||||
import {HITSLOP_10} from 'lib/constants'
|
||||
import {useHaptics} from 'lib/haptics'
|
||||
|
@ -25,6 +27,7 @@ export function ActionsWrapper({
|
|||
isFromSelf: boolean
|
||||
children: React.ReactNode
|
||||
}) {
|
||||
const {_} = useLingui()
|
||||
const playHaptic = useHaptics()
|
||||
const menuControl = useMenuControl()
|
||||
|
||||
|
@ -78,7 +81,12 @@ export function ActionsWrapper({
|
|||
},
|
||||
isFromSelf ? a.self_end : a.self_start,
|
||||
animatedStyle,
|
||||
]}>
|
||||
]}
|
||||
accessible={true}
|
||||
accessibilityActions={[
|
||||
{name: 'activate', label: _(msg`Open message options`)},
|
||||
]}
|
||||
onAccessibilityAction={open}>
|
||||
{children}
|
||||
<MessageMenu message={message} control={menuControl} />
|
||||
</Animated.View>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue