Skip to content

Commit eb785bb

Browse files
authored
Merge pull request #1329 from prezly/feature/dev-20838-address-remaining-reported-issues
[DEV-20838] Fix - Another round of accessibility fixes
2 parents eabfa94 + 9bddce6 commit eb785bb

File tree

14 files changed

+54
-29
lines changed

14 files changed

+54
-29
lines changed

src/components/ContactCard/ContactCard.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,25 +48,25 @@ export function ContactCard({
4848
<div className={styles.primaryContacts}>
4949
{email && (
5050
<a href={`mailto:${email}`} className={styles.link}>
51-
<IconEmail aria-hidden="true" className={styles.icon} />
51+
<IconEmail aria-hidden className={styles.icon} />
5252
<span className={styles.linkText}>{email}</span>
5353
</a>
5454
)}
5555
{phone && (
5656
<a href={`tel:${phone}`} className={styles.link}>
57-
<IconPhone aria-hidden="true" className={styles.icon} />
57+
<IconPhone aria-hidden className={styles.icon} />
5858
<span className={styles.linkText}>{phone}</span>
5959
</a>
6060
)}
6161
{mobile && (
6262
<a href={`tel:${mobile}`} className={styles.link}>
63-
<IconMobile aria-hidden="true" className={styles.icon} />
63+
<IconMobile aria-hidden className={styles.icon} />
6464
<span className={styles.linkText}>{mobile}</span>
6565
</a>
6666
)}
6767
{website && (
6868
<a href={website} className={styles.link}>
69-
<IconGlobe aria-hidden="true" className={styles.icon} />
69+
<IconGlobe aria-hidden className={styles.icon} />
7070
<span className={styles.linkText}>
7171
{website.replace(/(^\w+:|^)\/\//, '')}
7272
</span>
@@ -76,13 +76,13 @@ export function ContactCard({
7676
<div className={styles.socials}>
7777
{facebook && (
7878
<a href={`https://facebook.com/${facebook}`} className={styles.link}>
79-
<IconFacebook aria-hidden="true" className={styles.icon} />
79+
<IconFacebook aria-hidden className={styles.icon} />
8080
<span className={styles.linkText}>{facebook}</span>
8181
</a>
8282
)}
8383
{twitter && (
8484
<a href={`https://twitter.com/${twitter}`} className={styles.link}>
85-
<IconTwitter aria-hidden="true" className={styles.icon} />
85+
<IconTwitter aria-hidden className={styles.icon} />
8686
<span className={styles.linkText}>{`@${twitter}`}</span>
8787
</a>
8888
)}

src/components/ContentRenderer/components/Attachment/DownloadLink.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function DownloadLink({ className }: Props) {
1616
return (
1717
<div className={classNames(styles.link, className)}>
1818
<FormattedMessage locale={locale} for={translations.actions.download} />
19-
<IconDownload width={16} height={16} className={styles.icon} />
19+
<IconDownload aria-hidden width={16} height={16} className={styles.icon} />
2020
</div>
2121
);
2222
}

src/components/ContentRenderer/components/Attachment/FileTypeIcon.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,5 +75,5 @@ function getIconComponentFromExtension(extension?: string) {
7575

7676
export function FileTypeIcon({ extension, className }: Props) {
7777
const IconComponent = getIconComponentFromExtension(extension);
78-
return <IconComponent className={className} />;
78+
return <IconComponent aria-hidden className={className} />;
7979
}

src/components/ContentRenderer/components/NoConsentFallback.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,21 @@ export function NoConsentFallback({ id, entity, oembed }: Props) {
2020

2121
if (oembed.screenshot_url) {
2222
return (
23-
<NextLink id={id} className={styles.imageFallback} href={oembed.url} target="__blank">
24-
<img
25-
className={styles.image}
26-
src={oembed.screenshot_url}
27-
alt={oembed.title || oembed.description || ''}
28-
/>
23+
<NextLink
24+
aria-label={oembed.title || oembed.description || ''}
25+
id={id}
26+
className={styles.imageFallback}
27+
href={oembed.url}
28+
target="__blank"
29+
>
30+
<img alt="" className={styles.image} src={oembed.screenshot_url} />
2931
</NextLink>
3032
);
3133
}
3234

3335
return (
3436
<div className={styles.container} id={id}>
35-
<IconBan className={styles.icon} />
37+
<IconBan aria-hidden className={styles.icon} />
3638
<div className={styles.title}>Content unavailable</div>
3739
<p className={styles.description}>
3840
<span>

src/components/Dropdown/Dropdown.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export function Dropdown({
1515
icon,
1616
label,
1717
className,
18+
menuAs = 'ul',
1819
menuClassName,
1920
buttonClassName,
2021
buttonContentClassName,
@@ -39,6 +40,7 @@ export function Dropdown({
3940
{label}
4041
{!forceOpen && (
4142
<IconCaret
43+
aria-hidden
4244
width={12}
4345
height={12}
4446
className={classNames(styles.caret, {
@@ -51,7 +53,7 @@ export function Dropdown({
5153
{forceOpen && (
5254
<MenuItems
5355
static
54-
as="ul"
56+
as={menuAs}
5557
className={classNames(styles.menu, menuClassName, {
5658
[styles.withMobileDisplay]: withMobileDisplay,
5759
})}
@@ -70,7 +72,7 @@ export function Dropdown({
7072
leaveTo={styles.transitionOpenStart}
7173
>
7274
<MenuItems
73-
as="ul"
75+
as={menuAs}
7476
className={classNames(styles.menu, menuClassName, {
7577
[styles.withMobileDisplay]: withMobileDisplay,
7678
})}
@@ -91,6 +93,7 @@ export namespace Dropdown {
9193
label: ReactNode;
9294
children?: ReactNode;
9395
className?: string;
96+
menuAs?: 'div' | 'ul';
9497
menuClassName?: string;
9598
buttonClassName?: string;
9699
withMobileDisplay?: boolean;

src/components/ScrollToTopButton/ScrollToTopButton.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export function ScrollToTopButton({
6363
onClick={scrollToTop}
6464
>
6565
<IconComponent
66+
aria-hidden
6667
width={16}
6768
height={16}
6869
className={classNames(styles.icon, iconClassName)}

src/components/StoryCards/HighlightedStoryCard.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
.overlay {
3232
position: absolute;
3333
inset: 0;
34-
background: linear-gradient(270deg, rgb(3 7 18 / 0%) 50%, rgb(3 7 18 / 40%) 100%), linear-gradient(180deg, rgb(3 7 18 / 0%) 40%, rgb(3 7 18 / 20%) 62%, rgb(3 7 18 / 40%) 100%);
34+
background: linear-gradient(270deg, rgb(3 7 18 / 0%) 50%, rgb(3 7 18 / 40%) 100%), linear-gradient(180deg, rgb(3 7 18 / 0%) 40%, rgb(3 7 18 / 20%) 62%, rgb(3 7 18 / 70%) 100%);
3535
}
3636

3737
.image,

src/modules/Boilerplate/ui/Boilerplate.tsx

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,23 @@ export function Boilerplate({ localeCode, newsroom, companyInformation }: Props)
6868
</h2>
6969
{hasAddress && (
7070
<p className={styles.contact}>
71-
<IconBuilding width={16} height={16} className={styles.icon} />
71+
<IconBuilding
72+
aria-hidden
73+
width={16}
74+
height={16}
75+
className={styles.icon}
76+
/>
7277
{companyInformation.address}
7378
</p>
7479
)}
7580
{hasPhone && (
7681
<p className={styles.contact}>
77-
<IconPhone width={16} height={16} className={styles.icon} />
82+
<IconPhone
83+
aria-hidden
84+
width={16}
85+
height={16}
86+
className={styles.icon}
87+
/>
7888
<a
7989
className={styles.link}
8090
href={`tel:${companyInformation.phone}`}
@@ -85,7 +95,12 @@ export function Boilerplate({ localeCode, newsroom, companyInformation }: Props)
8595
)}
8696
{hasEmail && (
8797
<p className={styles.contact}>
88-
<IconEmail width={16} height={16} className={styles.icon} />
98+
<IconEmail
99+
aria-hidden
100+
width={16}
101+
height={16}
102+
className={styles.icon}
103+
/>
89104
<a
90105
className={styles.link}
91106
href={`mailto:${companyInformation.email}`}
@@ -96,7 +111,12 @@ export function Boilerplate({ localeCode, newsroom, companyInformation }: Props)
96111
)}
97112
{companyInformation.website && (
98113
<p className={styles.contact}>
99-
<IconGlobe width={16} height={16} className={styles.icon} />
114+
<IconGlobe
115+
aria-hidden
116+
width={16}
117+
height={16}
118+
className={styles.icon}
119+
/>
100120
<a
101121
href={companyInformation.website}
102122
className={styles.link}

src/modules/FeaturedCategories/ui/FeaturedCategory.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export function FeaturedCategory({
3737
<div className={styles.label}>
3838
<div className={styles.categoryName}>
3939
{name}
40-
<IconArrowRight className={styles.icon} />
40+
<IconArrowRight aria-hidden className={styles.icon} />
4141
</div>
4242
</div>
4343
</Link>

src/modules/Gallery/DownloadLink.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export function DownloadLink({ localeCode, href }: Props) {
3232
rel="nofollow"
3333
>
3434
<FormattedMessage locale={localeCode} for={translations.actions.download} />
35-
<IconDownload width={16} height={16} className={styles.icon} />
35+
<IconDownload aria-hidden width={16} height={16} className={styles.icon} />
3636
</ButtonLink>
3737
);
3838
}

0 commit comments

Comments
 (0)