2020-08-17 21:07:16 +01:00
|
|
|
import React from 'react'
|
2020-08-17 21:59:29 +01:00
|
|
|
import PropTypes from 'prop-types'
|
2020-08-17 17:40:39 +01:00
|
|
|
import { CX } from '../constants'
|
2020-02-25 16:04:44 +00:00
|
|
|
|
2020-08-19 01:39:27 +01:00
|
|
|
import Logo from './logo'
|
|
|
|
import Loading from './loading'
|
|
|
|
import VerifiedIcon from './verified_icon'
|
|
|
|
|
2020-08-18 01:57:35 +01:00
|
|
|
class Icon extends React.PureComponent {
|
2020-02-25 16:04:44 +00:00
|
|
|
|
|
|
|
render() {
|
2020-08-17 17:40:39 +01:00
|
|
|
const {
|
|
|
|
className,
|
|
|
|
id,
|
|
|
|
size,
|
|
|
|
} = this.props
|
|
|
|
|
2020-08-19 01:39:27 +01:00
|
|
|
if (id === 'logo') return <Logo className={className} />
|
|
|
|
else if (id === 'loading') return <Loading size={size} className={className} />
|
2020-08-19 17:37:46 +01:00
|
|
|
else if (id === 'verified') return <VerifiedIcon size={size} className={className} />
|
2020-08-19 01:39:27 +01:00
|
|
|
|
2020-08-17 17:40:39 +01:00
|
|
|
const additionalClasses = {}
|
|
|
|
additionalClasses.gfi = 1
|
|
|
|
additionalClasses[`gfi-${id}`] = 1
|
|
|
|
|
|
|
|
const classes = CX(className, additionalClasses)
|
|
|
|
|
|
|
|
return <i style={{ fontSize: size }} className={classes} />
|
2020-02-25 16:04:44 +00:00
|
|
|
|
|
|
|
}
|
2020-04-08 02:06:59 +01:00
|
|
|
|
2020-02-25 16:04:44 +00:00
|
|
|
}
|
2020-08-18 01:57:35 +01:00
|
|
|
|
|
|
|
Icon.propTypes = {
|
|
|
|
className: PropTypes.string,
|
|
|
|
id: PropTypes.string.isRequired,
|
|
|
|
size: PropTypes.string,
|
|
|
|
}
|
|
|
|
|
|
|
|
export default Icon
|