diff options
| author | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-08-19 15:39:58 +0200 |
|---|---|---|
| committer | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-09-23 10:05:43 +0200 |
| commit | 19033b8460cb43dc2fa34a2cffa932b5efe111ca (patch) | |
| tree | 79bde2093acce8d8192d27e288d61bc53cf99e07 /src/components/modals/Modal.js | |
| parent | 434be6d21ad665cb6abdf5138d0c563efbfe00b4 (diff) | |
Add profile page
Diffstat (limited to 'src/components/modals/Modal.js')
| -rw-r--r-- | src/components/modals/Modal.js | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/components/modals/Modal.js b/src/components/modals/Modal.js index 0b3301af..06273a46 100644 --- a/src/components/modals/Modal.js +++ b/src/components/modals/Modal.js @@ -1,3 +1,4 @@ +import classNames from "classnames"; import PropTypes from "prop-types"; import React from "react"; @@ -7,6 +8,12 @@ class Modal extends React.Component { show: PropTypes.bool.isRequired, onSubmit: PropTypes.func.isRequired, onCancel: PropTypes.func.isRequired, + submitButtonType: PropTypes.string, + submitButtonText: PropTypes.string, + }; + static defaultProps = { + submitButtonType: "primary", + submitButtonText: "Save", }; static idCounter = 0; @@ -83,7 +90,7 @@ class Modal extends React.Component { <h5 className="modal-title">{this.props.title}</h5> <button type="button" className="close" onClick={this.onCancel.bind(this)} aria-label="Close"> - <span aria-hidden="true">×</span> + <span>×</span> </button> </div> <div className="modal-body"> @@ -93,8 +100,9 @@ class Modal extends React.Component { <button type="button" className="btn btn-secondary" onClick={this.onCancel.bind(this)}> Close </button> - <button type="button" className="btn btn-primary" onClick={this.onSubmit.bind(this)}> - Save + <button type="button" className={classNames("btn", "btn-" + this.props.submitButtonType)} + onClick={this.onSubmit.bind(this)}> + {this.props.submitButtonText} </button> </div> </div> |
