rickvanlieshout.com/src/utils/get-icon.js

65 lines
1.1 KiB
JavaScript
Raw Normal View History

2019-08-01 04:05:23 +02:00
// @flow strict
2020-05-08 18:07:57 +02:00
import { ICONS } from '../constants'
2018-11-09 18:08:48 +01:00
const getIcon = (name: string) => {
2020-05-08 18:07:57 +02:00
let icon
2018-11-09 18:08:48 +01:00
switch (name) {
2020-05-08 18:07:57 +02:00
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
2018-11-09 18:08:48 +01:00
default:
2020-05-08 18:07:57 +02:00
icon = {}
break
2018-11-09 18:08:48 +01:00
}
2020-05-08 18:07:57 +02:00
return icon
}
2018-11-09 18:08:48 +01:00
2020-05-08 18:07:57 +02:00
export default getIcon