mirror of
https://github.com/kremalicious/portfolio.git
synced 2024-06-15 17:03:26 +02:00
75 lines
1.1 KiB
JavaScript
75 lines
1.1 KiB
JavaScript
import React, { memo } from 'react'
|
|
import PropTypes from 'prop-types'
|
|
|
|
// https://featherstyles.com
|
|
// import * as Feather from 'react-feather'
|
|
import {
|
|
ArrowDownCircle,
|
|
Edit,
|
|
GitHub,
|
|
Twitter,
|
|
Rss,
|
|
Sun,
|
|
Moon,
|
|
Compass,
|
|
FileText,
|
|
Key,
|
|
Image,
|
|
Mail,
|
|
MapPin,
|
|
Globe,
|
|
Briefcase,
|
|
Award,
|
|
BookOpen,
|
|
Star,
|
|
Info,
|
|
Dribbble
|
|
} from 'react-feather'
|
|
import { icon } from './Icon.module.css'
|
|
|
|
const Icon = memo(({ name, ...props }) => {
|
|
const components = {
|
|
Dribbble,
|
|
Email: Mail,
|
|
Link: Compass,
|
|
Download: ArrowDownCircle,
|
|
'Info & Download': ArrowDownCircle,
|
|
Styleguide: FileText,
|
|
Blog: Edit,
|
|
Keybase: Key,
|
|
ArrowDownCircle,
|
|
Edit,
|
|
GitHub,
|
|
Twitter,
|
|
Rss,
|
|
Sun,
|
|
Moon,
|
|
Compass,
|
|
FileText,
|
|
Key,
|
|
Image,
|
|
Mail,
|
|
MapPin,
|
|
Globe,
|
|
Briefcase,
|
|
Award,
|
|
BookOpen,
|
|
Star,
|
|
Info
|
|
}
|
|
|
|
const IconMapped = components[name]
|
|
// const IconComp = Feather[name]
|
|
if (!IconMapped) return null
|
|
|
|
return <IconMapped className={icon} {...props} />
|
|
})
|
|
|
|
Icon.displayName = 'Icon'
|
|
|
|
Icon.propTypes = {
|
|
name: PropTypes.string.isRequired
|
|
}
|
|
|
|
export default Icon
|