Skip to content

Commit

Permalink
chore: add accessibilityRole header to app guide/tour and screens
Browse files Browse the repository at this point in the history
Signed-off-by: fc-santos <[email protected]>
  • Loading branch information
fc-santos committed Jan 10, 2025
1 parent 5b9b85e commit 6eea327
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ const EmptyListContacts: React.FC<EmptyListProps> = ({ navigation }) => {
return (
<View style={styles.container}>
<Assets.svg.contactBook fill={ListItems.emptyList.color} height={120} />
<Text style={[TextTheme.headingThree, styles.text, { marginTop: 30 }]}>{t('Contacts.EmptyList')}</Text>
<Text style={[TextTheme.headingThree, styles.text, { marginTop: 30 }]} accessibilityRole="header">
{t('Contacts.EmptyList')}
</Text>
<Text style={[ListItems.emptyList, styles.text]}>{t('Contacts.PeopleAndOrganizations')}</Text>
<Link style={styles.link} linkText={t('Contacts.WhatAreContacts')} onPress={navigateToWhatAreContacts} />
</View>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const AppGuideModal: React.FC<AppGuideModalProps> = ({
<View style={styles.container}>
<View style={styles.headerContainer}>
<View style={styles.headerTextContainer}>
<Text style={styles.headerText} testID={testIdWithKey('HeaderText')}>
<Text style={styles.headerText} testID={testIdWithKey('HeaderText')} accessibilityRole="header">
{title}
</Text>
</View>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const CameraDisclosureModal: React.FC<CameraDisclosureModalProps> = ({ requestCa
)}
<SafeAreaView style={{ backgroundColor: ColorPallet.brand.modalPrimaryBackground }}>
<ScrollView style={styles.container}>
<Text style={TextTheme.modalHeadingOne} testID={testIdWithKey('AllowCameraUse')}>
<Text style={TextTheme.modalHeadingOne} testID={testIdWithKey('AllowCameraUse')} accessibilityRole="header">
{t('CameraDisclosure.AllowCameraUse')}
</Text>
<Text style={[TextTheme.modalNormal, styles.messageText]}>{t('CameraDisclosure.CameraDisclosure')}</Text>
Expand Down
7 changes: 6 additions & 1 deletion packages/legacy/core/App/components/tour/TourBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,12 @@ export function TourBox(props: TourBoxProps): ReactElement {
>
<View style={styles.headerContainer}>
<View style={styles.headerTextContainer}>
<Text allowFontScaling={false} style={styles.headerText} testID={testIdWithKey('HeaderText')}>
<Text
allowFontScaling={false}
style={styles.headerText}
testID={testIdWithKey('HeaderText')}
accessibilityRole="header"
>
{title}
</Text>
</View>
Expand Down
4 changes: 3 additions & 1 deletion packages/legacy/core/App/screens/Tours.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ const Tours: React.FC = () => {
const { value, bool }: Option = option
return (
<View style={[styles.section, styles.sectionRow]}>
<Text style={TextTheme.title}>{value}</Text>
<Text style={TextTheme.title} accessibilityRole="header">
{value}
</Text>
<BouncyCheckbox
accessibilityLabel={value}
disableText
Expand Down
8 changes: 4 additions & 4 deletions packages/legacy/core/App/screens/WhatAreContacts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ const WhatAreContacts: React.FC<WhatAreContactsProps> = ({ navigation }) => {
})

const goToContactList = () => {
navigation
.getParent()
?.navigate(Stacks.ContactStack, { screen: Screens.Contacts })
navigation.getParent()?.navigate(Stacks.ContactStack, { screen: Screens.Contacts })
}

const bulletPoints = [
Expand All @@ -59,7 +57,9 @@ const WhatAreContacts: React.FC<WhatAreContactsProps> = ({ navigation }) => {
automaticallyAdjustContentInsets={false}
showsHorizontalScrollIndicator={false}
>
<Text style={styles.title}>{t('WhatAreContacts.Title')}</Text>
<Text style={styles.title} accessibilityRole="header">
{t('WhatAreContacts.Title')}
</Text>
<Text style={TextTheme.normal}>{t('WhatAreContacts.Preamble')}</Text>
{bulletPoints}
<Text style={TextTheme.normal}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ exports[`TourBox Component Renders properly with defaults 1`] = `
}
>
<Text
accessibilityRole="header"
allowFontScaling={false}
style={
Object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ exports[`CameraDisclosureModal Component Renders correctly 1`] = `
>
<View>
<Text
accessibilityRole="header"
style={
Object {
"color": "#FFFFFF",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ exports[`WhatAreContacts Screen Renders correctly 1`] = `
>
<View>
<Text
accessibilityRole="header"
style={
Object {
"color": "#FFFFFF",
Expand Down

0 comments on commit 6eea327

Please sign in to comment.