UNPKG

react-toolbox-build4server

Version:

Builds react-toolbox in such a way that it's components can be required and used in node - most likely for server-side rendered webapps - without having to depend on webpack to build your entire server-side project

31 lines (26 loc) 631 B
import React from 'react'; 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> ); }; FontIcon.propTypes = { children: React.PropTypes.any, className: React.PropTypes.string, value: React.PropTypes.oneOfType([ React.PropTypes.string, React.PropTypes.element ]) }; FontIcon.defaultProps = { className: '' }; export default FontIcon;