[Report Page] Fix GitHub URL and improve strings (#340)
* Refactor * Fix github URL and Improve strings
This commit is contained in:
parent
87c3dcc057
commit
e2c7337d11
1 changed files with 60 additions and 74 deletions
|
@ -1,48 +1,39 @@
|
|||
import React, { Fragment } from 'react';
|
||||
import Button from 'component/button';
|
||||
import { FormField } from 'component/common/form';
|
||||
import { doToast } from 'redux/actions/notifications';
|
||||
import { FormField } from 'component/common/form';
|
||||
import { Lbryio } from 'lbryinc';
|
||||
import Page from 'component/page';
|
||||
import Button from 'component/button';
|
||||
import Card from 'component/common/card';
|
||||
import I18nMessage from 'component/i18nMessage';
|
||||
import Page from 'component/page';
|
||||
import React from 'react';
|
||||
|
||||
class ReportPage extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
this.state = {
|
||||
submitting: false,
|
||||
message: '',
|
||||
};
|
||||
this.state = { submitting: false, message: '' };
|
||||
}
|
||||
|
||||
onMessageChange(event) {
|
||||
this.setState({
|
||||
message: event.target.value,
|
||||
});
|
||||
this.setState({ message: event.target.value });
|
||||
}
|
||||
|
||||
submitMessage() {
|
||||
const { message } = this.state;
|
||||
if (message) {
|
||||
this.setState({
|
||||
submitting: true,
|
||||
});
|
||||
Lbryio.call('event', 'desktop_error', { error_message: message }).then(() => {
|
||||
this.setState({
|
||||
submitting: false,
|
||||
});
|
||||
|
||||
// Display global notice
|
||||
const action = doToast({
|
||||
message: __('Message received! Thanks for helping.'),
|
||||
});
|
||||
window.app.store.dispatch(action);
|
||||
});
|
||||
if (!message) return;
|
||||
|
||||
this.setState({ message: '' });
|
||||
}
|
||||
this.setState({ submitting: true });
|
||||
|
||||
Lbryio.call('event', 'desktop_error', { error_message: message }).then(() => {
|
||||
this.setState({ submitting: false });
|
||||
|
||||
// Display global notice
|
||||
const action = doToast({ message: __('Message received! Thanks for helping.') });
|
||||
window.app.store.dispatch(action);
|
||||
});
|
||||
|
||||
this.setState({ message: '' });
|
||||
}
|
||||
|
||||
render() {
|
||||
|
@ -55,14 +46,14 @@ class ReportPage extends React.Component {
|
|||
'Please describe the problem you experienced or the feature you want to see and any information you think might be useful to us. Links to screenshots are great!'
|
||||
)}
|
||||
actions={
|
||||
<Fragment>
|
||||
<>
|
||||
<FormField
|
||||
type="textarea"
|
||||
rows="10"
|
||||
name="message"
|
||||
stretch
|
||||
value={this.state.message}
|
||||
onChange={event => {
|
||||
onChange={(event) => {
|
||||
this.onMessageChange(event);
|
||||
}}
|
||||
placeholder={__('Description of your issue or feature request')}
|
||||
|
@ -71,58 +62,53 @@ class ReportPage extends React.Component {
|
|||
<div className="section__actions">
|
||||
<Button
|
||||
button="primary"
|
||||
onClick={event => {
|
||||
this.submitMessage(event);
|
||||
}}
|
||||
label={this.state.submitting ? __('Submitting...') : __('Submit Report')}
|
||||
onClick={(event) => this.submitMessage(event)}
|
||||
className={`button-block button-primary ${this.state.submitting ? 'disabled' : ''}`}
|
||||
>
|
||||
{this.state.submitting ? __('Submitting...') : __('Submit Report')}
|
||||
</Button>
|
||||
/>
|
||||
</div>
|
||||
</Fragment>
|
||||
</>
|
||||
}
|
||||
/>
|
||||
|
||||
<Card
|
||||
title={__('Developer?')}
|
||||
title={__('Developer? Or looking for more?')}
|
||||
actions={
|
||||
<Fragment>
|
||||
<div dir="auto" className="markdown-preview">
|
||||
<p>{__('You can also:')}</p>
|
||||
<ul>
|
||||
<li>
|
||||
<Button
|
||||
button="link"
|
||||
href="https://github.com/lbryio/lbry-desktop/issues"
|
||||
label={__('Submit an issue on GitHub')}
|
||||
/>
|
||||
.
|
||||
</li>
|
||||
<li>
|
||||
<I18nMessage
|
||||
tokens={{
|
||||
technical_resources: (
|
||||
<Button button="link" href="https://lbry.tech" label={__('technical resources')} />
|
||||
),
|
||||
}}
|
||||
>
|
||||
Explore our %technical_resources%
|
||||
</I18nMessage>
|
||||
.
|
||||
</li>
|
||||
<li>
|
||||
<I18nMessage
|
||||
tokens={{
|
||||
tech_forum: <Button button="link" href="https://forum.lbry.tech" label={__('tech forum')} />,
|
||||
}}
|
||||
>
|
||||
Join our %tech_forum%
|
||||
</I18nMessage>
|
||||
.
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</Fragment>
|
||||
<div dir="auto" className="markdown-preview">
|
||||
<p>{__('You can also:')}</p>
|
||||
<ul>
|
||||
<li>
|
||||
<Button
|
||||
button="link"
|
||||
href="https://github.com/OdyseeTeam/odysee-frontend/issues"
|
||||
label={__('Submit an issue on GitHub')}
|
||||
/>
|
||||
.
|
||||
</li>
|
||||
<li>
|
||||
<I18nMessage
|
||||
tokens={{
|
||||
technical_resources: (
|
||||
<Button button="link" href="https://lbry.tech" label={__('technical resources')} />
|
||||
),
|
||||
}}
|
||||
>
|
||||
Explore LBRY's %technical_resources%
|
||||
</I18nMessage>
|
||||
.
|
||||
</li>
|
||||
<li>
|
||||
<I18nMessage
|
||||
tokens={{
|
||||
tech_forum: <Button button="link" href="https://forum.lbry.tech" label={__('tech forum')} />,
|
||||
}}
|
||||
>
|
||||
Join LBRY's %tech_forum%
|
||||
</I18nMessage>
|
||||
.
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue