All files / components/Icon/SuccessIcon SuccessIcon.jsx

100% Statements 4/4
100% Branches 0/0
100% Functions 0/0
100% Lines 4/4
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43            120x               120x                     8x   8x                              
import _ from 'lodash';
import React from 'react';
import Icon from '../Icon';
import { lucidClassNames } from '../../../util/style-helpers';
import { createClass, omitProps } from '../../../util/component-types';
 
const cx = lucidClassNames.bind('&-SuccessIcon');
 
/**
 *
 * {"categories": ["visual design", "icons"], "extend": "CheckIcon", "madeFrom": ["CheckIcon"]}
 *
 * A success icon.
 */
const SuccessIcon = createClass({
	displayName: 'SuccessIcon',
	propTypes: {
		...Icon.propTypes,
	},
 
	render() {
		const {
			className,
			isDisabled,
			...passThroughs,
		} = this.props;
 
		return (
			<Icon
				{...omitProps(passThroughs, SuccessIcon)}
				{..._.pick(passThroughs, _.keys(Icon.propTypes))}
				isDisabled={isDisabled}
				className={cx('&', className)}
			>
				<circle className={cx('&-background', { '&-background-is-disabled': isDisabled })} cx='8' cy='8' r='8'/>
				<path className={cx('&-check')} d='M11.92,5.189L11.701,4.96c-0.285-0.285-0.75-0.285-1.033,0l-4.13,4.127L4.791,7.474 c-0.286-0.286-0.748-0.286-1.033,0L3.471,7.816c-0.286,0.286-0.286,0.746,0,1.033l2.485,2.354c0.285,0.285,0.748,0.285,1.033,0 l4.932-4.98C12.205,5.938,12.205,5.475,11.92,5.189z'/>
			</Icon>
		);
	},
});
 
export default SuccessIcon;