From 5a6a7ae53bd5d061eb4eb7b9d3e8b032cff827f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=CC=81rgio=20Ramos?= Date: Fri, 9 Dec 2016 10:18:04 +0000 Subject: [PATCH] convert Icon --- ui/src/components/button-icon/index.js | 10 +++++----- ui/src/components/icon/index.js | 24 +++++++++++++----------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/ui/src/components/button-icon/index.js b/ui/src/components/button-icon/index.js index 87e9982f..37dce81b 100644 --- a/ui/src/components/button-icon/index.js +++ b/ui/src/components/button-icon/index.js @@ -1,3 +1,5 @@ +// TODO this should inherit + const Button = require('../button'); const React = require('react'); const Styled = require('styled-components'); @@ -21,11 +23,9 @@ const ButtonIcon = ({ const Component = styled(Icon)(styles); return ( -
- -
+ ); }; diff --git a/ui/src/components/icon/index.js b/ui/src/components/icon/index.js index ec30f1d4..5217e27b 100644 --- a/ui/src/components/icon/index.js +++ b/ui/src/components/icon/index.js @@ -1,6 +1,14 @@ const React = require('react'); -const classNames = require('classnames'); -const styles = require('./style.css'); +const Styled = require('styled-components'); + +const { + default: styled, + css +} = Styled; + +const styles = css` + font-size: inherit; +`; const Icon = ({ name = 'beer', @@ -8,17 +16,11 @@ const Icon = ({ iconSet = 'fa', style }) => { - const Component = require(`react-icons/lib/${iconSet}/${name}`); - - const cn = classNames( - className, - styles.icon - ); + const Icon = require(`react-icons/lib/${iconSet}/${name}`); + const Component = styled(Icon)(styles); return ( -
- -
+ ); };