Skip to content

Commit

Permalink
fix: add aria-label
Browse files Browse the repository at this point in the history
  • Loading branch information
ogonkov committed May 20, 2024
1 parent a056aca commit 63b9db4
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/AvatarStack/AvatarStack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {isOfType} from '../utils/isOfType';

import {AvatarStackItem} from './AvatarStackItem';
import {AvatarStackMoreButton} from './AvatarStackMoreButton';
import i18n from './i18n';
import type {AvatarStackProps} from './types';

import './AvatarStack.scss';
Expand Down Expand Up @@ -53,7 +54,12 @@ const AvatarStackComponent = ({
if (!moreButton.length && hasMoreButton) {
const guessedSize = visibleItems[0]?.props.children.props.size;
moreButton.push(
<AvatarStackMoreButton key="more-button" size={guessedSize} count={moreItems + 1} />,
<AvatarStackMoreButton
key="more-button"
size={guessedSize}
count={moreItems + 1}
aria-label={i18n('more')}
/>,
);
}

Expand Down
3 changes: 3 additions & 0 deletions src/components/AvatarStack/i18n/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"more": "More"
}
8 changes: 8 additions & 0 deletions src/components/AvatarStack/i18n/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import {addComponentKeysets} from '../../utils/addComponentKeysets';

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

const COMPONENT = 'AvatarStack';

export default addComponentKeysets({en, ru}, COMPONENT);
3 changes: 3 additions & 0 deletions src/components/AvatarStack/i18n/ru.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"more": "Больше"
}

0 comments on commit 63b9db4

Please sign in to comment.