Created
February 1, 2017 01:48
-
-
Save ralfting/c12844c199cf27b9433bcfdcb60e11cd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ModalText extends React.Component { | |
constructor(props) { | |
super(props) | |
this.state = { | |
id: this.props.id, | |
title: this.props.title, | |
text: this.props.text, | |
iconClose: this.props.iconClose, | |
confirmButton: this.props.confirmButton, | |
cancelButton: this.props.cancelButton, | |
link: this.props.link | |
} | |
} | |
render() { | |
const FooterModal = () => { | |
return ( | |
<div className="modal-footer"> | |
<button data-dismiss="modal" className="generic-button modal-button -save">{this.state.confirmButton}</button> | |
</div> | |
) | |
} | |
const HeaderModal = () => { | |
return ( | |
<div className="modal-header"> | |
<button className="close" type="button" data-dismiss="modal"> | |
<span aria-hidden="true"> | |
<img src={this.state.iconClose} /> | |
</span> | |
</button> | |
<h3 className="modal-title">{this.state.title}</h3> | |
</div> | |
) | |
} | |
return ( | |
<div className="modal fade" id={this.state.id} role="dialog"> | |
<div className="modal-dialog modal-lg" role="document"> | |
<div className="modal-content"> | |
<HeaderModal /> | |
<div className="modal-body"> | |
<p className="confirm-text"> | |
{this.state.text} | |
</p> | |
</div> | |
<FooterModal /> | |
</div> | |
</div> | |
</div> | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment