Simpler FontIcon component
parent
cd83d8341f
commit
3ba5c110fb
|
@ -1,18 +1,16 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ClassNames from 'classnames';
|
import classnames from 'classnames';
|
||||||
|
|
||||||
const FontIcon = ({ children, className, value, ...other}) => {
|
const FontIcon = ({ children, className, value, ...other}) => (
|
||||||
const classes = ClassNames(
|
<span
|
||||||
{'material-icons': typeof value === 'string'},
|
data-react-toolbox='font-icon'
|
||||||
className
|
className={classnames({'material-icons': typeof value === 'string'}, className)}
|
||||||
);
|
{...other}
|
||||||
return (
|
>
|
||||||
<span className={classes} {...other} data-react-toolbox='font-icon'>
|
|
||||||
{value}
|
{value}
|
||||||
{children}
|
{children}
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
};
|
|
||||||
|
|
||||||
FontIcon.propTypes = {
|
FontIcon.propTypes = {
|
||||||
children: React.PropTypes.any,
|
children: React.PropTypes.any,
|
||||||
|
|
Loading…
Reference in New Issue