Upgrade to Gatsby v2

This commit is contained in:
alxshelepenok
2018-11-09 20:08:48 +03:00
parent e83dfc6dff
commit 8b92891329
204 changed files with 18708 additions and 3904 deletions

View File

@@ -0,0 +1,28 @@
const getContactHref = (name, contact) => {
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 = `telegram:${contact}`;
break;
case 'email':
href = `mailto:${contact}`;
break;
default:
href = contact;
break;
}
return href;
};
export default getContactHref;

33
src/utils/get-icon.js Normal file
View File

@@ -0,0 +1,33 @@
import { ICONS } from '../constants';
const getIcon = (name) => {
let icon;
switch (name) {
case 'twitter':
icon = ICONS.TWITTER;
break;
case 'github':
icon = ICONS.GITHUB;
break;
case 'vkontakte':
icon = ICONS.VKONTAKTE;
break;
case 'telegram':
icon = ICONS.TELEGRAM;
break;
case 'email':
icon = ICONS.EMAIL;
break;
case 'rss':
icon = ICONS.RSS;
break;
default:
icon = {};
break;
}
return icon;
};
export default getIcon;

2
src/utils/index.js Normal file
View File

@@ -0,0 +1,2 @@
export { default as getIcon } from './get-icon';
export { default as getContactHref } from './get-contact-href';