Add ability to reply, repost (without quote post), and like posts using VoiceOver (#765)

Co-authored-by: Paul Frazee <pfrazee@gmail.com>
This commit is contained in:
Ollie H 2023-05-30 17:50:56 -07:00 committed by GitHub
parent 7458b6f600
commit a9a661ab58
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 138 additions and 30 deletions

View file

@ -1,11 +1,5 @@
import React from 'react'
import {
StyleProp,
StyleSheet,
TouchableOpacity,
View,
ViewStyle,
} from 'react-native'
import React, {ComponentProps} from 'react'
import {StyleSheet, TouchableOpacity, View} from 'react-native'
import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome'
import {usePalette} from 'lib/hooks/usePalette'
import {Link} from '../Link'
@ -13,18 +7,21 @@ import {Text} from '../text/Text'
import {addStyle} from 'lib/styles'
import {ModerationBehaviorCode, ModerationBehavior} from 'lib/labeling/types'
interface Props extends ComponentProps<typeof Link> {
// testID?: string
// href?: string
// style: StyleProp<ViewStyle>
moderation: ModerationBehavior
}
export function PostHider({
testID,
href,
moderation,
style,
children,
}: React.PropsWithChildren<{
testID?: string
href?: string
moderation: ModerationBehavior
style: StyleProp<ViewStyle>
}>) {
...props
}: Props) {
const pal = usePalette('default')
const [override, setOverride] = React.useState(false)
const bg = override ? pal.viewLight : pal.view
@ -70,7 +67,14 @@ export function PostHider({
// NOTE: any further label enforcement should occur in ContentContainer
return (
<Link testID={testID} style={style} href={href} noFeedback>
<Link
testID={testID}
style={style}
href={href}
noFeedback
accessible={true}
accessibilityRole="none"
{...props}>
{children}
</Link>
)

View file

@ -191,9 +191,7 @@ export function PostCtrls(opts: PostCtrlsOpts) {
onPress={onPressToggleLikeWrapper}
accessibilityRole="button"
accessibilityLabel={opts.isLiked ? 'Unlike' : 'Like'}
accessibilityHint={
opts.isReposted ? 'Removes like from the post' : 'Like the post'
}>
accessibilityHint="">
{opts.isLiked ? (
<HeartIconSolid
style={styles.ctrlIconLiked}

View file

@ -50,11 +50,7 @@ export const RepostButton = ({
style={styles.control}
accessibilityRole="button"
accessibilityLabel={isReposted ? 'Undo repost' : 'Repost'}
accessibilityHint={
isReposted
? `Remove your repost of the post`
: `Repost or quote post the post`
}>
accessibilityHint="">
<RepostIcon
style={
isReposted