2017-04-17 17:14:17 +03:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
2016-05-16 15:18:53 +03:00
|
|
|
import classnames from 'classnames';
|
2015-11-23 01:41:00 +03:00
|
|
|
|
2017-01-24 13:12:40 +03:00
|
|
|
const FontIcon = ({ alt, children, className, theme, value, ...other}) => ( // eslint-disable-line
|
2016-05-16 15:18:53 +03:00
|
|
|
<span
|
2017-01-26 20:05:32 +03:00
|
|
|
data-react-toolbox="font-icon"
|
2017-01-11 21:51:02 +03:00
|
|
|
aria-label={alt}
|
2017-01-26 20:05:32 +03:00
|
|
|
className={classnames({ 'material-icons': typeof value === 'string' || typeof children === 'string' }, className)}
|
2016-05-16 15:18:53 +03:00
|
|
|
{...other}
|
|
|
|
>
|
2017-03-23 13:06:29 +03:00
|
|
|
{value}
|
2017-01-24 13:07:43 +03:00
|
|
|
{children}
|
2016-05-16 15:18:53 +03:00
|
|
|
</span>
|
|
|
|
);
|
2015-09-19 18:53:31 +03:00
|
|
|
|
2015-10-20 08:40:51 +03:00
|
|
|
FontIcon.propTypes = {
|
2017-01-11 21:51:02 +03:00
|
|
|
alt: PropTypes.string,
|
2017-01-26 20:05:32 +03:00
|
|
|
children: PropTypes.node,
|
2016-05-29 13:47:27 +03:00
|
|
|
className: PropTypes.string,
|
2017-01-26 20:05:32 +03:00
|
|
|
theme: PropTypes.object, // eslint-disable-line
|
2016-05-29 13:47:27 +03:00
|
|
|
value: PropTypes.oneOfType([
|
|
|
|
PropTypes.string,
|
2017-01-26 20:05:32 +03:00
|
|
|
PropTypes.element,
|
|
|
|
]),
|
2015-10-20 08:40:51 +03:00
|
|
|
};
|
2015-09-19 18:53:31 +03:00
|
|
|
|
2015-10-20 08:40:51 +03:00
|
|
|
FontIcon.defaultProps = {
|
2017-01-11 21:51:02 +03:00
|
|
|
alt: '',
|
2017-01-26 20:05:32 +03:00
|
|
|
className: '',
|
2015-10-20 08:40:51 +03:00
|
|
|
};
|
2015-09-19 18:53:31 +03:00
|
|
|
|
2015-10-20 08:40:51 +03:00
|
|
|
export default FontIcon;
|
2016-05-29 20:38:06 +03:00
|
|
|
export { FontIcon };
|