Skip to content

Commit

Permalink
Web: Deleted close button from dialog.
Browse files Browse the repository at this point in the history
  • Loading branch information
TatianaLopaeva committed Mar 2, 2022
1 parent 53eef11 commit 6fe7eb3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
14 changes: 10 additions & 4 deletions packages/asc-web-components/modal-dialog/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ class ModalDialog extends React.Component {
contentPaddingBottom,
removeScroll,
modalLoaderBodyHeight,
withoutCloseButton,
} = this.props;

let header = null;
Expand Down Expand Up @@ -163,10 +164,12 @@ class ModalDialog extends React.Component {
<Heading className="heading" size="medium" truncate={true}>
{header ? header.props.children : null}
</Heading>
<CloseButton
className="modal-dialog-button_close"
onClick={onClose}
></CloseButton>
{!withoutCloseButton && (
<CloseButton
className="modal-dialog-button_close"
onClick={onClose}
></CloseButton>
)}
</StyledHeader>
<BodyBox paddingProp={modalBodyPadding}>
{body ? body.props.children : null}
Expand Down Expand Up @@ -244,6 +247,8 @@ ModalDialog.propTypes = {
/** Will be triggered when a close button is clicked */
onClose: PropTypes.func,
onResize: PropTypes.func,
/**Display close button or not */
withoutCloseButton: PropTypes.bool,
/** CSS z-index */
zIndex: PropTypes.number,
/** CSS padding props for body section */
Expand All @@ -266,6 +271,7 @@ ModalDialog.defaultProps = {
asideBodyPadding: "16px 0",
modalBodyPadding: "12px 0",
contentWidth: "100%",
withoutCloseButton: false,
};

ModalDialog.Header = Header;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ const PreparationPortalDialog = (props) => {
onClose={onClose}
contentHeight="388px"
contentWidth="520px"
displayType="modal"
withoutCloseButton
>
<ModalDialog.Header>{t("PortalRestoring")}</ModalDialog.Header>
<ModalDialog.Body>
Expand Down

0 comments on commit 6fe7eb3

Please sign in to comment.