//@TODO: Customize advice based on OS import React from "react"; import lbry from "lbry.js"; import Link from "component/link"; import SubHeader from "component/subHeader"; import { BusyMessage, Icon } from "component/common"; class HelpPage extends React.PureComponent { constructor(props) { super(props); this.state = { versionInfo: null, lbryId: null, uiVersion: null, upgradeAvailable: null, accessTokenHidden: true, }; } componentWillMount() { lbry .getAppVersionInfo() .then(({ remoteVersion, localVersion, upgradeAvailable }) => { this.setState({ uiVersion: localVersion, upgradeAvailable: upgradeAvailable, }); }); lbry.version().then(info => { this.setState({ versionInfo: info, }); }); lbry.status({ session_status: true }).then(info => { this.setState({ lbryId: info.lbry_id, }); }); if (!this.props.accessToken) this.props.fetchAccessToken(); } showAccessToken() { this.setState({ accessTokenHidden: false, }); } render() { let ver, osName, platform, newVerLink; const { doAuth, user } = this.props; 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"; } } else { ver = null; } return (

{__("Read the FAQ")}

{__("Our FAQ answers many common questions.")}

{__("Get Live Help")}

{__("Live help is available most hours in the")} {" "}#help {" "}{__("channel of our Slack chat room.")}

{__("Report a Bug")}

{__("Did you find something wrong?")}

{__("Thanks! LBRY is made by its users.")}

{__("About")}

{this.state.upgradeAvailable === null ? "" : this.state.upgradeAvailable ?

{__("A newer version of LBRY is available.")} {" "}

:

{__("Your copy of LBRY is up to date.")}

} {this.state.uiVersion && ver ?
{__("App")} {this.state.uiVersion}
{__("Daemon (lbrynet)")} {ver.lbrynet_version}
{__("Wallet (lbryum)")} {ver.lbryum_version}
{__("Connected Email")} {user && user.primary_email ? user.primary_email : {__("none")} ( doAuth()} label={__("set email")} />) }
{__("Reward Eligible")} {user && user.is_reward_approved ? : }
{__("Platform")} {platform}
{__("Installation ID")} {this.state.lbryId}
{__("Access Token")} {this.state.accessTokenHidden && } {!this.state.accessTokenHidden && this.props.accessToken}
: }
); } } export default HelpPage;