Skip to content

Commit

Permalink
Add aria-label to resolve accessibility
Browse files Browse the repository at this point in the history
  • Loading branch information
iago1501 authored Aug 20, 2024
2 parents b18253a + 5354d09 commit 1d1ff75
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 1 deletion.
3 changes: 2 additions & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"builders": {
"store": "0.x",
"react": "3.x",
"docs": "0.x"
"docs": "0.x",
"messages": "1.x"
},
"mustUpdateAt": "2019-04-02",
"categories": [],
Expand Down
3 changes: 3 additions & 0 deletions messages/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"store/breadcrumb.homeLink": "Home Link"
}
3 changes: 3 additions & 0 deletions messages/es.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"store/breadcrumb.homeLink": "Enlace de Inicio"
}
3 changes: 3 additions & 0 deletions messages/pt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"store/breadcrumb.homeLink": "Link de Início"
}
5 changes: 5 additions & 0 deletions react/components/BaseBreadcrumb.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { Fragment, useMemo } from 'react'
import unorm from 'unorm'
import { useIntl } from 'react-intl'
import { Link } from 'vtex.render-runtime'
import { useCssHandles, applyModifiers } from 'vtex.css-handles'
import { IconCaret, IconHome } from 'vtex.store-icons'
Expand Down Expand Up @@ -69,6 +70,7 @@ const Breadcrumb: React.FC<Props> = ({
homeIconSize = 26,
caretIconSize = 8,
}) => {
const intl = useIntl()
const handles = useCssHandles(CSS_HANDLES)
const { isMobile } = useDevice()
const navigationList = useMemo(
Expand All @@ -88,6 +90,9 @@ const Breadcrumb: React.FC<Props> = ({
<Link
className={`${handles.link} ${handles.homeLink} ${linkBaseClasses} v-mid`}
page="store.home"
aria-label={intl.formatMessage({
id: 'store/breadcrumb.homeLink',
})}
>
<IconHome size={homeIconSize} />
</Link>
Expand Down

0 comments on commit 1d1ff75

Please sign in to comment.