Skip to content

Commit 60d6964

Browse files
authored
Merge pull request #397 from BenDMyers/a11y/social-icons
[a11y] Add accessible names to social icon links
2 parents 4514c88 + b7badad commit 60d6964

3 files changed

Lines changed: 14 additions & 7 deletions

File tree

‎frontend/main/src/components/home/Skills.tsx‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,32 +14,38 @@ export default function Skills(): JSX.Element {
1414
{/* These 3 are bigger in size, so they are h-8/16 */}
1515
<Link href="/frameworks/react">
1616
<a>
17+
<span className="sr-only">React</span>
1718
<ReactLogo className="h-14 md:h-16 " />
1819
</a>
1920
</Link>
2021
<Link href="/frameworks/angular">
2122
<a>
23+
<span className="sr-only">Angular</span>
2224
<AngularLogo className="h-14 md:h-16 " />
2325
</a>
2426
</Link>
2527
<Link href="/frameworks/vue">
2628
<a>
29+
<span className="sr-only">Vue</span>
2730
<VueLogo className="h-14 md:h-16 " />
2831
</a>
2932
</Link>
3033
{/* These 3 are smaller in size, so they are h-10/20 */}
3134
<Link href="/frameworks/svelte">
3235
<a>
36+
<span className="sr-only">Svelte</span>
3337
<SvelteLogo className="h-16 md:h-20 " />
3438
</a>
3539
</Link>
3640
<Link href="/languages/css">
3741
<a>
42+
<span className="sr-only">CSS</span>
3843
<CssLogo className="h-16 md:h-20 " />
3944
</a>
4045
</Link>
4146
<Link href="/languages/html">
4247
<a>
48+
<span className="sr-only">HTML</span>
4349
<HtmlLogo className="h-16 md:h-20 " />
4450
</a>
4551
</Link>

‎frontend/main/src/layout/Footer.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ export default function Footer({
109109
rel="noreferrer noopener"
110110
className={`social-links`}
111111
>
112+
<span className="sr-only">{sl.type}</span>
112113
{socialLinkPicker(sl)}
113114
</a>
114115
))}

‎frontend/main/src/services/notion.server.ts‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { config } from '@/config/notion';
55
import { Post, PostType } from '@/models/post.model';
66
import { QueryDatabaseResponse } from '@notionhq/client/build/src/api-endpoints';
77
import { config as notionConfig } from '@/config/notion';
8-
import { Site } from '@/models/site.model';
8+
import { Site, SocialType } from '@/models/site.model';
99
import { Tag } from '@/models/tag.model';
1010
import { NotionBlock } from '@9gustin/react-notion-render';
1111
import { getCloudinaryPublicId } from '@/utils/cloudinary/cloudinary';
@@ -1094,35 +1094,35 @@ export const getSite = () => {
10941094
socialLinks: [
10951095
{
10961096
href: 'https://discord.com/invite/vM2bagU',
1097-
type: 'discord',
1097+
type: SocialType.discord,
10981098
},
10991099
// {
11001100
// href: 'https://www.facebook.com/groups/codingcatdev',
11011101
// type: 'facebook',
11021102
// },
11031103
{
11041104
href: 'https://github.com/sponsors/CodingCatDev',
1105-
type: 'github',
1105+
type: SocialType.github,
11061106
},
11071107
{
11081108
href: 'https://www.linkedin.com/company/codingcatdev/',
1109-
type: 'linkedin',
1109+
type: SocialType.linkedin,
11101110
},
11111111
// {
11121112
// href: 'https://medium.com/codingcatdev',
11131113
// type: 'medium',
11141114
// },
11151115
{
11161116
href: 'https://twitter.com/CodingCatDev',
1117-
type: 'twitter',
1117+
type: SocialType.twitter,
11181118
},
11191119
{
11201120
href: 'https://twitch.tv/codingcatdev',
1121-
type: 'twitch',
1121+
type: SocialType.twitch,
11221122
},
11231123
{
11241124
href: 'https://youtube.com/c/codingcatdev',
1125-
type: 'youtube',
1125+
type: SocialType.youtube,
11261126
},
11271127
],
11281128
id: 'none',

0 commit comments

Comments
 (0)