This repository has been archived by the owner on May 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tabs/share, icon): Add a linkedin share button
Many podcasts are targeted toward professionals who are always on LinkedIn. This change uses the shareArticle endpoint of the LinkedIn API and adds a new icon and Channel component.
- Loading branch information
1 parent
95c3988
commit f77fb4b
Showing
3 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<template> | ||
<svg role="img" width="30" height="30" viewBox="0 0 24 24"> | ||
<path :fill="color" d="M19 0h-14c-2.761 0-5 2.239-5 5v14c0 2.761 2.239 5 5 5h14c2.762 0 5-2.239 5-5v-14c0-2.761-2.238-5-5-5zm-11 19h-3v-11h3v11zm-1.5-12.268c-.966 0-1.75-.79-1.75-1.764s.784-1.764 1.75-1.764 1.75.79 1.75 1.764-.783 1.764-1.75 1.764zm13.5 12.268h-3v-5.604c0-3.368-4-3.113-4 0v5.604h-3v-11h3v1.765c1.396-2.586 7-2.777 7 2.476v6.759z"/> | ||
</svg> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
props: ['color'] | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<template> | ||
<a :href="linkedinLink" class="channel-link" target="_blank"> | ||
<span class="channel-icon Linkedin" aria-hidden="true"><Linkedin-icon color="#fff"></Linkedin-icon></span> | ||
<span class="visually-hidden">{{ $t('A11Y.SHARE_CHANNEL', { channel: 'Linkedin' }) }}</span> | ||
</a> | ||
</template> | ||
|
||
<script> | ||
import LinkedinIcon from 'icons/LinkedinIcon' | ||
import { addQueryParameter } from 'utils/url' | ||
const LINK = 'https://www.linkedin.com/shareArticle' | ||
export default { | ||
props: ['link', 'color', 'text'], | ||
computed: { | ||
linkedinLink () { | ||
return addQueryParameter(LINK, { url: this.link, mini: true, summary: this.text }) | ||
} | ||
}, | ||
components: { | ||
LinkedinIcon | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="scss"> | ||
$channel-color: #0077B5; | ||
.channel-icon.Linkedin { | ||
background-color: $channel-color; | ||
} | ||
</style> |