2020-08-17 15:07:16 -05:00
|
|
|
import React from 'react'
|
2020-08-17 15:59:29 -05:00
|
|
|
import PropTypes from 'prop-types'
|
2020-08-17 11:40:39 -05:00
|
|
|
import { CX } from '../constants'
|
2020-08-18 19:39:27 -05:00
|
|
|
import Logo from './logo'
|
|
|
|
import Loading from './loading'
|
|
|
|
import VerifiedIcon from './verified_icon'
|
|
|
|
|
2020-08-17 19:57:35 -05:00
|
|
|
class Icon extends React.PureComponent {
|
2020-02-25 11:04:44 -05:00
|
|
|
|
|
|
|
render() {
|
2020-08-17 11:40:39 -05:00
|
|
|
const {
|
|
|
|
className,
|
|
|
|
id,
|
|
|
|
size,
|
2020-11-03 15:04:31 -06:00
|
|
|
minimizeLogo,
|
2020-08-17 11:40:39 -05:00
|
|
|
} = this.props
|
|
|
|
|
2020-11-03 15:04:31 -06:00
|
|
|
if (id === 'logo') {
|
|
|
|
if (minimizeLogo) {
|
|
|
|
return (
|
|
|
|
<div className={[_s.d, _s.px5, _s.py5, _s.circle, _s.bgNavigationBlendLight].join(' ')}>
|
|
|
|
<i className={[_s.gfi, _s['gfi-gab-g'], _s.px5, _s.py5, _s.fillNavigationBrand].join(' ')} style={{fontSize: '22px'}} />
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
return <Logo className={className} />
|
|
|
|
}
|
2020-08-18 19:39:27 -05:00
|
|
|
else if (id === 'loading') return <Loading size={size} className={className} />
|
2020-08-19 11:37:46 -05:00
|
|
|
else if (id === 'verified') return <VerifiedIcon size={size} className={className} />
|
2020-08-18 19:39:27 -05:00
|
|
|
|
2020-08-17 11:40:39 -05: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 11:04:44 -05:00
|
|
|
|
|
|
|
}
|
2020-04-07 21:06:59 -04:00
|
|
|
|
2020-02-25 11:04:44 -05:00
|
|
|
}
|
2020-08-17 19:57:35 -05:00
|
|
|
|
|
|
|
Icon.propTypes = {
|
|
|
|
className: PropTypes.string,
|
|
|
|
id: PropTypes.string.isRequired,
|
|
|
|
size: PropTypes.string,
|
2020-11-03 15:04:31 -06:00
|
|
|
minimizeLogo: PropTypes.bool,
|
2020-08-17 19:57:35 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
export default Icon
|