Skip to content

Commit

Permalink
fix: icon size in #button component have to be figured out by the ico…
Browse files Browse the repository at this point in the history
…n itself
  • Loading branch information
tujoworker committed Nov 30, 2018
1 parent cac2955 commit f1cc49c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 26 deletions.
12 changes: 2 additions & 10 deletions packages/dnb-ui-lib/src/components/button/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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)
}
Expand Down
1 change: 0 additions & 1 deletion packages/dnb-ui-lib/src/components/modal/Modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]}
Expand Down Expand Up @@ -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]}
Expand All @@ -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}
/>
</Content>
Expand Down Expand Up @@ -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]}
Expand Down Expand Up @@ -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]}
Expand All @@ -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}
>
<span
aria-hidden={true}
aria-label="close title"
className="dnb-icon dnb-icon--default dnb-button__icon"
className="dnb-icon has-custom-size dnb-button__icon"
role="img"
>
<close
height={null}
width={null}
>
<close>
<svg
height={null}
viewBox="0 0 16 16"
width={null}
>
<path
clipRule="evenodd"
Expand Down Expand Up @@ -593,7 +588,7 @@ body[data-modal-active='true'] {
background: transparent; }
.dnb-modal__trigger--text:not([class*='tertiary']):hover {
text-decoration: underline; }
.dnb-modal__close-button {
.dnb-modal__close-button, .dnb-modal__close-button.dnb-button--tertiary {
position: absolute;
top: 1rem;
right: 1rem;
Expand Down
3 changes: 2 additions & 1 deletion packages/dnb-ui-lib/src/components/modal/style/_modal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ body[data-modal-active='true'] {
// &__trigger--button {
// }

&__close-button {
&__close-button,
&__close-button.dnb-button--tertiary {
position: absolute;
top: 1rem;
right: 1rem;
Expand Down

0 comments on commit f1cc49c

Please sign in to comment.