diff options
author | Nick Van Doorn <vandoorn.nick@gmail.com> | 2019-04-05 15:47:00 -0700 |
---|---|---|
committer | Nick Van Doorn <vandoorn.nick@gmail.com> | 2019-04-05 15:47:00 -0700 |
commit | 8ec5b7a35e0e52e492148bd490c53586be9879fa (patch) | |
tree | cb1e738f119f36d0dc32c99128b29bd2cc4a1cdb /src/components/font-awesome.js | |
parent | 4827771b0a45b8c66d30f73e4e5d6fd59baa4251 (diff) |
Use provided theme
Diffstat (limited to 'src/components/font-awesome.js')
-rw-r--r-- | src/components/font-awesome.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/components/font-awesome.js b/src/components/font-awesome.js index b8aec1e..db14a8b 100644 --- a/src/components/font-awesome.js +++ b/src/components/font-awesome.js @@ -3,19 +3,19 @@ import { css } from '@emotion/core' const DEFAULT_SIZE = '20px' -export const FontAwesome = ({ icon: outerIcon, size, fill, cssProp }) => { - const svgStyle = css` +export const FontAwesome = p => { + const { icon: outerIcon, size, fill, cssProp } = p + const svgStyle = t => css` width: ${size || DEFAULT_SIZE}; height: ${size || DEFAULT_SIZE}; - ${fill - ? `& path { - fill: ${fill}; - }` - : ''} + & path { + fill: ${fill || t.colours.main}; + } + ${typeof cssProp === 'function' ? cssProp(t) : cssProp} ` const { icon, iconName } = outerIcon return ( - <svg css={[svgStyle, cssProp]} viewBox={`0 0 ${icon[1]} ${icon[1]}`}> + <svg css={svgStyle} viewBox={`0 0 ${icon[1]} ${icon[1]}`}> <path d={icon[4]} /> <desc>{iconName}</desc> </svg> |