Skip to content

Commit

Permalink
feat: breadcrumbs a11y (#975)
Browse files Browse the repository at this point in the history
  • Loading branch information
PahaN47 authored Aug 8, 2024
1 parent 30b8cab commit 1503c49
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/HeaderBreadcrumbs/HeaderBreadcrumbs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import {useAnalytics} from '../../hooks';
import {DefaultEventNames, HeaderBreadCrumbsProps} from '../../models';
import {block} from '../../utils';

import {i18n} from './i18n';

import './HeaderBreadcrumbs.scss';

const b = block('header-breadcrumbs');
Expand All @@ -17,7 +19,7 @@ export default function HeaderBreadcrumbs(props: HeaderBreadCrumbsProps) {
}, [analyticsEvents, handleAnalytics]);

return (
<div className={b({theme}, className)}>
<div className={b({theme}, className)} aria-label={i18n('label')}>
{items?.map((item) => (
<div className={b('item')} key={item.url}>
<a href={item.url} className={b('text')} onClick={onClick}>
Expand Down
3 changes: 3 additions & 0 deletions src/components/HeaderBreadcrumbs/i18n/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"label": "You are here:"
}
8 changes: 8 additions & 0 deletions src/components/HeaderBreadcrumbs/i18n/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import {addComponentKeysets} from '@gravity-ui/uikit/i18n';

import {NAMESPACE} from '../../../utils/cn';

import en from './en.json';
import ru from './ru.json';

export const i18n = addComponentKeysets({en, ru}, `${NAMESPACE}HeaderBreadcrumbs`);
3 changes: 3 additions & 0 deletions src/components/HeaderBreadcrumbs/i18n/ru.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"label": "Вы здесь:"
}

0 comments on commit 1503c49

Please sign in to comment.