mirror of
https://github.com/mastermindzh/rickvanlieshout.com
synced 2025-10-14 17:35:53 +02:00
refactor(starter): upgrade to new version of gatsby
This commit is contained in:
23
src/utils/get-contact-href.ts
Normal file
23
src/utils/get-contact-href.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
const getContactHref = (name: string, contact: string) => {
|
||||
const hrefs: { [key: string]: string } = {
|
||||
email: `mailto:${contact}`,
|
||||
line: `line://ti/p/${contact}`,
|
||||
telegram: `https://t.me/${contact}`,
|
||||
vkontakte: `https://vk.com/${contact}`,
|
||||
medium: `https://medium.com/${contact}`,
|
||||
github: `https://github.com/${contact}`,
|
||||
weibo: `https://www.weibo.com/${contact}`,
|
||||
gitlab: `https://www.gitlab.com/${contact}`,
|
||||
codepen: `https://www.codepen.io/${contact}`,
|
||||
twitter: `https://www.twitter.com/${contact}`,
|
||||
soundcloud: `https://soundcloud.com/${contact}`,
|
||||
facebook: `https://www.facebook.com/${contact}`,
|
||||
instagram: `https://www.instagram.com/${contact}`,
|
||||
linkedin: `https://www.linkedin.com/in/${contact}`,
|
||||
youtube: `https://www.youtube.com/channel/${contact}`,
|
||||
};
|
||||
|
||||
return hrefs[name] ?? contact;
|
||||
};
|
||||
|
||||
export default getContactHref;
|
Reference in New Issue
Block a user