Last active
August 10, 2022 03:00
-
-
Save davidgilbertson/efd688929a0b07945f9b3b7c835bcb0e to your computer and use it in GitHub Desktop.
Production version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
const {PropTypes} = React; | |
const Icon = props => { | |
const styles = { | |
svg: { | |
display: 'inline-block', | |
verticalAlign: 'middle', | |
}, | |
path: { | |
fill: props.color, | |
}, | |
}; | |
return ( | |
<svg | |
style={styles.svg} | |
width={`${props.size}px`} | |
height={`${props.size}px`} | |
viewBox="0 0 1024 1024" | |
> | |
<path | |
style={styles.path} | |
d={props.icon} | |
></path> | |
</svg> | |
); | |
}; | |
Icon.propTypes = { | |
icon: PropTypes.string.isRequired, | |
size: PropTypes.number, | |
color: PropTypes.string, | |
}; | |
Icon.defaultProps = { | |
size: 16, | |
}; | |
export default Icon; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment