lbry-desktop/js/page/help.js

116 lines
3.6 KiB
JavaScript
Raw Normal View History

//@TODO: Customize advice based on OS
2016-11-22 21:19:08 +01:00
//@TODO: Customize advice based on OS
import React from 'react';
import lbry from '../lbry.js';
import {Link} from '../component/link.js';
2016-04-20 12:28:13 +02:00
var HelpPage = React.createClass({
getInitialState: function() {
return {
versionInfo: null,
lbryId: null,
};
},
componentWillMount: function() {
lbry.getVersionInfo((info) => {
this.setState({
versionInfo: info,
});
});
lbry.getSessionInfo((info) => {
this.setState({
lbryId: info.lbry_id,
});
});
},
componentDidMount: function() {
document.title = "Help";
},
2016-04-20 12:28:13 +02:00
render: function() {
2017-01-02 20:19:37 +01:00
let ver, osName, platform, newVerLink, uiVersion;
if (this.state.versionInfo) {
ver = this.state.versionInfo;
if (ver.os_system == 'Darwin') {
osName = (parseInt(ver.os_release.match(/^\d+/)) < 16 ? 'Mac OS X' : 'Mac OS');
platform = `${osName} ${ver.os_release}`
newVerLink = 'https://lbry.io/get/lbry.dmg';
} else if (ver.os_system == 'Linux') {
platform = `Linux (${ver.platform})`;
newVerLink = 'https://lbry.io/get/lbry.deb';
} else {
platform = `Windows (${ver.platform})`;
newVerLink = 'https://lbry.io/get/lbry.msi';
2016-08-27 00:06:22 +02:00
}
2017-01-02 20:19:37 +01:00
if (ver.ui_version == 'user-specified') {
uiVersion = '(User specified)';
} else {
uiVersion = ver.ui_version || '(Unknown)';
}
} else {
ver = null;
}
2016-08-27 00:06:22 +02:00
2016-04-20 12:28:13 +02:00
return (
<main className="page">
2016-08-08 00:45:26 +02:00
<section className="card">
<h3>Read the FAQ</h3>
<p>Our FAQ answers many common questions.</p>
<p><Link href="https://lbry.io/faq" label="Read the FAQ" icon="icon-question" button="alt"/></p>
</section>
<section className="card">
<h3>Get Live Help</h3>
<p>
Live help is available most hours in the <strong>#help</strong> channel of our Slack chat room.
2016-08-08 00:45:26 +02:00
</p>
<p>
<Link button="alt" label="Join Our Slack" icon="icon-slack" href="https://slack.lbry.io" />
</p>
</section>
<section className="card">
2016-08-27 00:06:22 +02:00
<h3>Report a Bug</h3>
<p>Did you find something wrong?</p>
<p><Link href="/?report" label="Submit a Bug Report" icon="icon-bug" button="alt" /></p>
2016-10-08 02:23:22 +02:00
<div className="meta">Thanks! LBRY is made by its users.</div>
2016-04-20 12:28:13 +02:00
</section>
2016-08-27 00:06:22 +02:00
{!ver ? null :
<section className="card">
2016-08-27 00:06:22 +02:00
<h3>About</h3>
{ver.lbrynet_update_available || ver.lbryum_update_available ?
<p>A newer version of LBRY is available. <Link href={newVerLink} label={`Download LBRY ${ver.remote_lbrynet} now!`} /></p>
2016-08-27 00:06:22 +02:00
: <p>Your copy of LBRY is up to date.</p>
}
2016-08-27 00:06:22 +02:00
<table className="table-standard">
<tbody>
<tr>
<th>lbrynet (data)</th>
<td>{ver.lbrynet_version}</td>
</tr>
<tr>
<th>lbryum (wallet)</th>
<td>{ver.lbryum_version}</td>
</tr>
2017-01-02 20:19:37 +01:00
<tr>
<th>lbry-web-ui (interface)</th>
<td>{uiVersion}</td>
</tr>
<tr>
<th>Platform</th>
<td>{platform}</td>
</tr>
2016-11-24 02:35:34 +01:00
<tr>
<th>Installation ID</th>
<td>{this.state.lbryId}</td>
2016-11-24 02:35:34 +01:00
</tr>
</tbody>
2016-08-27 00:06:22 +02:00
</table>
</section>
}
2016-04-20 12:28:13 +02:00
</main>
);
}
2016-05-20 17:54:53 +02:00
});
2016-11-22 21:19:08 +01:00
export default HelpPage;