You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
760 B
46 lines
760 B
7 years ago
|
import PropTypes from 'prop-types';
|
||
|
import React from 'react';
|
||
|
import { kinds } from 'Helpers/Props';
|
||
|
import classNames from 'classnames';
|
||
|
import styles from './Icon.css';
|
||
|
|
||
|
function Icon(props) {
|
||
|
const {
|
||
|
className,
|
||
|
name,
|
||
|
kind,
|
||
|
size,
|
||
|
title
|
||
|
} = props;
|
||
|
|
||
|
return (
|
||
|
<icon
|
||
|
className={classNames(
|
||
|
name,
|
||
|
className,
|
||
|
styles[kind]
|
||
|
)}
|
||
|
title={title}
|
||
|
style={{
|
||
|
fontSize: `${size}px`
|
||
|
}}
|
||
|
>
|
||
|
</icon>
|
||
|
);
|
||
|
}
|
||
|
|
||
|
Icon.propTypes = {
|
||
|
className: PropTypes.string,
|
||
|
name: PropTypes.string.isRequired,
|
||
|
kind: PropTypes.string.isRequired,
|
||
|
size: PropTypes.number.isRequired,
|
||
|
title: PropTypes.string
|
||
|
};
|
||
|
|
||
|
Icon.defaultProps = {
|
||
|
kind: kinds.DEFAULT,
|
||
|
size: 14
|
||
|
};
|
||
|
|
||
|
export default Icon;
|