Skip to content

Commit a409f9a

Browse files
committed
Accessibility improvements on club listing page and leaders corner page
1 parent fa4cb2f commit a409f9a

File tree

8 files changed

+48
-15
lines changed

8 files changed

+48
-15
lines changed

Diff for: src/components/components/announcements/announcements.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ export default props => {
1717

1818
return (
1919
<div>
20-
<h2 className="teaser-box__list-title"> Latest announcements </h2>
21-
<div>
20+
<h2 className="teaser-box__list-title" id="announcements">
21+
Latest announcements
22+
</h2>
23+
<div aria-labelledby="announcements">
2224
<TeaserBoxList items={items} dummyData={props.dummyData} />
2325
</div>
2426
</div>

Diff for: src/components/components/club-teaser-list/club-teaser-list.js

+9-3
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,23 @@ export const ClubTeaser = props => {
2020
const image = props.club.imageUrl;
2121
const classes = props.className ? props.className : "";
2222
return (
23-
<Link to={`/clubs/${props.club.id}`} className={`${classes} club-teaser`}>
23+
<Link
24+
to={`/clubs/${props.club.id}`}
25+
className={`${classes} club-teaser`}
26+
aria-labelledby={title.replace(/\s/g, "")}
27+
>
2428
<ShadowBox className="club-teaser__inner">
2529
<div className="club-teaser__image-wrapper">
2630
<img
2731
src={image || groupSmallImage}
28-
alt={title}
32+
alt={`${title} club logo`}
2933
className="club-teaser__image"
3034
/>
3135
</div>
3236
<div className="club-teaser__text">
33-
<h2 className="club-teaser__title">{title}</h2>
37+
<h2 className="club-teaser__title" id={title.replace(/\s/g, "")}>
38+
{title}
39+
</h2>
3440
<span className="club-teaser__description"> {subtitle} </span>
3541
<div className="button button--x-small club-teaser__button">
3642
Club page <ChevronRight size={16} className="icon" />

Diff for: src/components/components/communication-channels/communication-channels.js

+10-2
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,18 @@ export const ChannelList = props => {
4343

4444
return (
4545
<div className="communication-channels__list">
46-
<h2 className="communication-channels__list-title title title--x-small">
46+
<h2
47+
className="communication-channels__list-title title title--x-small"
48+
id="communication"
49+
>
4750
Communication channels
4851
</h2>
49-
<div className="communication-channels__list-wrapper">{channels}</div>
52+
<div
53+
className="communication-channels__list-wrapper"
54+
aria-labelledby="communication"
55+
>
56+
{channels}
57+
</div>
5058
</div>
5159
);
5260
};

Diff for: src/components/components/contributing-tools/contributing-tools.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const ContributingToolSet = props => {
2525

2626
return (
2727
<div>
28-
<h2> Tools for contributing code to open source projects </h2>
28+
<h2>Tools for contributing code to open source projects</h2>
2929
<MediaQuery maxWidth={767}>
3030
<LayoutScroll>{tools}</LayoutScroll>
3131
</MediaQuery>

Diff for: src/components/components/faq-group/faq-group.js

+9-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,16 @@ export default props => {
1313
<div className={classes}>
1414
<ShadowBox>
1515
<div className="faq__group-header">
16-
<h2 title="title title--x-small">{props.header}</h2>
16+
<h2 title="title title--x-small" id={props.header.replace(/\s/g, "")}>
17+
{props.header}
18+
</h2>
1719
</div>
18-
<ul className="faq__group-content">{props.children}</ul>
20+
<ul
21+
className="faq__group-content"
22+
aria-labelledby={props.header.replace(/\s/g, "")}
23+
>
24+
{props.children}
25+
</ul>
1926
</ShadowBox>
2027
</div>
2128
);

Diff for: src/components/components/job-listing/job-listing.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ export default props => {
1717

1818
return (
1919
<div>
20-
<h2 className="teaser-box__list-title"> Jobs & internships board </h2>
21-
<div>
20+
<h2 className="teaser-box__list-title" id="jobs">
21+
Jobs & internships board
22+
</h2>
23+
<div aria-labelledby="jobs">
2224
<TeaserBoxList items={items} dummyData={props.dummyData} />
2325
</div>
2426
</div>

Diff for: src/components/components/leader-tools/leader-tools.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,11 @@ export class LeaderToolList extends React.PureComponent {
5656
* Creates the tool header.
5757
*/
5858
getSimpleHeader() {
59-
return <span className="title title--x-small"> {this.props.title} </span>;
59+
return (
60+
<span className="title title--x-small" id={this.props.detailsId}>
61+
{this.props.title}
62+
</span>
63+
);
6064
}
6165

6266
/**
@@ -123,6 +127,7 @@ export class LeaderToolList extends React.PureComponent {
123127
className="leader-tools-list"
124128
hidden={hideDetails}
125129
aria-hidden={hideDetails}
130+
aria-labelledby={this.props.detailsId}
126131
>
127132
{tools}
128133
</ul>

Diff for: src/components/components/member-training-resources/member-training-resources.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,13 @@ export default props => {
6464

6565
return (
6666
<LayoutContained>
67-
<h2 className="member-training-resources__list-title">
67+
<h2 className="member-training-resources__list-title" id="resources">
6868
Training & various resources
6969
</h2>
70-
<div className="member-training-resources__list">
70+
<div
71+
className="member-training-resources__list"
72+
aria-labelledby="resources"
73+
>
7174
<MediaQuery maxWidth={767}>
7275
<LayoutScroll stretchItems>{resources}</LayoutScroll>
7376
</MediaQuery>

0 commit comments

Comments
 (0)