Simpler FontIcon component

old
Javi Velasco 2016-05-16 14:18:53 +02:00
parent cd83d8341f
commit 3ba5c110fb
1 changed files with 11 additions and 13 deletions

View File

@ -1,18 +1,16 @@
import React from 'react';
import ClassNames from 'classnames';
import classnames from 'classnames';
const FontIcon = ({ children, className, value, ...other}) => {
const classes = ClassNames(
{'material-icons': typeof value === 'string'},
className
);
return (
<span className={classes} {...other} data-react-toolbox='font-icon'>
{value}
{children}
</span>
);
};
const FontIcon = ({ children, className, value, ...other}) => (
<span
data-react-toolbox='font-icon'
className={classnames({'material-icons': typeof value === 'string'}, className)}
{...other}
>
{value}
{children}
</span>
);
FontIcon.propTypes = {
children: React.PropTypes.any,