Skip to content

Commit

Permalink
feat: add new network linkedin, threads and viber
Browse files Browse the repository at this point in the history
  • Loading branch information
ntnyq committed Jan 5, 2025
1 parent 345770d commit 7fcd50c
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 24 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"dbaeumer",
"esbenp",
"goyfe",
"iconify",
"linkedin",
"ntnyq",
"pnpm",
Expand Down
10 changes: 1 addition & 9 deletions docs/.vuepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export default defineUserConfig({
'weibo',
'email',
'wechat',
'linkedin',
{
name: 'pinterest',
type: 'popup',
Expand All @@ -78,15 +79,6 @@ export default defineUserConfig({
sharer:
'https://pinterest.com/pin/create/button/?url=@url&media=@media&description=@title',
},
{
name: 'linkedin',
type: 'popup',
color: '#1786b1',
default: true,
sharer:
'https://www.linkedin.com/shareArticle?mini=true&url=@url&title=@title&summary=@description',
icon: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M910.336 0H113.664A114.005333 114.005333 0 0 0 0 113.664v796.672A114.005333 114.005333 0 0 0 113.664 1024h796.672A114.005333 114.005333 0 0 0 1024 910.336V113.664A114.005333 114.005333 0 0 0 910.336 0zM352.256 796.330667H207.189333V375.466667h145.066667z m-72.021333-477.866667a77.824 77.824 0 0 1-81.237334-74.069333A77.824 77.824 0 0 1 280.234667 170.666667a77.824 77.824 0 0 1 81.237333 73.728 77.824 77.824 0 0 1-81.237333 73.386666z m582.314666 477.866667H716.8v-227.669334c0-46.762667-18.432-93.525333-73.045333-93.525333a84.992 84.992 0 0 0-81.237334 94.549333v226.304h-140.629333V375.466667h141.653333v60.757333a155.989333 155.989333 0 0 1 136.533334-71.338667c60.416 0 163.498667 30.378667 163.498666 194.901334z" /></svg>',
},
],
twitterUser: 'ntnyq',
fallbackImage: '/hero.png',
Expand Down
6 changes: 3 additions & 3 deletions src/client/components/SocialShareNetwork.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useDarkmode } from '@vuepress/helper/client'
import { computed, defineComponent, h } from 'vue'
import { isString } from '../../shared/index.js'
import { isString, upperFirst } from '../../shared/index.js'
import { inBrowser, isSVG } from '../utils.js'
import type { PropType } from 'vue'
import type { SocialShareNetworkWithName } from '../../shared/index.js'
Expand Down Expand Up @@ -77,10 +77,10 @@ export const SocialShareNetwork = defineComponent({
'button',
{
class: 'social-share-btn',
title: props.network.name,
title: upperFirst(props.network.name),
type: 'button',
role: 'button',
'aria-label': props.network.name,
'aria-label': `Share with ${upperFirst(props.network.name)}`,
onClick: () => ctx.emit(Event.Share, props.network.name),
'data-link':
props.network.type === 'popup' ? `#share-${props.network.name}` : props.shareURL,
Expand Down
42 changes: 31 additions & 11 deletions src/shared/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const PLUGIN_NAME = 'vuepress-plugin-social-share'
// @keep-sorted
export const BUILT_IN_NETWORKS = {
bluesky: {
color: '#0057a8',
color: '#1185fe',
icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path d="M407.8 294.7c-3.3-.4-6.7-.8-10-1.3c3.4.4 6.7.9 10 1.3M288 227.1c-26.1-50.7-97.1-145.2-163.1-191.8C61.6-9.4 37.5-1.7 21.6 5.5C3.3 13.8 0 41.9 0 58.4S9.1 194 15 213.9c19.5 65.7 89.1 87.9 153.2 80.7c3.3-.5 6.6-.9 10-1.4c-3.3.5-6.6 1-10 1.4c-93.9 14-177.3 48.2-67.9 169.9C220.6 589.1 265.1 437.8 288 361.1c22.9 76.7 49.2 222.5 185.6 103.4c102.4-103.4 28.1-156-65.8-169.9c-3.3-.4-6.7-.8-10-1.3c3.4.4 6.7.9 10 1.3c64.1 7.1 133.6-15.1 153.2-80.7C566.9 194 576 75 576 58.4s-3.3-44.7-21.6-52.9c-15.8-7.1-40-14.9-103.2 29.8C385.1 81.9 314.1 176.4 288 227.1"/></svg>',
sharer: 'https://bsky.app/intent/compose?text=@title%20%0A@url',
type: 'popup',
Expand All @@ -24,16 +24,22 @@ export const BUILT_IN_NETWORKS = {
type: 'direct',
},
facebook: {
color: '#3b5998',
color: '#0866ff',
icon: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M960 113.4v797c0 27.4-22.2 49.4-49.4 49.4H682.2V613h116.4L816 477.8H682v-86.4c0-39.2 10.8-65.8 67-65.8h71.6v-121c-12.4-1.6-54.8-5.4-104.4-5.4-103.2 0-174 63-174 178.8v99.8H425.4V613h116.8v347H113.4C86.2 960 64 937.8 64 910.6V113.4C64 86.2 86.2 64 113.4 64h797c27.4 0 49.6 22.2 49.6 49.4z"/></svg>',
type: 'popup',
sharer:
'https://www.facebook.com/sharer/sharer.php?u=@url&title=@title&description=@description&quote=@quote&hashtag=@hashtags',
},
line: {
color: '#00b902',
color: '#06c655',
icon: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M806.6 426.53c13.95 0 25.2 11.4 25.2 25.23 0 13.8-11.25 25.2-25.2 25.2h-70.2v45h70.2a25.2 25.2 0 110 50.37h-95.43a25.23 25.23 0 01-25.08-25.17V356.33c0-13.8 11.28-25.2 25.2-25.2h95.43a25.23 25.23 0 01-.12 50.4h-70.2v45h70.2zM652.4 547.16a25.2 25.2 0 01-25.23 25.08 24.78 24.78 0 01-20.4-9.99l-97.71-132.69v117.6a25.2 25.2 0 01-25.23 25.17 25.2 25.2 0 01-25.05-25.17V356.33a25.05 25.05 0 0124.96-25.11c7.8 0 15 4.17 19.8 10.17l98.49 133.2V356.36c0-13.8 11.28-25.2 25.2-25.2 13.8 0 25.2 11.4 25.2 25.2v190.83zm-229.65 0a25.26 25.26 0 01-25.23 25.17 25.23 25.23 0 01-25.08-25.17V356.33c0-13.8 11.28-25.2 25.2-25.2 13.83 0 25.11 11.4 25.11 25.2v190.83zm-98.64 25.17h-95.43c-13.8 0-25.2-11.4-25.2-25.17V356.33c0-13.8 11.4-25.2 25.2-25.2 13.92 0 25.2 11.4 25.2 25.2v165.63h70.23a25.2 25.2 0 010 50.37zM992 444.56c0-214.83-215.4-389.67-480-389.67S32 229.73 32 444.56c0 192.45 170.79 353.67 401.4 384.33 15.63 3.27 36.93 10.32 42.33 23.61 4.8 12.03 3.15 30.63 1.53 43.2l-6.57 40.8c-1.8 12.03-9.6 47.43 41.97 25.8 51.63-21.57 276.63-163.11 377.43-279C959.06 607.73 992 530.33 992 444.59z"/></svg>',
sharer: 'https://line.me/R/msg/text/?@description%0D%0A@url',
sharer: 'https://social-plugins.line.me/lineit/share?url=@url&text=@title',
type: 'popup',
},
linkedin: {
color: '#0a66c2',
icon: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M910.336 0H113.664A114.005333 114.005333 0 0 0 0 113.664v796.672A114.005333 114.005333 0 0 0 113.664 1024h796.672A114.005333 114.005333 0 0 0 1024 910.336V113.664A114.005333 114.005333 0 0 0 910.336 0zM352.256 796.330667H207.189333V375.466667h145.066667z m-72.021333-477.866667a77.824 77.824 0 0 1-81.237334-74.069333A77.824 77.824 0 0 1 280.234667 170.666667a77.824 77.824 0 0 1 81.237333 73.728 77.824 77.824 0 0 1-81.237333 73.386666z m582.314666 477.866667H716.8v-227.669334c0-46.762667-18.432-93.525333-73.045333-93.525333a84.992 84.992 0 0 0-81.237334 94.549333v226.304h-140.629333V375.466667h141.653333v60.757333a155.989333 155.989333 0 0 1 136.533334-71.338667c60.416 0 163.498667 30.378667 163.498666 194.901334z" /></svg>',
sharer: 'https://www.linkedin.com/sharing/share-offsite/?url=@url',
type: 'popup',
},
qq: {
Expand All @@ -49,21 +55,28 @@ export const BUILT_IN_NETWORKS = {
type: 'qrcode',
},
reddit: {
color: '#ff4501',
color: '#ff4500',
icon: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M403 611c-27.6 0-49.8-22.2-49.8-49.2 0-27.6 22.2-49.8 49.8-49.8 27.2 0 49.2 22.2 49.2 49.8C452.2 589 430 611 403 611zm605-99c0 274-222 496-496 496S16 786 16 512 238 16 512 16s496 222 496 496zm-264.6-82.4c-18.8 0-35.4 7.8-47.6 20-44.8-31-105.2-51-172.2-53.2l34.8-156.6 110.8 25c0 27.2 22.2 49.2 49.2 49.2 27.6 0 49.8-22.6 49.8-49.8s-22.2-49.8-49.8-49.8c-19.4 0-36 11.6-44.2 27.6l-122.4-27.2c-6-1.6-12.2 2.8-13.8 8.8l-38.2 172.8c-66.4 2.8-126.2 22.6-171 53.6-12.2-12.8-29.4-20.4-48.2-20.4-69.8 0-92.6 93.8-28.8 125.6-2.2 10-3.4 20.4-3.4 31 0 105.2 118.4 190.4 264 190.4 146.2 0 264.6-85.2 264.6-190.4 0-10.6-1.2-21.6-3.8-31.6 62.6-32 39.6-125-29.8-125zM605.6 662c-36.4 36.4-152.2 35.8-187.2 0-4.4-4.4-12.2-4.4-16.6 0-5 5-5 12.8 0 17.2 45.6 45.6 174.6 45.6 220.4 0 5-4.4 5-12.2 0-17.2-4.4-4.4-12.2-4.4-16.6 0zM621 512c-27.2 0-49.2 22.2-49.2 49.8C571.8 589 594 611 621 611c27.6 0 49.8-22.2 49.8-49.2 0-27.6-22-49.8-49.8-49.8z"/></svg>',
sharer: 'https://www.reddit.com/submit?url=@url&title=@title',
type: 'popup',
},
skype: {
color: '#00aff0',
icon: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M743.386 607.455q0-28.57-11.143-52.282t-27.712-39.14-41.712-27.999-47.14-19.427-49.996-13.142l-59.425-13.713q-17.142-4-25.141-6t-19.999-6.571-17.142-9.142-9.428-12-4.285-17.141q0-43.998 82.28-43.998 24.57 0 43.997 6.857t30.856 16.285 21.712 19.141 22.856 16.57 27.427 6.858q26.855 0 43.14-18.285t16.285-43.997q0-31.427-31.998-56.854t-81.138-38.569-103.993-13.142q-38.855 0-75.424 8.857t-68.281 26.855-50.854 49.711-19.142 73.424q0 34.855 10.857 60.854t31.998 43.14 45.71 27.712 58.854 18.57l83.424 20.57q51.425 12.571 63.995 20.57 18.285 11.428 18.285 34.284 0 22.284-22.856 36.855t-59.996 14.57q-29.14 0-52.282-9.142t-37.14-21.998-25.999-25.713-26.284-21.999-30.855-9.142q-28.57 0-43.14 17.142t-14.57 42.854q0 52.568 69.709 89.994t166.275 37.427q41.712 0 79.995-10.571t69.995-30.57 50.569-53.425 18.856-75.138zM950.8 731.447q0 90.852-64.282 155.133t-155.133 64.282q-74.28 0-133.705-45.712-43.998 9.143-85.71 9.143-81.708 0-156.275-31.713t-128.563-85.708-85.709-128.564-31.712-156.275q0-41.712 9.142-85.709-45.711-59.425-45.711-133.706 0-90.851 64.281-155.133t155.133-64.281q74.281 0 133.706 45.711 43.997-9.142 85.709-9.142 81.709 0 156.276 31.712t128.563 85.709 85.709 128.563 31.712 156.276q0 41.711-9.142 85.709 45.71 59.424 45.71 133.705z"/></svg>',
sharer: 'https://web.skype.com/share?url=@description%0D%0A@url',
sharer: 'https://web.skype.com/share?url=@url&text=@title',
type: 'popup',
},
telegram: {
color: '#2fa8dc',
color: '#26a5e4',
icon: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M512 47C255.125 47 47 255.125 47 512s208.125 465 465 465 465-208.125 465-465S768.875 47 512 47zm228.375 318.563l-76.313 359.625c-5.625 25.5-20.812 31.687-42 19.687l-116.25-85.688-56.062 54c-6.188 6.188-11.438 11.438-23.438 11.438l8.25-118.313L650 411.688c9.375-8.25-2.063-12.937-14.438-4.687l-266.25 167.625-114.75-35.813c-24.937-7.875-25.5-24.937 5.25-36.937L708.125 329c20.813-7.5 39 5.063 32.25 36.563z"/></svg>',
sharer: 'https://t.me/share/url?url=@url&text=@description',
sharer: 'https://t.me/share/url?url=@url&text=@title',
type: 'popup',
},
threads: {
color: '#000000',
// iconify: ri:threads-fill
icon: '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M16.705 11.108c-.162-2.987-1.794-4.697-4.534-4.714c-1.652-.01-3.033.69-3.879 1.973L9.8 9.4c.634-.961 1.635-1.16 2.36-1.153c.903.006 1.583.268 2.024.78c.32.372.535.887.642 1.536q-1.202-.204-2.59-.125c-2.606.15-4.28 1.67-4.168 3.781c.057 1.071.59 1.993 1.502 2.595c.77.509 1.764.757 2.795.701c1.363-.075 2.432-.594 3.178-1.545c.566-.722.924-1.658 1.082-2.836c.65.392 1.13.907 1.397 1.527c.452 1.054.478 2.786-.935 4.198c-1.238 1.236-2.726 1.772-4.975 1.788c-2.495-.018-4.382-.819-5.608-2.378c-1.15-1.46-1.743-3.57-1.765-6.269c.022-2.7.616-4.809 1.765-6.27c1.226-1.559 3.113-2.359 5.608-2.377c2.513.019 4.432.822 5.706 2.39c.625.768 1.095 1.734 1.406 2.86l1.766-.47c-.377-1.387-.969-2.582-1.774-3.573c-1.633-2.01-4.033-3.039-7.11-3.06c-3.071.021-5.432 1.055-7.019 3.071c-1.411 1.795-2.14 4.306-2.164 7.436c.024 3.13.753 5.627 2.164 7.422c1.587 2.016 3.96 3.05 7.03 3.071c2.731-.019 4.655-.734 6.24-2.317c2.075-2.073 2.012-4.67 1.329-6.264c-.525-1.225-1.57-2.206-2.98-2.81m-4.438 4.557c-1.142.064-2.328-.448-2.387-1.546c-.043-.814.58-1.722 2.457-1.83a9.4 9.4 0 0 1 2.533.174c-.216 2.702-1.485 3.14-2.603 3.202"/></svg>',
sharer: 'https://www.threads.net/intent/post?url=@url&text=@title',
type: 'popup',
},
twitter: {
Expand All @@ -72,6 +85,13 @@ export const BUILT_IN_NETWORKS = {
sharer: 'https://twitter.com/intent/tweet?text=@title&url=@url&hashtags=@hashtags@twitteruser',
type: 'popup',
},
viber: {
color: '#7360f2',
// iconify: simple-icons:viber
icon: '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M11.4 0C9.473.028 5.333.344 3.02 2.467C1.302 4.187.696 6.7.633 9.817S.488 18.776 6.12 20.36h.003l-.004 2.416s-.037.977.61 1.177c.777.242 1.234-.5 1.98-1.302c.407-.44.972-1.084 1.397-1.58c3.85.326 6.812-.416 7.15-.525c.776-.252 5.176-.816 5.892-6.657c.74-6.02-.36-9.83-2.34-11.546c-.596-.55-3.006-2.3-8.375-2.323c0 0-.395-.025-1.037-.017zm.058 1.693c.545-.004.88.017.88.017c4.542.02 6.717 1.388 7.222 1.846c1.675 1.435 2.53 4.868 1.906 9.897v.002c-.604 4.878-4.174 5.184-4.832 5.395c-.28.09-2.882.737-6.153.524c0 0-2.436 2.94-3.197 3.704c-.12.12-.26.167-.352.144c-.13-.033-.166-.188-.165-.414l.02-4.018c-4.762-1.32-4.485-6.292-4.43-8.895c.054-2.604.543-4.738 1.996-6.173c1.96-1.773 5.474-2.018 7.11-2.03zm.38 2.602a.304.304 0 0 0-.004.607c1.624.01 2.946.537 4.028 1.592c1.073 1.046 1.62 2.468 1.633 4.334c.002.167.14.3.307.3a.304.304 0 0 0 .3-.304c-.014-1.984-.618-3.596-1.816-4.764c-1.19-1.16-2.692-1.753-4.447-1.765zm-3.96.695a.98.98 0 0 0-.616.117l-.01.002c-.43.247-.816.562-1.146.932l-.008.008q-.4.484-.46.948a.6.6 0 0 0-.007.14q0 .205.065.4l.013.01c.135.48.473 1.276 1.205 2.604c.42.768.903 1.5 1.446 2.186q.405.517.87.984l.132.132q.466.463.984.87a15.5 15.5 0 0 0 2.186 1.447c1.328.733 2.126 1.07 2.604 1.206l.01.014a1.3 1.3 0 0 0 .54.055q.466-.055.948-.46c.004 0 .003-.002.008-.005c.37-.33.683-.72.93-1.148l.003-.01c.225-.432.15-.842-.18-1.12c-.004 0-.698-.58-1.037-.83q-.54-.383-1.113-.71c-.51-.285-1.032-.106-1.248.174l-.447.564c-.23.283-.657.246-.657.246c-3.12-.796-3.955-3.955-3.955-3.955s-.037-.426.248-.656l.563-.448c.277-.215.456-.737.17-1.248a13 13 0 0 0-.71-1.115a28 28 0 0 0-.83-1.035a.82.82 0 0 0-.502-.297zm4.49.88a.303.303 0 0 0-.018.606c1.16.085 2.017.466 2.645 1.15c.63.688.93 1.524.906 2.57a.306.306 0 0 0 .61.013c.025-1.175-.334-2.193-1.067-2.994c-.74-.81-1.777-1.253-3.05-1.346h-.024zm.463 1.63a.305.305 0 0 0-.3.287c-.008.167.12.31.288.32c.523.028.875.175 1.113.422c.24.245.388.62.416 1.164a.304.304 0 0 0 .605-.03c-.03-.644-.215-1.178-.58-1.557c-.367-.378-.893-.574-1.52-.607h-.018z"/></svg>',
sharer: 'viber://forward?text=@url%20@title',
type: 'popup',
},
wechat: {
color: '#1aad19',
icon: '<svg viewBox="0 0 1170 1024" xmlns="http://www.w3.org/2000/svg"><path d="M331.429 263.429q0-23.429-14.286-37.715t-37.714-14.285q-24.572 0-43.429 14.571t-18.857 37.429q0 22.285 18.857 36.857t43.429 14.571q23.428 0 37.714-14t14.286-37.428zM756 553.143q0-16-14.571-28.572T704 512q-15.429 0-28.286 12.857t-12.857 28.286q0 16 12.857 28.857T704 594.857q22.857 0 37.429-12.571T756 553.143zM621.143 263.429q0-23.429-14-37.715t-37.429-14.285q-24.571 0-43.428 14.571t-18.857 37.429q0 22.285 18.857 36.857t43.428 14.571q23.429 0 37.429-14t14-37.428zM984 553.143q0-16-14.857-28.572T932 512q-15.429 0-28.286 12.857t-12.857 28.286q0 16 12.857 28.857T932 594.857q22.286 0 37.143-12.571T984 553.143zM832 326.286Q814.286 324 792 324q-96.571 0-177.714 44T486.57 487.143 440 651.429q0 44.571 13.143 86.857-20 1.714-38.857 1.714-14.857 0-28.572-0.857t-31.428-3.714-25.429-4-31.143-6-28.571-6L124.57 792l41.143-124.571Q0 551.429 0 387.429q0-96.572 55.714-177.715T206.571 82t207.715-46.571q100.571 0 190 37.714T754 177.429t78 148.857z m338.286 320.571q0 66.857-39.143 127.714t-106 110.572l31.428 103.428-113.714-62.285q-85.714 21.143-124.571 21.143-96.572 0-177.715-40.286T512.857 797.714t-46.571-150.857T512.857 496t127.714-109.429 177.715-40.285q92 0 173.143 40.285t130 109.715 48.857 150.571z"></path></svg>',
Expand All @@ -84,14 +104,14 @@ export const BUILT_IN_NETWORKS = {
type: 'popup',
},
whatsapp: {
color: '#1bb1a5',
color: '#25d366',
icon: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M67.68 966.592c17.056-48.096 29.472-94.656 48.096-139.648 9.312-23.264 7.744-41.888-7.744-63.616-57.408-86.88-79.136-183.072-71.36-287.04C52.192 263.744 205.792 88.416 409.024 44.96c259.104-55.84 512 103.936 569.408 363.04 57.408 260.64-108.608 507.36-352.192 566.304-128.768 31.04-249.792 10.848-363.04-57.408-10.848-6.208-20.16-6.208-31.04-3.104-49.632 17.056-99.296 32.576-148.96 48.096-4.64 1.568-7.744 1.568-15.52 4.64zm153.6-594.24c1.536 15.52 3.104 31.04 7.744 46.56 9.312 43.456 34.144 80.672 55.84 117.92C364 664.064 472.608 750.944 616.896 794.4c52.736 15.52 99.296 7.744 145.856-21.728 37.248-23.264 48.096-58.944 49.664-99.296 0-6.208-4.64-17.056-9.312-20.16-40.352-21.728-82.24-43.456-122.56-65.152-12.416-6.208-23.264-3.104-32.576 7.744-15.52 17.056-31.04 35.68-44.992 52.736-7.744 10.848-18.624 10.848-29.472 6.208-85.344-37.248-148.96-97.76-192.384-178.432-6.208-12.416-4.64-21.728 4.64-31.04 12.416-13.952 24.832-27.936 35.68-43.456 4.64-7.744 7.744-21.728 4.64-29.472-13.952-41.888-31.04-83.776-46.56-124.128a26.784 26.784 0 00-18.624-15.52c-10.848-3.104-23.264-3.104-34.144-3.104-17.056-1.536-32.576 4.64-44.992 15.52-38.784 32.576-58.944 74.464-60.512 127.232z"/></svg>',
sharer: 'https://api.whatsapp.com/send?text=@description%0D%0A@url',
sharer: 'https://api.whatsapp.com/send?text=@title%0D%0A@url',
type: 'popup',
},
x: {
icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M389.2 48h70.6L305.6 224.2L487 464H345L233.7 318.6L106.5 464H35.8l164.9-188.5L26.8 48h145.6l100.5 132.9zm-24.8 373.8h39.1L151.1 88h-42z"/></svg>',
sharer: 'https://x.com/intent/tweet?text=@title&url=@url&hashtags=@hashtags@twitteruser',
sharer: 'https://x.com/intent/post?text=@title&url=@url&hashtags=@hashtags@twitteruser',
type: 'popup',
color: {
dark: '#fff',
Expand Down
11 changes: 10 additions & 1 deletion src/shared/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
* @param value - value to be checked
* @returns `true` if given a string
*/
export const isString = (value: unknown): value is string => {
export function isString(value: unknown): value is string {
return typeof value === 'string'
}

/**
* Upper the first letter of given string
* @param value - string to be change
* @returns changed string
*/
export function upperFirst(value: string) {
return value.charAt(0).toUpperCase() + value.slice(1)
}

0 comments on commit 7fcd50c

Please sign in to comment.