From f1cc49c6cf3b41629c9f357aa9bcb94fa4faff7d Mon Sep 17 00:00:00 2001 From: Tobias Date: Fri, 30 Nov 2018 09:23:33 +0100 Subject: [PATCH] fix: icon size in #button component have to be figured out by the icon itself --- .../src/components/button/Button.js | 12 ++-------- .../dnb-ui-lib/src/components/modal/Modal.js | 1 - .../__snapshots__/Modal.test.js.snap | 23 ++++++++----------- .../src/components/modal/style/_modal.scss | 3 ++- 4 files changed, 13 insertions(+), 26 deletions(-) diff --git a/packages/dnb-ui-lib/src/components/button/Button.js b/packages/dnb-ui-lib/src/components/button/Button.js index e33036cd7f8..89328f14066 100644 --- a/packages/dnb-ui-lib/src/components/button/Button.js +++ b/packages/dnb-ui-lib/src/components/button/Button.js @@ -6,7 +6,7 @@ import React, { PureComponent } from 'react' import PropTypes from 'prop-types' import classnames from 'classnames' -import Icon, { DefaultIconSize } from '../icon/IconWithAllIcons' +import Icon from '../icon/IconWithAllIcons' import { registerElement, validateDOMAttributes, @@ -63,7 +63,7 @@ export const defaultProps = { title: null, icon: null, icon_position: 'right', - icon_size: DefaultIconSize, + icon_size: null, href: null, id: null, class: null, @@ -230,14 +230,6 @@ class Content extends PureComponent { const ret = [] - // if (children) { - // if (typeof children === 'function') { - // ret.push(children()) - // } else if (children === PropTypes.node) { - // ret.push(children) - // } - // } - if (content) { ret.push(content) } diff --git a/packages/dnb-ui-lib/src/components/modal/Modal.js b/packages/dnb-ui-lib/src/components/modal/Modal.js index 3b730c1ec85..9325cc54b06 100644 --- a/packages/dnb-ui-lib/src/components/modal/Modal.js +++ b/packages/dnb-ui-lib/src/components/modal/Modal.js @@ -356,7 +356,6 @@ export const CloseButton = ({ variant="secondary" className={classnames('dnb-modal__close-button', className)} icon="close" - // icon_size="36" title={close_title} on_click={on_click} /> diff --git a/packages/dnb-ui-lib/src/components/modal/__tests__/__snapshots__/Modal.test.js.snap b/packages/dnb-ui-lib/src/components/modal/__tests__/__snapshots__/Modal.test.js.snap index 979328949eb..cc449272119 100644 --- a/packages/dnb-ui-lib/src/components/modal/__tests__/__snapshots__/Modal.test.js.snap +++ b/packages/dnb-ui-lib/src/components/modal/__tests__/__snapshots__/Modal.test.js.snap @@ -32,7 +32,7 @@ exports[`Modal component have to match snapshot 1`] = ` href={null} icon="modal_trigger_icon" icon_position="right" - icon_size={16} + icon_size={null} id={null} innerRef={null} on_click={[Function]} @@ -61,7 +61,7 @@ exports[`Modal component have to match snapshot 1`] = ` href={null} icon="modal_trigger_icon" icon_position="right" - icon_size={16} + icon_size={null} id={null} innerRef={null} on_click={[Function]} @@ -88,7 +88,7 @@ exports[`Modal component have to match snapshot 1`] = ` icon="modal_trigger_icon" key="button-icon" modifier={null} - size={16} + size={null} width={null} /> @@ -159,7 +159,7 @@ exports[`Modal component have to match snapshot 1`] = ` href={null} icon="close" icon_position="right" - icon_size={16} + icon_size={null} id={null} innerRef={null} on_click={[Function]} @@ -188,7 +188,7 @@ exports[`Modal component have to match snapshot 1`] = ` href={null} icon="close" icon_position="right" - icon_size={16} + icon_size={null} id={null} innerRef={null} on_click={[Function]} @@ -209,23 +209,18 @@ exports[`Modal component have to match snapshot 1`] = ` icon="close" key="button-icon" modifier={null} - size={16} + size={null} width={null} > - +