mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-25 22:37:18 +10:00
IconCheckmark: big and small versions
This commit is contained in:
parent
c1bfed5e7d
commit
89e7846519
1 changed files with 26 additions and 6 deletions
|
|
@ -4,19 +4,38 @@ import classNames from 'classnames';
|
|||
|
||||
import css from './IconCheckMark.css';
|
||||
|
||||
const SIZE_SMALL = 'small';
|
||||
const SIZE_BIG = 'big';
|
||||
|
||||
const IconCheckmark = props => {
|
||||
const { rootClassName, className } = props;
|
||||
const { rootClassName, className, size } = props;
|
||||
const classes = classNames(rootClassName || css.root, className);
|
||||
return (
|
||||
<svg className={classes} strokeWidth="2" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M22.6 1.2c-.4-.3-1-.2-1.3.2L7.8 19l-5.2-5c-.4-.4-1-.4-1.3 0-.4.3-.4.8 0 1l6 5.6.6.2s.2 0 .4-.4l14.3-18c.3-.5.2-1-.2-1" />
|
||||
</svg>
|
||||
);
|
||||
if (size === SIZE_SMALL) {
|
||||
return (
|
||||
<svg className={classes} width="16" height="12" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M14 2l-8 8-4-4"
|
||||
strokeWidth="2.5"
|
||||
fill="none"
|
||||
fillRule="evenodd"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
/>
|
||||
</svg>
|
||||
);
|
||||
} else if (size === SIZE_BIG) {
|
||||
return (
|
||||
<svg className={classes} strokeWidth="2" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M22.6 1.2c-.4-.3-1-.2-1.3.2L7.8 19l-5.2-5c-.4-.4-1-.4-1.3 0-.4.3-.4.8 0 1l6 5.6.6.2s.2 0 .4-.4l14.3-18c.3-.5.2-1-.2-1" />
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
IconCheckmark.defaultProps = {
|
||||
rootClassName: null,
|
||||
className: null,
|
||||
size: 'big',
|
||||
};
|
||||
|
||||
const { string } = PropTypes;
|
||||
|
|
@ -24,6 +43,7 @@ const { string } = PropTypes;
|
|||
IconCheckmark.propTypes = {
|
||||
rootClassName: string,
|
||||
className: string,
|
||||
size: string,
|
||||
};
|
||||
|
||||
export default IconCheckmark;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue