1
0
mirror of https://github.com/ascribe/onion.git synced 2024-11-15 09:35:10 +01:00
onion/js/components/ascribe_buttons/button_submit_close.js

32 lines
929 B
JavaScript
Raw Normal View History

'use strict';
import React from 'react';
2015-06-16 09:59:09 +02:00
import AppConstants from '../../constants/application_constants';
let ButtonSubmitOrClose = React.createClass({
propTypes: {
submitted: React.PropTypes.bool.isRequired,
text: React.PropTypes.string.isRequired,
onClose: React.PropTypes.func.isRequired
},
render() {
if (this.props.submitted){
2015-06-03 10:27:11 +02:00
return (
<div className="modal-footer">
2015-06-16 09:59:09 +02:00
<img src={AppConstants.baseUrl + 'static/img/ascribe_animated_medium.gif'} />
2015-06-03 10:27:11 +02:00
</div>
2015-06-09 13:29:22 +02:00
);
}
return (
<div className="modal-footer">
<button type="submit" className="btn btn-ascribe-inv">{this.props.text}</button>
<button className="btn btn-ascribe-inv" onClick={this.props.onClose}>CLOSE</button>
</div>
);
}
});
export default ButtonSubmitOrClose;