fix: Add descriptive alt text to images for accessibility (#28469)
* fix: add descriptive alt text to images for accessibility Signed-off-by: Rakshit Yadav <[email protected]> * 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 <[email protected]> * 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 <[email protected]> --------- Signed-off-by: Rakshit Yadav <[email protected]> Co-authored-by: Sahitya Chandra <[email protected]> Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
6 files changed
+9
-5
No files matched your search
@@ -54,7 +54,7 @@ const AccountSelector: FC<AccountSelectorProps> = ({
|
|||||||
}
|
}
|
||||||
}}>
|
}}>
|
||||||
<Avatar
|
<Avatar
|
||||||
alt={avatar || ""}
|
alt={t("avatar_of_name", { name })}
|
||||||
imageSrc={getPlaceholderAvatar(avatar, name)} // if no image, use default avatar
|
imageSrc={getPlaceholderAvatar(avatar, name)} // if no image, use default avatar
|
||||||
size="sm"
|
size="sm"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -233,7 +233,7 @@ const ConfigureStepCardContent: FC<ConfigureStepCardProps> = (props) => {
|
|||||||
{eventTypeGroups[groupIndex].eventTypes.some((eventType) => eventType.selected === true) && (
|
{eventTypeGroups[groupIndex].eventTypes.some((eventType) => eventType.selected === true) && (
|
||||||
<div className="mb-2 mt-4 flex items-center">
|
<div className="mb-2 mt-4 flex items-center">
|
||||||
<Avatar
|
<Avatar
|
||||||
alt=""
|
alt={t("app_icon", { app: group.slug })}
|
||||||
imageSrc={group.image} // if no image, use default avatar
|
imageSrc={group.image} // if no image, use default avatar
|
||||||
size="md"
|
size="md"
|
||||||
className="inline-flex justify-center"
|
className="inline-flex justify-center"
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ const EventTypeCard: FC<EventTypeCardProps> = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
const EventTypeGroup: FC<EventTypeGroupProps> = ({ groupIndex, userName, ...props }) => {
|
const EventTypeGroup: FC<EventTypeGroupProps> = ({ groupIndex, userName, ...props }) => {
|
||||||
|
const { t } = useLocale();
|
||||||
const { control } = useFormContext<TEventTypesForm>();
|
const { control } = useFormContext<TEventTypesForm>();
|
||||||
const { fields, update } = useFieldArray({
|
const { fields, update } = useFieldArray({
|
||||||
control,
|
control,
|
||||||
@@ -98,7 +99,7 @@ const EventTypeGroup: FC<EventTypeGroupProps> = ({ groupIndex, userName, ...prop
|
|||||||
<div className="mt-10">
|
<div className="mt-10">
|
||||||
<div className="mb-2 flex items-center">
|
<div className="mb-2 flex items-center">
|
||||||
<Avatar
|
<Avatar
|
||||||
alt=""
|
alt={t("app_icon", { app: props.slug })}
|
||||||
imageSrc={props.image} // if no image, use default avatar
|
imageSrc={props.image} // if no image, use default avatar
|
||||||
size="md"
|
size="md"
|
||||||
className="mt-1 inline-flex justify-center"
|
className="mt-1 inline-flex justify-center"
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ const EnableTwoFactorModal = ({ onEnable, onCancel }: EnableTwoFactorModalProps)
|
|||||||
<div className="flex justify-center">
|
<div className="flex justify-center">
|
||||||
{
|
{
|
||||||
// eslint-disable-next-line @next/next/no-img-element
|
// eslint-disable-next-line @next/next/no-img-element
|
||||||
<img src={dataUri} alt="" />
|
<img src={dataUri} alt={t("two_factor_auth_qr_code")} />
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
<p className="text-center font-mono text-xs">{secret}</p>
|
<p className="text-center font-mono text-xs">{secret}</p>
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ const EnableTwoFactorModal = ({ onEnable, onCancel, open, onOpenChange }: Enable
|
|||||||
<div className="-mt-3 flex justify-center">
|
<div className="-mt-3 flex justify-center">
|
||||||
{
|
{
|
||||||
// eslint-disable-next-line @next/next/no-img-element
|
// eslint-disable-next-line @next/next/no-img-element
|
||||||
<img src={dataUri} alt="" />
|
<img src={dataUri} alt={t("two_factor_auth_qr_code")} />
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
<p data-testid="two-factor-secret" className="mb-4 text-center font-mono text-xs">
|
<p data-testid="two-factor-secret" className="mb-4 text-center font-mono text-xs">
|
||||||
|
|||||||
@@ -1052,8 +1052,11 @@
|
|||||||
"your_email": "Your email",
|
"your_email": "Your email",
|
||||||
"avatar": "Avatar",
|
"avatar": "Avatar",
|
||||||
"avatar_of_username": "Avatar of {{username}}",
|
"avatar_of_username": "Avatar of {{username}}",
|
||||||
|
"avatar_of_name": "{{name}}'s avatar",
|
||||||
"change_avatar": "Change avatar",
|
"change_avatar": "Change avatar",
|
||||||
"upload_avatar": "Upload avatar",
|
"upload_avatar": "Upload avatar",
|
||||||
|
"app_icon": "{{app}} app icon",
|
||||||
|
"two_factor_auth_qr_code": "Two-factor authentication QR code",
|
||||||
"language": "Language",
|
"language": "Language",
|
||||||
"timezone": "Timezone",
|
"timezone": "Timezone",
|
||||||
"first_day_of_week": "First day of week",
|
"first_day_of_week": "First day of week",
|
||||||
|
|||||||
Reference in new issue
Block a user