mirror of
https://github.com/mastermindzh/rickvanlieshout.com
synced 2025-04-04 14:32:27 +02:00
30 lines
588 B
JavaScript
30 lines
588 B
JavaScript
// @flow strict
|
|
const getContactHref = (name: string, contact: string) => {
|
|
let href;
|
|
|
|
switch (name) {
|
|
case 'twitter':
|
|
href = `https://www.twitter.com/${contact}`;
|
|
break;
|
|
case 'github':
|
|
href = `https://github.com/${contact}`;
|
|
break;
|
|
case 'vkontakte':
|
|
href = `https://vk.com/${contact}`;
|
|
break;
|
|
case 'telegram':
|
|
href = `https://t.me/${contact}`;
|
|
break;
|
|
case 'email':
|
|
href = `mailto:${contact}`;
|
|
break;
|
|
default:
|
|
href = contact;
|
|
break;
|
|
}
|
|
|
|
return href;
|
|
};
|
|
|
|
export default getContactHref;
|