Add identity verification to app #366

Merged
kauffj merged 15 commits from rewards3 into master 2017-07-25 01:02:40 +02:00
2 changed files with 119 additions and 116 deletions
Showing only changes of commit 9bb618e3af - Show all commits

View file

@ -40,8 +40,8 @@ Web UI version numbers should always match the corresponding version of LBRY App
*
### Removed
*
*
* Removed bandwidth caps from settings, because the daemon was not respecting them anyway.
*
## [0.13.0] - 2017-06-30

View file

@ -13,8 +13,8 @@ class SettingsPage extends React.PureComponent {
const { daemonSettings } = this.props;
this.state = {
isMaxUpload: daemonSettings && daemonSettings.max_upload != 0,
isMaxDownload: daemonSettings && daemonSettings.max_download != 0,
// isMaxUpload: daemonSettings && daemonSettings.max_upload != 0,
// isMaxDownload: daemonSettings && daemonSettings.max_download != 0,
showUnavailable: lbry.getClientSetting("showUnavailable"),
language: lbry.getClientSetting("language"),
clearingCache: false,
@ -55,31 +55,31 @@ class SettingsPage extends React.PureComponent {
this.setDaemonSetting("download_directory", event.target.value);
}
onMaxUploadPrefChange(isLimited) {
if (!isLimited) {
this.setDaemonSetting("max_upload", 0.0);
}
this.setState({
isMaxUpload: isLimited,
});
}
onMaxUploadFieldChange(event) {
this.setDaemonSetting("max_upload", Number(event.target.value));
}
onMaxDownloadPrefChange(isLimited) {
if (!isLimited) {
this.setDaemonSetting("max_download", 0.0);
}
this.setState({
isMaxDownload: isLimited,
});
}
onMaxDownloadFieldChange(event) {
this.setDaemonSetting("max_download", Number(event.target.value));
}
// onMaxUploadPrefChange(isLimited) {
// if (!isLimited) {
// this.setDaemonSetting("max_upload", 0.0);
// }
// this.setState({
// isMaxUpload: isLimited,
// });
// }
//
// onMaxUploadFieldChange(event) {
// this.setDaemonSetting("max_upload", Number(event.target.value));
// }
//
// onMaxDownloadPrefChange(isLimited) {
// if (!isLimited) {
// this.setDaemonSetting("max_download", 0.0);
// }
// this.setState({
// isMaxDownload: isLimited,
// });
// }
//
// onMaxDownloadFieldChange(event) {
// this.setDaemonSetting("max_download", Number(event.target.value));
// }
onShowNsfwChange(event) {
this.props.setClientSetting("showNsfw", event.target.checked);
@ -148,6 +148,96 @@ class SettingsPage extends React.PureComponent {
</div>
</section>
*/
/*
<section className="card">
<div className="card__content">
<h3>{__("Bandwidth Limits")}</h3>
</div>
<div className="card__content">
<div className="form-row__label-row">
<div className="form-field__label">{__("Max Upload")}</div>
</div>
<FormRow
type="radio"
name="max_upload_pref"
onChange={() => {
this.onMaxUploadPrefChange(false);
}}
defaultChecked={!this.state.isMaxUpload}
label={__("Unlimited")}
/>
<div className="form-row">
<FormField
type="radio"
name="max_upload_pref"
onChange={() => {
this.onMaxUploadPrefChange(true);
}}
defaultChecked={this.state.isMaxUpload}
label={
this.state.isMaxUpload ? __("Up to") : __("Choose limit...")
}
/>
{this.state.isMaxUpload
? <FormField
type="number"
min="0"
step=".5"
defaultValue={daemonSettings.max_upload}
placeholder="10"
className="form-field__input--inline"
onChange={this.onMaxUploadFieldChange.bind(this)}
/>
: ""}
{this.state.isMaxUpload
? <span className="form-field__label">MB/s</span>
: ""}
</div>
</div>
<div className="card__content">
<div className="form-row__label-row">
<div className="form-field__label">{__("Max Download")}</div>
</div>
<FormRow
label={__("Unlimited")}
type="radio"
name="max_download_pref"
onChange={() => {
this.onMaxDownloadPrefChange(false);
}}
defaultChecked={!this.state.isMaxDownload}
/>
<div className="form-row">
<FormField
type="radio"
name="max_download_pref"
onChange={() => {
this.onMaxDownloadPrefChange(true);
}}
defaultChecked={this.state.isMaxDownload}
label={
this.state.isMaxDownload ? __("Up to") : __("Choose limit...")
}
/>
{this.state.isMaxDownload
? <FormField
type="number"
min="0"
step=".5"
defaultValue={daemonSettings.max_download}
placeholder="10"
className="form-field__input--inline"
onChange={this.onMaxDownloadFieldChange.bind(this)}
/>
: ""}
{this.state.isMaxDownload
? <span className="form-field__label">MB/s</span>
: ""}
</div>
</div>
</section>
*/
return (
<main className="main--single-column">
<SubHeader />
@ -165,93 +255,6 @@ class SettingsPage extends React.PureComponent {
/>
</div>
</section>
<section className="card">
<div className="card__content">
<h3>{__("Bandwidth Limits")}</h3>
</div>
<div className="card__content">
<div className="form-row__label-row">
<div className="form-field__label">{__("Max Upload")}</div>
</div>
<FormRow
type="radio"
name="max_upload_pref"
onChange={() => {
this.onMaxUploadPrefChange(false);
}}
defaultChecked={!this.state.isMaxUpload}
label={__("Unlimited")}
/>
<div className="form-row">
<FormField
type="radio"
name="max_upload_pref"
onChange={() => {
this.onMaxUploadPrefChange(true);
}}
defaultChecked={this.state.isMaxUpload}
label={
this.state.isMaxUpload ? __("Up to") : __("Choose limit...")
}
/>
{this.state.isMaxUpload
? <FormField
type="number"
min="0"
step=".5"
defaultValue={daemonSettings.max_upload}
placeholder="10"
className="form-field__input--inline"
onChange={this.onMaxUploadFieldChange.bind(this)}
/>
: ""}
{this.state.isMaxUpload
? <span className="form-field__label">MB/s</span>
: ""}
</div>
</div>
<div className="card__content">
<div className="form-row__label-row">
<div className="form-field__label">{__("Max Download")}</div>
</div>
<FormRow
label={__("Unlimited")}
type="radio"
name="max_download_pref"
onChange={() => {
this.onMaxDownloadPrefChange(false);
}}
defaultChecked={!this.state.isMaxDownload}
/>
<div className="form-row">
<FormField
type="radio"
name="max_download_pref"
onChange={() => {
this.onMaxDownloadPrefChange(true);
}}
defaultChecked={this.state.isMaxDownload}
label={
this.state.isMaxDownload ? __("Up to") : __("Choose limit...")
}
/>
{this.state.isMaxDownload
? <FormField
type="number"
min="0"
step=".5"
defaultValue={daemonSettings.max_download}
placeholder="10"
className="form-field__input--inline"
onChange={this.onMaxDownloadFieldChange.bind(this)}
/>
: ""}
{this.state.isMaxDownload
? <span className="form-field__label">MB/s</span>
: ""}
</div>
</div>
</section>
<section className="card">
<div className="card__content">
<h3>{__("Content")}</h3>