diff --git a/scm-ui-components/packages/ui-components/src/modals/ConfirmAlert.js b/scm-ui-components/packages/ui-components/src/modals/ConfirmAlert.js index 4192411eb7..6fe08c8ce8 100644 --- a/scm-ui-components/packages/ui-components/src/modals/ConfirmAlert.js +++ b/scm-ui-components/packages/ui-components/src/modals/ConfirmAlert.js @@ -29,33 +29,40 @@ class ConfirmAlert extends React.Component { render() { const { title, message, buttons } = this.props; - const body= ( - <> - {message} -
- {buttons.map((button, i) => ( - this.handleClickButton(button)} + const body = <>{message}; + + const footer = ( +
+ {buttons.map((button, i) => ( +

+ this.handleClickButton(button)} > {button.label} - ))} -

- +

+ ))} +
); - return ( - this.close()} body={body} active={true}/> + this.close()} + body={body} + active={true} + footer={footer} + /> ); } } export function confirmAlert(properties: Props) { const root = document.getElementById("modalRoot"); - if(root){ - ReactDOM.render(, root); + if (root) { + ReactDOM.render(, root); } } diff --git a/scm-ui-components/packages/ui-components/src/modals/Modal.js b/scm-ui-components/packages/ui-components/src/modals/Modal.js index febcbcd79d..58da89381d 100644 --- a/scm-ui-components/packages/ui-components/src/modals/Modal.js +++ b/scm-ui-components/packages/ui-components/src/modals/Modal.js @@ -7,6 +7,7 @@ type Props = { title: string, closeFunction: () => void, body: any, + footer?: any, active: boolean, classes: any }; @@ -19,42 +20,35 @@ const styles = { } }; - - class Modal extends React.Component { - render() { - const { title, closeFunction, body, active, classes } = this.props; + const { title, closeFunction, body, footer, active, classes } = this.props; const isActive = active ? "is-active" : null; + let showFooter = null; + if (footer) { + showFooter =
{footer}
; + } + return ( -
+
-
-

- {title} -

+

{title}

-
- {body} -
- +
{body}
+ {showFooter}
); } } - export default injectSheet(styles)(Modal); diff --git a/scm-ui/styles/scm.scss b/scm-ui/styles/scm.scss index be708d1bea..ce9e164482 100644 --- a/scm-ui/styles/scm.scss +++ b/scm-ui/styles/scm.scss @@ -314,3 +314,10 @@ $fa-font-path: "webfonts"; border-bottom: 1px solid #eee; } } + +// modal +.modal { + .modal-card-foot { + justify-content: flex-end; // pulled-right + } +}