Skip to content

Commit fa20f19

Browse files
rakshityadav1868sahitya-chandradevin-ai-integration[bot]
authored
fix: Add descriptive alt text to images for accessibility (calcom#28469)
* fix: add descriptive alt text to images for accessibility Signed-off-by: Rakshit Yadav <yadavrakshit60@gmail.com> * Apply suggestions from code review Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix: internationalize alt text strings for accessibility Signed-off-by: Rakshit Yadav <yadavrakshit60@gmail.com> * Update apps/web/components/settings/EnableTwoFactorModal.tsx Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com> * add useLocale to EventTypeGroup component for translations Signed-off-by: Rakshit Yadav <yadavrakshit60@gmail.com> --------- Signed-off-by: Rakshit Yadav <yadavrakshit60@gmail.com> Co-authored-by: Sahitya Chandra <sahityajb@gmail.com> Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 parent 089a39f commit fa20f19

6 files changed

Lines changed: 9 additions & 5 deletions

File tree

apps/web/components/apps/installation/AccountsStepCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const AccountSelector: FC<AccountSelectorProps> = ({
5454
}
5555
}}>
5656
<Avatar
57-
alt={avatar || ""}
57+
alt={t("avatar_of_name", { name })}
5858
imageSrc={getPlaceholderAvatar(avatar, name)} // if no image, use default avatar
5959
size="sm"
6060
/>

apps/web/components/apps/installation/ConfigureStepCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ const ConfigureStepCardContent: FC<ConfigureStepCardProps> = (props) => {
233233
{eventTypeGroups[groupIndex].eventTypes.some((eventType) => eventType.selected === true) && (
234234
<div className="mb-2 mt-4 flex items-center">
235235
<Avatar
236-
alt=""
236+
alt={t("app_icon", { app: group.slug })}
237237
imageSrc={group.image} // if no image, use default avatar
238238
size="md"
239239
className="inline-flex justify-center"

apps/web/components/apps/installation/EventTypesStepCard.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ const EventTypeCard: FC<EventTypeCardProps> = ({
8787
);
8888
};
8989
const EventTypeGroup: FC<EventTypeGroupProps> = ({ groupIndex, userName, ...props }) => {
90+
const { t } = useLocale();
9091
const { control } = useFormContext<TEventTypesForm>();
9192
const { fields, update } = useFieldArray({
9293
control,
@@ -98,7 +99,7 @@ const EventTypeGroup: FC<EventTypeGroupProps> = ({ groupIndex, userName, ...prop
9899
<div className="mt-10">
99100
<div className="mb-2 flex items-center">
100101
<Avatar
101-
alt=""
102+
alt={t("app_icon", { app: props.slug })}
102103
imageSrc={props.image} // if no image, use default avatar
103104
size="md"
104105
className="mt-1 inline-flex justify-center"

apps/web/components/security/EnableTwoFactorModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ const EnableTwoFactorModal = ({ onEnable, onCancel }: EnableTwoFactorModalProps)
174174
<div className="flex justify-center">
175175
{
176176
// eslint-disable-next-line @next/next/no-img-element
177-
<img src={dataUri} alt="" />
177+
<img src={dataUri} alt={t("two_factor_auth_qr_code")} />
178178
}
179179
</div>
180180
<p className="text-center font-mono text-xs">{secret}</p>

apps/web/components/settings/EnableTwoFactorModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ const EnableTwoFactorModal = ({ onEnable, onCancel, open, onOpenChange }: Enable
192192
<div className="-mt-3 flex justify-center">
193193
{
194194
// eslint-disable-next-line @next/next/no-img-element
195-
<img src={dataUri} alt="" />
195+
<img src={dataUri} alt={t("two_factor_auth_qr_code")} />
196196
}
197197
</div>
198198
<p data-testid="two-factor-secret" className="mb-4 text-center font-mono text-xs">

packages/i18n/locales/en/common.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,8 +1052,11 @@
10521052
"your_email": "Your email",
10531053
"avatar": "Avatar",
10541054
"avatar_of_username": "Avatar of {{username}}",
1055+
"avatar_of_name": "{{name}}'s avatar",
10551056
"change_avatar": "Change avatar",
10561057
"upload_avatar": "Upload avatar",
1058+
"app_icon": "{{app}} app icon",
1059+
"two_factor_auth_qr_code": "Two-factor authentication QR code",
10571060
"language": "Language",
10581061
"timezone": "Timezone",
10591062
"first_day_of_week": "First day of week",

0 commit comments

Comments
 (0)