Skip to content

Commit 05ff91a

Browse files
feat: update aria lable
1 parent f8926e1 commit 05ff91a

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

packages/template-retail-react-app/app/components/search/partials/ask-assistant-banner.jsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,21 @@
77
import React from 'react'
88
import PropTypes from 'prop-types'
99
import {Box, Text} from '@salesforce/retail-react-app/app/components/shared/ui'
10-
import {FormattedMessage} from 'react-intl'
10+
import {FormattedMessage, useIntl} from 'react-intl'
1111
import {SparkleIcon, ChevronRightIcon} from '@salesforce/retail-react-app/app/components/icons'
1212

1313
const AskAssistantBanner = ({onClick, styles}) => {
14+
const intl = useIntl()
15+
const title = intl.formatMessage({
16+
id: 'search.suggestions.askAssistant.title',
17+
defaultMessage: 'Ask Shopping Agent'
18+
})
19+
const description = intl.formatMessage({
20+
id: 'search.suggestions.askAssistant.description',
21+
defaultMessage: 'Discover, compare, and shop smarter with your personal Shopping Agent.'
22+
})
23+
const ariaLabel = `${title} - ${description}`
24+
1425
const handleInteraction = (e) => {
1526
e.preventDefault()
1627
e.stopPropagation()
@@ -25,7 +36,7 @@ const AskAssistantBanner = ({onClick, styles}) => {
2536
textAlign="left"
2637
onMouseDown={handleInteraction}
2738
onClick={handleInteraction}
28-
aria-label="Ask Shopping Agent - Discover, compare and shop smarter with your personal shopping assistant"
39+
aria-label={ariaLabel}
2940
>
3041
<Box {...styles.askAssistantBannerIcon}>
3142
<SparkleIcon boxSize={5} color="gray.800" />

0 commit comments

Comments
 (0)