Replace incongruous buttons in drawer (#4772)

* Replace incongruous buttons in drawer

* Improve a11y help
zio/stable
Eric Bailey 2024-07-12 12:12:57 -05:00 committed by GitHub
parent f85df425f7
commit 7c1c24ef1b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 24 additions and 34 deletions

View File

@ -9,10 +9,7 @@ import {
View, View,
ViewStyle, ViewStyle,
} from 'react-native' } from 'react-native'
import { import {FontAwesomeIconStyle} from '@fortawesome/react-native-fontawesome'
FontAwesomeIcon,
FontAwesomeIconStyle,
} from '@fortawesome/react-native-fontawesome'
import {msg, Plural, Trans} from '@lingui/macro' import {msg, Plural, Trans} from '@lingui/macro'
import {useLingui} from '@lingui/react' import {useLingui} from '@lingui/react'
import {StackActions, useNavigation} from '@react-navigation/native' import {StackActions, useNavigation} from '@react-navigation/native'
@ -37,6 +34,7 @@ import {formatCountShortOnly} from 'view/com/util/numeric/format'
import {Text} from 'view/com/util/text/Text' import {Text} from 'view/com/util/text/Text'
import {UserAvatar} from 'view/com/util/UserAvatar' import {UserAvatar} from 'view/com/util/UserAvatar'
import {useTheme as useAlfTheme} from '#/alf' import {useTheme as useAlfTheme} from '#/alf'
import {Button, ButtonIcon, ButtonText} from '#/components/Button'
import { import {
Bell_Filled_Corner0_Rounded as BellFilled, Bell_Filled_Corner0_Rounded as BellFilled,
Bell_Stroke2_Corner0_Rounded as Bell, Bell_Stroke2_Corner0_Rounded as Bell,
@ -52,6 +50,7 @@ import {
} from '#/components/icons/HomeOpen' } from '#/components/icons/HomeOpen'
import {MagnifyingGlass_Filled_Stroke2_Corner0_Rounded as MagnifyingGlassFilled} from '#/components/icons/MagnifyingGlass' import {MagnifyingGlass_Filled_Stroke2_Corner0_Rounded as MagnifyingGlassFilled} from '#/components/icons/MagnifyingGlass'
import {MagnifyingGlass2_Stroke2_Corner0_Rounded as MagnifyingGlass} from '#/components/icons/MagnifyingGlass2' import {MagnifyingGlass2_Stroke2_Corner0_Rounded as MagnifyingGlass} from '#/components/icons/MagnifyingGlass2'
import {Message_Stroke2_Corner0_Rounded as Message} from '#/components/icons/Message'
import {SettingsGear2_Stroke2_Corner0_Rounded as Settings} from '#/components/icons/SettingsGear2' import {SettingsGear2_Stroke2_Corner0_Rounded as Settings} from '#/components/icons/SettingsGear2'
import { import {
UserCircle_Filled_Corner0_Rounded as UserCircleFilled, UserCircle_Filled_Corner0_Rounded as UserCircleFilled,
@ -319,42 +318,33 @@ let DrawerFooter = ({
onPressFeedback: () => void onPressFeedback: () => void
onPressHelp: () => void onPressHelp: () => void
}): React.ReactNode => { }): React.ReactNode => {
const theme = useTheme()
const pal = usePalette('default')
const {_} = useLingui() const {_} = useLingui()
return ( return (
<View style={styles.footer}> <View style={styles.footer}>
<TouchableOpacity <Button
accessibilityRole="link" label={_(msg`Send feedback`)}
accessibilityLabel={_(msg`Send feedback`)} size="small"
accessibilityHint="" variant="solid"
onPress={onPressFeedback} color="secondary"
style={[ onPress={onPressFeedback}>
styles.footerBtn, <ButtonIcon icon={Message} position="left" />
styles.footerBtnFeedback, <ButtonText>
theme.colorScheme === 'light'
? styles.footerBtnFeedbackLight
: styles.footerBtnFeedbackDark,
]}>
<FontAwesomeIcon
style={pal.link as FontAwesomeIconStyle}
size={18}
icon={['far', 'message']}
/>
<Text type="lg-medium" style={[pal.link, s.pl10]}>
<Trans>Feedback</Trans> <Trans>Feedback</Trans>
</Text> </ButtonText>
</TouchableOpacity> </Button>
<TouchableOpacity <Button
accessibilityRole="link" label={_(msg`Get help`)}
accessibilityLabel={_(msg`Send feedback`)} size="small"
accessibilityHint="" variant="outline"
color="secondary"
onPress={onPressHelp} onPress={onPressHelp}
style={[styles.footerBtn]}> style={{
<Text type="lg-medium" style={[pal.link, s.pl10]}> backgroundColor: 'transparent',
}}>
<ButtonText>
<Trans>Help</Trans> <Trans>Help</Trans>
</Text> </ButtonText>
</TouchableOpacity> </Button>
</View> </View>
) )
} }