From 08eb9e3a6eca28a1244eab3602e0db92cf3c665e Mon Sep 17 00:00:00 2001 From: Jenni Nurmi Date: Fri, 21 Dec 2018 11:49:13 +0200 Subject: [PATCH] Update IconClose so it can be used in smaller size --- src/components/IconClose/IconClose.example.js | 8 ++++++++ src/components/IconClose/IconClose.js | 14 +++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/components/IconClose/IconClose.example.js b/src/components/IconClose/IconClose.example.js index a369dff7..0bdfc3b8 100644 --- a/src/components/IconClose/IconClose.example.js +++ b/src/components/IconClose/IconClose.example.js @@ -5,3 +5,11 @@ export const Icon = { props: {}, group: 'icons', }; + +export const IconSmall = { + component: IconClose, + props: { + size: 'small', + }, + group: 'icons', +}; diff --git a/src/components/IconClose/IconClose.js b/src/components/IconClose/IconClose.js index b8c9858a..7ff131ca 100644 --- a/src/components/IconClose/IconClose.js +++ b/src/components/IconClose/IconClose.js @@ -3,11 +3,23 @@ import PropTypes from 'prop-types'; import classNames from 'classnames'; import css from './IconClose.css'; +const SIZE_SMALL = 'small'; const IconClose = props => { - const { className, rootClassName } = props; + const { className, rootClassName, size } = props; const classes = classNames(rootClassName || css.root, className); + if (size === SIZE_SMALL) { + return ( + + + + ); + } + return (