Skip to content

Commit

Permalink
added label to back button
Browse files Browse the repository at this point in the history
  • Loading branch information
cadibemma committed Dec 4, 2024
1 parent accaf6f commit 15667d6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import React, { FC, ReactNode, useState } from 'react'
import { useTranslation } from 'react-i18next'
import { LayoutChangeEvent, StatusBar, View, ViewStyle, useWindowDimensions } from 'react-native'
import { useSafeAreaInsets } from 'react-native-safe-area-context'

import { HeaderButton, TextView, TextViewProps, WaygateWrapper } from 'components'
import VAScrollView, { VAScrollViewProps } from 'components/VAScrollView'
import { NAMESPACE } from 'constants/namespaces'
import { useIsScreenReaderEnabled, useTheme } from 'utils/hooks'

import HeaderBanner, { HeaderBannerProps } from './HeaderBanner'
Expand Down Expand Up @@ -57,6 +59,7 @@ export const ChildTemplate: FC<ChildTemplateProps> = ({
const fontScale = useWindowDimensions().fontScale
const theme = useTheme()
const screenReaderEnabled = useIsScreenReaderEnabled(true)
const { t } = useTranslation(NAMESPACE.COMMON)

const [scrollOffset, setScrollOffset] = useState(0)
const [trackScrollOffset, setTrackScrollOffset] = useState(true)
Expand All @@ -71,7 +74,9 @@ export const ChildTemplate: FC<ChildTemplateProps> = ({
const headerProps: HeaderBannerProps = {
leftButton: {
text: backLabel,
a11yLabel: backLabelA11y,
a11yLabel: backLabelA11y
? t('back.a11yLabel', { screenName: backLabelA11y })
: t('back.a11yLabel', { screenName: backLabel }),
testID: backLabelTestID,
onPress: backLabelOnPress,
descriptiveBack: true,
Expand Down
1 change: 1 addition & 0 deletions VAMobile/src/translations/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@
"automatedPhoneSystem": "Automated phone system: ",
"back": "Back",
"back.a11yHint": "Navigates to the previous page",
"back.a11yLabel": "Back to {{screenName}}",
"benefits.title": "Benefits",
"benefits.activity.error": "We can't get some of your information. Benefits activity may not be accurate.",
"benefits.activity.nonFatalError": "We can't get some of your information right now. Benefits activity may not be accurate. Check back later.",
Expand Down

0 comments on commit 15667d6

Please sign in to comment.