From 1c78ce5099651a7e72654ddb737ad832cff60e52 Mon Sep 17 00:00:00 2001 From: Theo Bentum Date: Thu, 18 Jul 2024 16:36:46 -0700 Subject: [PATCH] feature/7811-HomeScreenButtonsA11y (#9021) --- VAMobile/src/components/Templates/CategoryLanding.tsx | 1 + VAMobile/src/components/types/HeaderButton.tsx | 3 +++ VAMobile/src/screens/HomeScreen/HomeScreen.tsx | 4 +++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/VAMobile/src/components/Templates/CategoryLanding.tsx b/VAMobile/src/components/Templates/CategoryLanding.tsx index 92b074ee179..06177a42863 100644 --- a/VAMobile/src/components/Templates/CategoryLanding.tsx +++ b/VAMobile/src/components/Templates/CategoryLanding.tsx @@ -61,6 +61,7 @@ export const CategoryLanding: FC = ({ ? { text: headerButton.label, a11yLabel: headerButton.labelA11y, + accessibilityRole: headerButton.accessibilityRole, onPress: headerButton.onPress, icon: headerButton.icon, } diff --git a/VAMobile/src/components/types/HeaderButton.tsx b/VAMobile/src/components/types/HeaderButton.tsx index 1be0cbcca63..ddb253a5207 100644 --- a/VAMobile/src/components/types/HeaderButton.tsx +++ b/VAMobile/src/components/types/HeaderButton.tsx @@ -1,8 +1,11 @@ +import { AccessibilityRole } from 'react-native' + import { VAIconProps } from 'components/VAIcon' export type HeaderButton = { label: string labelA11y?: string + accessibilityRole?: AccessibilityRole icon: VAIconProps onPress: () => void testID?: string diff --git a/VAMobile/src/screens/HomeScreen/HomeScreen.tsx b/VAMobile/src/screens/HomeScreen/HomeScreen.tsx index 174230fd369..96feaaaa465 100644 --- a/VAMobile/src/screens/HomeScreen/HomeScreen.tsx +++ b/VAMobile/src/screens/HomeScreen/HomeScreen.tsx @@ -32,6 +32,7 @@ import { CategoryLanding, CategoryLandingAlert, EncourageUpdateAlert, + HeaderButton, LinkRow, LoadingComponent, Nametag, @@ -253,8 +254,9 @@ export function HomeScreen({}: HomeScreenProps) { navigateTo('Profile') } - const headerButton = { + const headerButton: HeaderButton = { label: t('profile.title'), + accessibilityRole: 'link', icon: profileIconProps, onPress: onProfile, }