All files / components/Icon/DangerIcon DangerIcon.jsx

100% Statements 4/4
100% Branches 2/2
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 44 45 46 47 48 49 50            134x               134x             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('&-DangerIcon');
 
/**
 *
 * {"categories": ["visual design", "icons"], "extend": "CrossIcon", "madeFrom": ["CrossIcon"]}
 *
 * DANGER WILL ROBINSON DANGER
 */
const DangerIcon = createClass({
	displayName: 'DangerIcon',
	propTypes: {
		...Icon.propTypes,
	},
 
	render() {
		const { className, isDisabled, isClickable, ...passThroughs } = this.props;
 
		return (
			<Icon
				{...omitProps(passThroughs, DangerIcon, [], false)}
				{..._.pick(passThroughs, _.keys(Icon.propTypes))}
				isClickable={isClickable}
				isDisabled={isDisabled}
				className={cx('&', className, isClickable && '&-is-clickable')}
			>
				<circle
					className={cx('&-background', {
						'&-background-is-disabled': isDisabled,
					})}
					cx="8"
					cy="8"
					r="8"
				/>
				<path
					className={cx('&-x')}
					d="M6.836 8l-2.45-2.463 1.17-1.17 2.45 2.464 2.465-2.464 1.17 1.17L9.164 8l2.48 2.465-1.17 1.17-2.466-2.48-2.48 2.48-1.17-1.17L6.837 8z"
				/>
			</Icon>
		);
	},
});
 
export default DangerIcon;