mirror of
https://github.com/yldio/copilot.git
synced 2024-11-14 07:10:05 +02:00
convert Icon
This commit is contained in:
parent
fa376612aa
commit
5a6a7ae53b
@ -1,3 +1,5 @@
|
|||||||
|
// TODO this should inherit <Icon />
|
||||||
|
|
||||||
const Button = require('../button');
|
const Button = require('../button');
|
||||||
const React = require('react');
|
const React = require('react');
|
||||||
const Styled = require('styled-components');
|
const Styled = require('styled-components');
|
||||||
@ -21,11 +23,9 @@ const ButtonIcon = ({
|
|||||||
const Component = styled(Icon)(styles);
|
const Component = styled(Icon)(styles);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
|
||||||
<Button>
|
<Button>
|
||||||
<Component className={className} style={style} />
|
<Component className={className} style={style} />
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,6 +1,14 @@
|
|||||||
const React = require('react');
|
const React = require('react');
|
||||||
const classNames = require('classnames');
|
const Styled = require('styled-components');
|
||||||
const styles = require('./style.css');
|
|
||||||
|
const {
|
||||||
|
default: styled,
|
||||||
|
css
|
||||||
|
} = Styled;
|
||||||
|
|
||||||
|
const styles = css`
|
||||||
|
font-size: inherit;
|
||||||
|
`;
|
||||||
|
|
||||||
const Icon = ({
|
const Icon = ({
|
||||||
name = 'beer',
|
name = 'beer',
|
||||||
@ -8,17 +16,11 @@ const Icon = ({
|
|||||||
iconSet = 'fa',
|
iconSet = 'fa',
|
||||||
style
|
style
|
||||||
}) => {
|
}) => {
|
||||||
const Component = require(`react-icons/lib/${iconSet}/${name}`);
|
const Icon = require(`react-icons/lib/${iconSet}/${name}`);
|
||||||
|
const Component = styled(Icon)(styles);
|
||||||
const cn = classNames(
|
|
||||||
className,
|
|
||||||
styles.icon
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={cn}>
|
<Component className={className} style={style} />
|
||||||
<Component style={style} />
|
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user