summaryrefslogtreecommitdiff
path: root/ui/app/components/confirmation.js
blob: 691861624505a6c9fd70d5867b527ffb033c288c (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
//
// A simple diagon that asks if you are sure.
//

import React from 'react'
import {Button, ButtonGroup, ButtonToolbar, Glyphicon, Modal}
  from 'react-bootstrap'

export default class Confirmation extends React.Component {

  static get defaultProps() {return{
    title: "Are you sure?",
    onCancel: null,
    onAccept: null,
    acceptStr: 'Accept',
    cancelStr: 'Cancel'
  }}

  constructor(props) {
    super(props)
  }

  render() {
    return (
      <Modal show={true} onHide={this.props.onCancel}>
        <Modal.Header closeButton>
          <Modal.Title>{this.props.title}</Modal.Title>
        </Modal.Header>
        <Modal.Body>
          <ButtonToolbar>
            <Button onClick={this.props.onAccept} bsStyle="success">
              {this.props.acceptStr}
            </Button>
            <Button onClick={this.props.onCancel}>
              {this.props.cancelStr}
            </Button>
          </ButtonToolbar>
        </Modal.Body>
      </Modal>
    )
  }
}