mirror of
https://github.com/maputnik/editor.git
synced 2025-12-08 07:10:00 +00:00
- Added searchParams based router for easier testing - Added more stories to the storybook
45 lines
1.0 KiB
JavaScript
45 lines
1.0 KiB
JavaScript
import React from 'react'
|
|
import PropTypes from 'prop-types'
|
|
|
|
import InputButton from './InputButton'
|
|
import Modal from './Modal'
|
|
|
|
|
|
export default class ModalLoading extends React.Component {
|
|
static propTypes = {
|
|
isOpen: PropTypes.bool.isRequired,
|
|
onCancel: PropTypes.func.isRequired,
|
|
title: PropTypes.string.isRequired,
|
|
message: PropTypes.node.isRequired,
|
|
}
|
|
|
|
underlayOnClick(e) {
|
|
// This stops click events falling through to underlying modals.
|
|
e.stopPropagation();
|
|
}
|
|
|
|
render() {
|
|
return <Modal
|
|
data-wd-key="modal:loading"
|
|
isOpen={this.props.isOpen}
|
|
underlayClickExits={false}
|
|
underlayProps={{
|
|
onClick: (e) => underlayProps(e)
|
|
}}
|
|
closeable={false}
|
|
title={this.props.title}
|
|
onOpenToggle={() => this.props.onCancel()}
|
|
>
|
|
<p>
|
|
{this.props.message}
|
|
</p>
|
|
<p className="maputnik-dialog__buttons">
|
|
<InputButton onClick={(e) => this.props.onCancel(e)}>
|
|
Cancel
|
|
</InputButton>
|
|
</p>
|
|
</Modal>
|
|
}
|
|
}
|
|
|