2016-11-22 21:19:08 +01:00
|
|
|
import React from 'react';
|
2017-04-07 07:15:22 +02:00
|
|
|
import Link from 'component/link';
|
2017-01-02 21:42:53 +01:00
|
|
|
import Modal from '../component/modal.js';
|
2016-11-22 21:19:08 +01:00
|
|
|
import lbry from '../lbry.js';
|
|
|
|
|
2017-05-17 10:10:25 +02:00
|
|
|
class ReportPage extends React.Component {
|
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
|
|
|
|
this.state = {
|
|
|
|
submitting: false,
|
|
|
|
modal: null,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
submitMessage() {
|
2016-04-23 14:20:54 +02:00
|
|
|
if (this._messageArea.value) {
|
|
|
|
this.setState({
|
|
|
|
submitting: true
|
|
|
|
});
|
|
|
|
lbry.reportBug(this._messageArea.value, () => {
|
|
|
|
this.setState({
|
2016-10-21 09:56:37 +02:00
|
|
|
submitting: false,
|
|
|
|
modal: 'submitted',
|
2016-04-23 14:20:54 +02:00
|
|
|
});
|
|
|
|
});
|
|
|
|
this._messageArea.value = '';
|
|
|
|
}
|
2017-05-17 10:10:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
closeModal() {
|
2016-10-21 09:56:37 +02:00
|
|
|
this.setState({
|
|
|
|
modal: null,
|
|
|
|
})
|
2017-05-17 10:10:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
2016-04-23 14:20:54 +02:00
|
|
|
return (
|
2017-05-01 02:15:21 +02:00
|
|
|
<main className="main--single-column">
|
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">
|
2017-05-18 03:37:39 +02:00
|
|
|
<button onClick={(event) => { this.submitMessage(event) }} className={'button-block button-primary ' + (this.state.submitting ? 'disabled' : '')}>{this.state.submitting ? 'Submitting...' : 'Submit Report'}</button>
|
2016-08-27 00:06:22 +02:00
|
|
|
</div>
|
2016-04-23 14:20:54 +02:00
|
|
|
</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"/>.
|
2016-04-23 14:20:54 +02:00
|
|
|
</section>
|
2017-01-13 23:05:09 +01:00
|
|
|
<Modal isOpen={this.state.modal == 'submitted'} contentLabel="Bug report submitted"
|
2017-05-18 03:37:39 +02:00
|
|
|
onConfirmed={(event) => { this.closeModal(event) }}>
|
2016-10-21 09:56:37 +02:00
|
|
|
Your bug report has been submitted! Thank you for your feedback.
|
|
|
|
</Modal>
|
2016-04-23 14:20:54 +02:00
|
|
|
</main>
|
|
|
|
);
|
|
|
|
}
|
2017-05-17 10:10:25 +02:00
|
|
|
}
|
2016-11-22 21:19:08 +01:00
|
|
|
|
|
|
|
export default ReportPage;
|