Skip to content

Commit 78d1fe9

Browse files
committed
✨(frontend) improve share modal button accessibility
Added aria-labels to remove and invite buttons Signed-off-by: Cyril <[email protected]>
1 parent 8dad9ea commit 78d1fe9

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ and this project adheres to
1717
- ♿(frontend) improve ARIA in doc grid and editor for a11y #1519
1818
- ♿(frontend) improve accessibility and styling of summary table #1528
1919
- ♿(frontend) add focus trap and enter key support to remove doc modal #1531
20+
- ♿(frontend) improve share modal button accessibility
2021
- 🐛(docx) fix image overflow by limiting width to 600px during export #1525
2122
- 🐛(frontend) preserve @ character when esc is pressed after typing it #1512
2223
- 🐛(frontend) make summary button fixed to remain visible during scroll #1581

src/frontend/apps/impress/src/features/docs/doc-share/components/DocShareAddMemberList.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,12 @@ export const DocShareAddMemberList = ({
108108
afterInvite?.();
109109
setIsLoading(false);
110110
};
111+
const inviteLabel =
112+
selectedUsers.length === 1
113+
? t('Invite {{name}}', {
114+
name: selectedUsers[0].full_name || selectedUsers[0].email,
115+
})
116+
: t('Invite {{count}} members', { count: selectedUsers.length });
111117

112118
return (
113119
<Box
@@ -143,7 +149,11 @@ export const DocShareAddMemberList = ({
143149
currentRole={invitationRole}
144150
onSelectRole={setInvitationRole}
145151
/>
146-
<Button onClick={() => void onInvite()} disabled={isLoading}>
152+
<Button
153+
onClick={() => void onInvite()}
154+
disabled={isLoading}
155+
aria-label={inviteLabel}
156+
>
147157
{t('Invite')}
148158
</Button>
149159
</Box>

src/frontend/apps/impress/src/features/docs/doc-share/components/DocShareAddMemberListItem.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Button } from '@openfun/cunningham-react';
2+
import { useTranslation } from 'react-i18next';
23
import { css } from 'styled-components';
34

45
import { Box, Icon, Text } from '@/components';
@@ -10,6 +11,7 @@ type Props = {
1011
onRemoveUser?: (user: User) => void;
1112
};
1213
export const DocShareAddMemberListItem = ({ user, onRemoveUser }: Props) => {
14+
const { t } = useTranslation();
1315
const { spacingsTokens, colorsTokens, fontSizesTokens } =
1416
useCunninghamTheme();
1517

@@ -42,6 +44,9 @@ export const DocShareAddMemberListItem = ({ user, onRemoveUser }: Props) => {
4244
size="nano"
4345
onClick={() => onRemoveUser?.(user)}
4446
icon={<Icon $variation="600" $size="sm" iconName="close" />}
47+
aria-label={t('Remove {{name}} from the invite list', {
48+
name: user.full_name || user.email,
49+
})}
4550
/>
4651
</Box>
4752
);

0 commit comments

Comments
 (0)