diff options
author | Dan <danjm.com@gmail.com> | 2018-03-07 08:15:45 +0800 |
---|---|---|
committer | Dan <danjm.com@gmail.com> | 2018-03-07 08:15:45 +0800 |
commit | 9d215bab0fe124f036d2ac41f375331c8d43b72b (patch) | |
tree | 6bbbdb2e6a2dcd5948ee8473cad152232c73643b /ui/app/components/modals/notification-modal.js | |
parent | f06bca1151b07d908cd90f6efd97064e288e5f27 (diff) | |
parent | 9762a730413129361062804aa8dfc7be7cf74868 (diff) | |
download | tangerine-wallet-browser-9d215bab0fe124f036d2ac41f375331c8d43b72b.tar.gz tangerine-wallet-browser-9d215bab0fe124f036d2ac41f375331c8d43b72b.tar.zst tangerine-wallet-browser-9d215bab0fe124f036d2ac41f375331c8d43b72b.zip |
Merge branch 'master' into i18n
Diffstat (limited to 'ui/app/components/modals/notification-modal.js')
-rw-r--r-- | ui/app/components/modals/notification-modal.js | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/ui/app/components/modals/notification-modal.js b/ui/app/components/modals/notification-modal.js index 239144b0c..621a974d0 100644 --- a/ui/app/components/modals/notification-modal.js +++ b/ui/app/components/modals/notification-modal.js @@ -9,26 +9,47 @@ class NotificationModal extends Component { const { header, message, + showCancelButton = false, + showConfirmButton = false, + hideModal, + onConfirm, } = this.props + const showButtons = showCancelButton || showConfirmButton + return h('div', [ - h('div.notification-modal-wrapper', { + h('div.notification-modal__wrapper', { }, [ - h('div.notification-modal-header', {}, [ + h('div.notification-modal__header', {}, [ header, ]), - h('div.notification-modal-message-wrapper', {}, [ - h('div.notification-modal-message', {}, [ + h('div.notification-modal__message-wrapper', {}, [ + h('div.notification-modal__message', {}, [ message, ]), ]), h('div.modal-close-x', { - onClick: this.props.hideModal, + onClick: hideModal, }), + showButtons && h('div.notification-modal__buttons', [ + + showCancelButton && h('div.btn-cancel.notification-modal__buttons__btn', { + onClick: hideModal, + }, 'Cancel'), + + showConfirmButton && h('div.btn-clear.notification-modal__buttons__btn', { + onClick: () => { + onConfirm() + hideModal() + }, + }, 'Confirm'), + + ]), + ]), ]) } @@ -37,7 +58,10 @@ class NotificationModal extends Component { NotificationModal.propTypes = { hideModal: PropTypes.func, header: PropTypes.string, - message: PropTypes.string, + message: PropTypes.node, + showCancelButton: PropTypes.bool, + showConfirmButton: PropTypes.bool, + onConfirm: PropTypes.func, } const mapDispatchToProps = dispatch => { |