From c30d1587043810c787ed5f8b8d12f04cd2f80953 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Mon, 20 Apr 2020 13:13:41 -0400 Subject: [PATCH] add sync checkbox to desktop --- static/app-strings.json | 7 +++++- ui/component/userEmailReturning/index.js | 2 ++ ui/component/userEmailReturning/view.jsx | 31 +++++++++++++++++++++++- 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/static/app-strings.json b/static/app-strings.json index 23fda02a8..11d044052 100644 --- a/static/app-strings.json +++ b/static/app-strings.json @@ -1161,5 +1161,10 @@ "You have %count% blocked %channels%.": "You have %count% blocked %channels%.", "Account Password": "Account Password", "You do not currently have a password set.": "You do not currently have a password set.", - "Add A Password": "Add A Password" + "Add A Password": "Add A Password", + "Register with lbry.tv": "Register with lbry.tv", + "Enter Your lbry.tv Password": "Enter Your lbry.tv Password", + "Signing in as %email%": "Signing in as %email%", + "Forgot Password?": "Forgot Password?", + "Use Magic Link": "Use Magic Link" } \ No newline at end of file diff --git a/ui/component/userEmailReturning/index.js b/ui/component/userEmailReturning/index.js index 1e5e0281d..1bc673140 100644 --- a/ui/component/userEmailReturning/index.js +++ b/ui/component/userEmailReturning/index.js @@ -7,6 +7,7 @@ import { selectEmailDoesNotExist, selectEmailAlreadyExists, } from 'lbryinc'; +import { doSetClientSetting } from 'redux/actions/settings'; import UserEmailReturning from './view'; const select = state => ({ @@ -19,4 +20,5 @@ const select = state => ({ export default connect(select, { doUserCheckIfEmailExists, doClearEmailEntry, + doSetClientSetting, })(UserEmailReturning); diff --git a/ui/component/userEmailReturning/view.jsx b/ui/component/userEmailReturning/view.jsx index 613458dab..eeb0e251b 100644 --- a/ui/component/userEmailReturning/view.jsx +++ b/ui/component/userEmailReturning/view.jsx @@ -1,4 +1,5 @@ // @flow +import * as SETTINGS from 'constants/settings'; import * as PAGES from 'constants/pages'; import React, { useState } from 'react'; import { FormField, Form } from 'component/common/form'; @@ -16,20 +17,33 @@ type Props = { doClearEmailEntry: () => void, doUserSignIn: (string, ?string) => void, doUserCheckIfEmailExists: string => void, + doSetClientSetting: (string, boolean) => void, }; function UserEmailReturning(props: Props) { - const { errorMessage, doUserCheckIfEmailExists, emailToVerify, doClearEmailEntry, emailDoesNotExist } = props; + const { + errorMessage, + doUserCheckIfEmailExists, + emailToVerify, + doClearEmailEntry, + emailDoesNotExist, + doSetClientSetting, + } = props; const { push, location } = useHistory(); const urlParams = new URLSearchParams(location.search); const emailFromUrl = urlParams.get('email'); const emailExistsFromUrl = urlParams.get('email_exists'); const defaultEmail = emailFromUrl ? decodeURIComponent(emailFromUrl) : ''; const [email, setEmail] = useState(defaultEmail); + const [syncEnabled, setSyncEnabled] = useState(true); + const valid = email.match(EMAIL_REGEX); const showEmailVerification = emailToVerify; function handleSubmit() { + // @if TARGET='app' + doSetClientSetting(SETTINGS.ENABLE_SYNC, syncEnabled); + // @endif doUserCheckIfEmailExists(email); } @@ -69,6 +83,21 @@ function UserEmailReturning(props: Props) { onChange={e => setEmail(e.target.value)} /> + {/* @if TARGET='app' */} + + {__('Backup your account and wallet data.')}{' '} +