Skip to content
This repository was archived by the owner on Jun 26, 2025. It is now read-only.

Commit 45cc1dd

Browse files
committed
Merge pull request #2 from lestera/master
Added cancelText property for modifying the cancel text in the modal dialog
2 parents 5ce709e + b8da069 commit 45cc1dd

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ Body text for the modal.
3535
#### buttonText: React.PropTypes.string
3636
Options text for the initial button. Is only used if children are not passed.
3737

38+
#### cancelText: React.PropTypes.string
39+
Text for the cancel button in the modal.
40+
3841
#### confirmText: React.PropTypes.string
3942
Text for the confirm button in the modal.
4043

src/Confirm.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ var Confirm = React.createClass({
55
propTypes: {
66
body: React.PropTypes.any.isRequired,
77
buttonText: React.PropTypes.string,
8+
cancelText: React.PropTypes.string,
89
confirmText: React.PropTypes.string,
910
onConfirm: React.PropTypes.func.isRequired,
1011
title: React.PropTypes.string.isRequired,
@@ -68,7 +69,7 @@ var Confirm = React.createClass({
6869
{this.props.body}
6970
</Modal.Body>
7071
<Modal.Footer>
71-
<Button bsStyle="default" onClick={this.onClose}>Cancel</Button>
72+
<Button bsStyle="default" onClick={this.onClose}>{this.props.cancelText ? this.props.cancelText : 'Cancel'}</Button>
7273
<Button bsStyle="danger" onClick={this.onConfim}>{this.props.confirmText ? this.props.confirmText : 'Confirm'}</Button>
7374
</Modal.Footer>
7475
</Modal>

0 commit comments

Comments
 (0)