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 fd95417d32..e9ecffefd9 100644 --- a/scm-ui-components/packages/ui-components/src/modals/ConfirmAlert.js +++ b/scm-ui-components/packages/ui-components/src/modals/ConfirmAlert.js @@ -1,6 +1,7 @@ // @flow import * as React from "react"; import ReactDOM from "react-dom"; +import Modal from "./Modal"; type ButtonType = { label: string, @@ -28,37 +29,32 @@ class ConfirmAlert extends React.Component { render() { const { title, message, buttons } = this.props; - return ( -
-
-
- -
-

- {title} -

-
-
- {message} -
- {buttons.map((button, i) => ( - this.handleClickButton(button)} - > - {button.label} - - ))} -
-
- + const closeButton = ( +
+ + ); + + + return ( + ); } } diff --git a/scm-ui-components/packages/ui-components/src/modals/Modal.js b/scm-ui-components/packages/ui-components/src/modals/Modal.js new file mode 100644 index 0000000000..2638eb13fa --- /dev/null +++ b/scm-ui-components/packages/ui-components/src/modals/Modal.js @@ -0,0 +1,44 @@ +// @flow +import * as React from "react"; +import classNames from "classnames"; + +type Props = { + title: string, + closeButton: any, + body: any, + active: boolean +}; + +class Modal extends React.Component { + + render() { + const { title, closeButton, body, active } = this.props; + + const isActive = active ? "is-active" : null; + + return ( +
+
+
+ +
+

+ {title} +

+ {closeButton} +
+
+ {body} +
+ +
+
+ ); + } +} + + +export default Modal; diff --git a/scm-ui-components/packages/ui-components/src/modals/index.js b/scm-ui-components/packages/ui-components/src/modals/index.js index e75d082c1c..13b205dd1c 100644 --- a/scm-ui-components/packages/ui-components/src/modals/index.js +++ b/scm-ui-components/packages/ui-components/src/modals/index.js @@ -1,4 +1,5 @@ // @create-index export { default as ConfirmAlert, confirmAlert } from "./ConfirmAlert.js"; +export { default as Modal } from "./Modal.js";