Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds aria-labels to svg social icon links #1092

Merged
merged 4 commits into from
Nov 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/_components/footer/Footer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import socials from './socials';

import { thatLinks, supportLinks, companyLinks, legalLinks } from './links';

</script>

<footer class="bg-white border-t border-gray-200" aria-labelledby="footerHeading">
Expand All @@ -19,7 +20,7 @@
<div class="flex space-x-2">
{#each socials as s}
<div class="h-6 w-6">
<SocialLink href={s.href} network={s.network} />
<SocialLink href={s.href} ariaLabel={s.ariaLabel} network={s.network} />
</div>
{/each}
</div>
Expand Down
25 changes: 17 additions & 8 deletions src/_components/footer/socials.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,43 @@
export default [
{
href: 'https://github.com/thatconference',
network: 'GITHUB'
network: 'GITHUB',
ariaLabel: 'Github Repo'
},
{
href: 'https://twitter.com/thatconference',
network: 'TWITTER'
network: 'TWITTER',
ariaLabel: 'Twitter'

},
{
href: 'https://facebook.com/thatconference',
network: 'FACEBOOK'
network: 'FACEBOOK',
ariaLabel: 'Facebook'
},
{
href: 'https://instagram.com/thatconference',
network: 'INSTAGRAM'
network: 'INSTAGRAM',
ariaLabel: 'Instagram'
},
{
href: 'https://linkedin.com/company/that-conference',
network: 'LINKEDIN'
network: 'LINKEDIN',
ariaLabel: 'LinkedIn'
},
{
href: 'https://youtube.com/c/thatconference',
network: 'YOUTUBE'
network: 'YOUTUBE',
ariaLabel: 'YouTube'
},
{
href: 'https://that.live',
network: 'TWITCH'
network: 'TWITCH',
ariaLabel: 'Twitch'
},
{
href: '/signup/',
network: 'SLACK'
network: 'SLACK',
ariaLabel: 'Join Us on Slack'
}
];
2 changes: 1 addition & 1 deletion src/_components/members/MemberCard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<dt class="sr-only">Social Links</dt>
<dd class="mt-2">
{#each profileLinks as link}
<SocialLinks href={link.url} network={link.linkType} />
<SocialLinks href={link.url} ariaLabel={link.ariaLabel} network={link.linkType} />
{/each}
</dd>
</dl>
Expand Down
15 changes: 14 additions & 1 deletion src/_components/social/SocialLink.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,51 +17,64 @@

export let network;
export let href;
export let ariaLabel;
export let isLast = false;

let socialIcon;

switch (network) {
case 'FACEBOOK':
socialIcon = facebook;
ariaLabel = 'Facebook';
break;
case 'TWITTER':
socialIcon = twitter;
ariaLabel = 'Twitter';
break;
case 'GITHUB':
socialIcon = github;
ariaLabel = 'Github';
break;
case 'INSTAGRAM':
socialIcon = instagram;
ariaLabel = 'Instagram';
break;
case 'WEBSITE':
socialIcon = link;
ariaLabel = 'Website';
break;
case 'LINKEDIN':
socialIcon = linkedin;
ariaLabel = 'LinkedIn';
break;
case 'YOUTUBE':
socialIcon = youtubePlay;
ariaLabel = 'YouTube';
break;
case 'TWITCH':
socialIcon = twitch;
ariaLabel = 'Twitch';
break;
case 'DRIBBBLE':
socialIcon = dribbble;
ariaLabel = 'Dribble';
break;
case 'MEDIUM':
socialIcon = medium;
ariaLabel = 'Medium';
break;
case 'STACK_OVERFLOW':
socialIcon = stackOverflow;
ariaLabel = 'Stack Overflow';
break;
case 'SLACK':
socialIcon = slack;
ariaLabel = 'Slack';
break;
}
</script>

<a {href} target="_blank" rel="noopener">
<a {href} aria-label={ariaLabel} target="_blank" rel="noopener" >
<Icon
data={socialIcon}
class={`transition duration-500 ease-in-out transform hover:scale-125 cursor-pointer ${
Expand Down
2 changes: 1 addition & 1 deletion src/routes/join/[activityId]/index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@

{#if activityDetails}
<ActionHeader title={activityDetails.title}>
<a href="/activities/{activityId}/">Activity Details</a>
<a href="/activities/{activityId}/" class="px-8 py-3 rounded-md shadow text-base leading-6 font-medium border-2 border-thatBlue-500 text-thatBlue-500 bg-white hover:bg-thatBlue-500 hover:text-white focus:bg-thatBlue-500 focus:text-white focus:outline-none focus:ring-thatBlue-500 focus:border-thatBlue-800 transition duration-150 ease-in-out md:py-4 md:text-lg md:px-10" target="_blank" rel="noopener">Activity Details</a>
</ActionHeader>
{/if}
</div>
Expand Down