Many improvements in SelectionMap
This commit is contained in:
parent
7a672bca87
commit
e3eddd6b85
13 changed files with 173 additions and 132 deletions
|
|
@ -7,56 +7,8 @@ import PropTypes from 'prop-types';
|
|||
import { Modal, Button } from 'react-bootstrap';
|
||||
import { confirmable } from 'react-confirm';
|
||||
|
||||
// https://github.com/haradakunihiko/react-confirm/blob/master/example/react-bootstrap/src/components/Confirmation.js
|
||||
class Prompt extends Component {
|
||||
// constructor(props) {
|
||||
/* super(props);
|
||||
* this.state = {
|
||||
* open: true
|
||||
* };
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
* console.log(this.prompt);
|
||||
* this.setState({ open: true });
|
||||
}
|
||||
*/
|
||||
|
||||
render2() {
|
||||
const {
|
||||
show,
|
||||
proceed,
|
||||
dismiss,
|
||||
cancel,
|
||||
confirmation,
|
||||
okBtn,
|
||||
cancelBtn
|
||||
} = this.props;
|
||||
return (
|
||||
<div
|
||||
className="modal"
|
||||
tabIndex="-1"
|
||||
role="dialog"
|
||||
>
|
||||
<div className="modal-dialog" role="document">
|
||||
<div className="modal-content">
|
||||
<div className="modal-header">
|
||||
<h5 className="modal-title">Modal title</h5>
|
||||
<button type="button" className="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div className="modal-body">
|
||||
<p>Modal body text goes here.</p>
|
||||
</div>
|
||||
<div className="modal-footer">
|
||||
<button type="button" className="btn btn-primary">Save changes</button>
|
||||
<button type="button" className="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
render() {
|
||||
const {
|
||||
show,
|
||||
|
|
@ -66,6 +18,7 @@ role="dialog"
|
|||
confirmation,
|
||||
okBtn,
|
||||
cancelBtn,
|
||||
title,
|
||||
enableEscape = true
|
||||
} = this.props;
|
||||
return (
|
||||
|
|
@ -78,9 +31,11 @@ role="dialog"
|
|||
backdrop={enableEscape ? true : 'static'}
|
||||
keyboard={enableEscape}
|
||||
>
|
||||
<Modal.Header closeButton>
|
||||
<Modal.Title id="ModalHeader" />
|
||||
</Modal.Header>
|
||||
{title &&
|
||||
<Modal.Header closeButton>
|
||||
<Modal.Title id="ModalHeader">{title}</Modal.Title>
|
||||
</Modal.Header>
|
||||
}
|
||||
<Modal.Body>
|
||||
<p>{confirmation}</p>
|
||||
</Modal.Body>
|
||||
|
|
@ -100,6 +55,7 @@ Prompt.propTypes = {
|
|||
cancel: PropTypes.func, // from confirmable. call to close the dialog with promise rejected.
|
||||
dismiss: PropTypes.func, // from confirmable. call to only close the dialog.
|
||||
confirmation: PropTypes.string, // arguments of your confirm function
|
||||
title: PropTypes.string,
|
||||
okBtn: PropTypes.string.isRequired,
|
||||
cancelBtn: PropTypes.string.isRequired,
|
||||
enableEscape: PropTypes.bool
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue