refactor(starter): upgrade and move to typescript

This commit is contained in:
Alexander Shelepenok
2022-04-16 14:25:55 +00:00
parent 67ebabbaac
commit 50a99f57f7
156 changed files with 5350 additions and 7173 deletions

View File

@@ -1,63 +1,5 @@
import { ICONS } from "../constants";
import { ICONS } from "@/constants";
const getIcon = (name: string) => {
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;
case "linkedin":
icon = ICONS.LINKEDIN;
break;
case "instagram":
icon = ICONS.INSTAGRAM;
break;
case "line":
icon = ICONS.LINE;
break;
case "facebook":
icon = ICONS.FACEBOOK;
break;
case "gitlab":
icon = ICONS.GITLAB;
break;
case "weibo":
icon = ICONS.WEIBO;
break;
case "codepen":
icon = ICONS.CODEPEN;
break;
case "youtube":
icon = ICONS.YOUTUBE;
break;
case "soundcloud":
icon = ICONS.SOUNDCLOUD;
break;
case "medium":
icon = ICONS.MEDIUM;
break;
default:
icon = {};
break;
}
return icon;
};
const getIcon = (name: keyof typeof ICONS) => ICONS[name] || {};
export default getIcon;