blob: deceb47bf2afb9b2d066a12f6ee6761bd6eded69 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
//
// A simple diagon that asks if you are sure.
//
import React from 'react'
import {Button, ButtonToolbar, Modal} from 'react-bootstrap'
import PropTypes from 'prop-types'
const Confirmation = props => (
<Modal>
<Modal.Header closeButton>
<Modal.Title>
{props.title}
</Modal.Title>
</Modal.Header>
<Modal.Body>
<ButtonToolbar>
<Button onClick={props.onAccept} bsStyle="success">
{props.acceptStr}
</Button>
<Button onClick={props.onCancel}>
{props.cancelStr}
</Button>
</ButtonToolbar>
</Modal.Body>
</Modal>
)
Confirmation.defaultProps = {
title: "Are you sure?",
onCancel: null,
onAccept: null,
acceptStr: 'Accept',
cancelStr: 'Cancel'
}
Confirmation.propTypes = {
className: PropTypes.string,
onCancel: PropTypes.func.isRequired,
onAccept: PropTypes.func.isRequired,
acceptStr: PropTypes.string,
cancelStr: PropTypes.string
}
export default Confirmation
|