lbry-desktop/js/page/report.js

62 lines
1.9 KiB
JavaScript
Raw Normal View History

2016-11-22 21:19:08 +01:00
import React from 'react';
2017-01-02 21:42:53 +01:00
import {Link} from '../component/link.js';
import Modal from '../component/modal.js';
2016-11-22 21:19:08 +01:00
import lbry from '../lbry.js';
var ReportPage = React.createClass({
submitMessage: function() {
if (this._messageArea.value) {
this.setState({
submitting: true
});
lbry.reportBug(this._messageArea.value, () => {
this.setState({
submitting: false,
modal: 'submitted',
});
});
this._messageArea.value = '';
}
},
2016-08-08 00:45:26 +02:00
componentDidMount: function() {
document.title = "Report an Issue";
},
closeModal: function() {
this.setState({
modal: null,
})
},
getInitialState: function() {
return {
submitting: false,
modal: null,
}
},
render: function() {
return (
<main className="page">
2016-08-08 00:45:26 +02:00
<section className="card">
<h3>Report an Issue</h3>
<p>Please describe the problem you experienced and any information you think might be useful to us. Links to screenshots are great!</p>
2016-08-27 00:06:22 +02:00
<div className="form-row">
<textarea ref={(t) => this._messageArea = t} cols="80" rows="10" name="message" type="text"/>
</div>
<div className="form-row form-row-submit">
<button onClick={this.submitMessage} className={'button-block button-primary ' + (this.state.submitting ? 'disabled' : '')}>{this.state.submitting ? 'Submitting...' : 'Submit Report'}</button>
</div>
</section>
2016-08-08 00:45:26 +02:00
<section className="card">
<h3>Developer?</h3>
You can also <Link href="https://github.com/lbryio/lbry/issues" label="submit an issue on GitHub"/>.
</section>
2017-01-13 23:05:09 +01:00
<Modal isOpen={this.state.modal == 'submitted'} contentLabel="Bug report submitted"
onConfirmed={this.closeModal}>
Your bug report has been submitted! Thank you for your feedback.
</Modal>
</main>
);
}
2016-11-22 21:19:08 +01:00
});
export default ReportPage;