display sign in instructions for emails that exist

This commit is contained in:
Akinwale Ariwodola 2019-11-18 07:22:22 +01:00
parent e5c6270d5c
commit ab84327659
8 changed files with 29 additions and 16 deletions

4
package-lock.json generated
View file

@ -5649,8 +5649,8 @@
} }
}, },
"lbryinc": { "lbryinc": {
"version": "github:lbryio/lbryinc#27b6fcb8391b54cc9ea4d0a52a6ee536e39aa166", "version": "github:lbryio/lbryinc#2aedf5a188f028f61c45bc7ed0c747a2d4ae453a",
"from": "github:lbryio/lbryinc#27b6fcb8391b54cc9ea4d0a52a6ee536e39aa166", "from": "github:lbryio/lbryinc#2aedf5a188f028f61c45bc7ed0c747a2d4ae453a",
"requires": { "requires": {
"reselect": "^3.0.0" "reselect": "^3.0.0"
} }

View file

@ -13,7 +13,7 @@
"@expo/vector-icons": "^8.1.0", "@expo/vector-icons": "^8.1.0",
"gfycat-style-urls": "^1.0.3", "gfycat-style-urls": "^1.0.3",
"lbry-redux": "lbryio/lbry-redux#8ac92e3abfa0a9aacdb2fa4a144c3fadc4da6b11", "lbry-redux": "lbryio/lbry-redux#8ac92e3abfa0a9aacdb2fa4a144c3fadc4da6b11",
"lbryinc": "lbryio/lbryinc#27b6fcb8391b54cc9ea4d0a52a6ee536e39aa166", "lbryinc": "lbryio/lbryinc#2aedf5a188f028f61c45bc7ed0c747a2d4ae453a",
"lodash": ">=4.17.11", "lodash": ">=4.17.11",
"merge": ">=1.2.1", "merge": ">=1.2.1",
"moment": "^2.22.1", "moment": "^2.22.1",

View file

@ -8,6 +8,7 @@ import {
doUserEmailNew, doUserEmailNew,
doUserResendVerificationEmail, doUserResendVerificationEmail,
selectAuthToken, selectAuthToken,
selectEmailAlreadyExists,
selectEmailNewErrorMessage, selectEmailNewErrorMessage,
selectEmailNewIsPending, selectEmailNewIsPending,
selectEmailToVerify, selectEmailToVerify,
@ -27,6 +28,7 @@ const select = state => ({
authenticating: selectAuthenticationIsPending(state), authenticating: selectAuthenticationIsPending(state),
authToken: selectAuthToken(state), authToken: selectAuthToken(state),
emailToVerify: selectEmailToVerify(state), emailToVerify: selectEmailToVerify(state),
emailAlreadyExists: selectEmailAlreadyExists(state),
emailNewErrorMessage: selectEmailNewErrorMessage(state), emailNewErrorMessage: selectEmailNewErrorMessage(state),
emailNewPending: selectEmailNewIsPending(state), emailNewPending: selectEmailNewIsPending(state),
hasSyncedWallet: selectHasSyncedWallet(state), hasSyncedWallet: selectHasSyncedWallet(state),

View file

@ -4,7 +4,7 @@ import { ActivityIndicator, Linking, NativeModules, Platform, Switch, Text, Text
import AsyncStorage from '@react-native-community/async-storage'; import AsyncStorage from '@react-native-community/async-storage';
import Button from 'component/button'; import Button from 'component/button';
import Colors from 'styles/colors'; import Colors from 'styles/colors';
import Constants from 'constants'; import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
import Icon from 'react-native-vector-icons/FontAwesome5'; import Icon from 'react-native-vector-icons/FontAwesome5';
import firstRunStyle from 'styles/firstRun'; import firstRunStyle from 'styles/firstRun';
@ -17,17 +17,19 @@ class EmailVerifyPage extends React.PureComponent {
}; };
render() { render() {
const { onEmailViewLayout, email } = this.props; const { onEmailViewLayout, email, emailAlreadyExists } = this.props;
const content = ( const content = (
<View onLayout={() => onEmailViewLayout('verify')}> <View onLayout={() => onEmailViewLayout('verify')}>
<Text style={firstRunStyle.title}>Verify Email</Text> <Text style={firstRunStyle.title}>{emailAlreadyExists ? 'Sign In' : 'Verify Email'}</Text>
<Text style={firstRunStyle.paragraph}> <Text style={firstRunStyle.paragraph}>
An email has been sent to{' '} An email has been sent to
<Text style={firstRunStyle.nowrap} numberOfLines={1}> {'\n\n'}
{email} {email}
</Text> {'\n\n'}
. Please follow the instructions in the message to verify your email address. Please follow the instructions in the message to{' '}
{emailAlreadyExists ? 'complete signing in' : 'verify your email address'}.
</Text> </Text>
<View style={firstRunStyle.buttonContainer}> <View style={firstRunStyle.buttonContainer}>

View file

@ -318,6 +318,7 @@ class FirstRunScreen extends React.PureComponent {
authenticating, authenticating,
authToken, authToken,
checkSync, checkSync,
emailAlreadyExists,
emailNewErrorMessage, emailNewErrorMessage,
emailNewPending, emailNewPending,
emailToVerify, emailToVerify,
@ -358,6 +359,7 @@ class FirstRunScreen extends React.PureComponent {
<EmailVerifyPage <EmailVerifyPage
onEmailViewLayout={this.onEmailViewLayout} onEmailViewLayout={this.onEmailViewLayout}
email={this.state.email} email={this.state.email}
emailAlreadyExists={emailAlreadyExists}
notify={notify} notify={notify}
resendVerificationEmail={resendVerificationEmail} resendVerificationEmail={resendVerificationEmail}
/> />

View file

@ -14,6 +14,7 @@ import {
selectPhoneToVerify, selectPhoneToVerify,
selectPhoneVerifyIsPending, selectPhoneVerifyIsPending,
selectPhoneVerifyErrorMessage, selectPhoneVerifyErrorMessage,
selectEmailAlreadyExists,
selectEmailNewErrorMessage, selectEmailNewErrorMessage,
selectEmailNewIsPending, selectEmailNewIsPending,
selectEmailToVerify, selectEmailToVerify,
@ -32,6 +33,7 @@ import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
import Verification from './view'; import Verification from './view';
const select = state => ({ const select = state => ({
emailAlreadyExists: selectEmailAlreadyExists(state),
emailToVerify: selectEmailToVerify(state), emailToVerify: selectEmailToVerify(state),
emailNewErrorMessage: selectEmailNewErrorMessage(state), emailNewErrorMessage: selectEmailNewErrorMessage(state),
emailNewPending: selectEmailNewIsPending(state), emailNewPending: selectEmailNewIsPending(state),

View file

@ -105,12 +105,12 @@ class EmailVerifyPage extends React.PureComponent {
}; };
render() { render() {
const { emailNewPending } = this.props; const { emailAlreadyExists, emailNewPending } = this.props;
return ( return (
<View style={firstRunStyle.container}> <View style={firstRunStyle.container}>
<Text style={rewardStyle.verificationTitle}> <Text style={rewardStyle.verificationTitle}>
{Constants.PHASE_COLLECTION === this.state.phase ? 'Email' : 'Verify Email'} {Constants.PHASE_COLLECTION === this.state.phase ? 'Email' : emailAlreadyExists ? 'Sign In' : 'Verify Email'}
</Text> </Text>
{Constants.PHASE_COLLECTION === this.state.phase && ( {Constants.PHASE_COLLECTION === this.state.phase && (
<View> <View>
@ -138,7 +138,7 @@ class EmailVerifyPage extends React.PureComponent {
<Button <Button
style={rewardStyle.verificationButton} style={rewardStyle.verificationButton}
theme={'light'} theme={'light'}
text={'Send verification email'} text={'Continue'}
onPress={this.onSendVerificationPressed} onPress={this.onSendVerificationPressed}
/> />
)} )}
@ -154,8 +154,11 @@ class EmailVerifyPage extends React.PureComponent {
{Constants.PHASE_VERIFICATION === this.state.phase && ( {Constants.PHASE_VERIFICATION === this.state.phase && (
<View> <View>
<Text style={firstRunStyle.paragraph}> <Text style={firstRunStyle.paragraph}>
An email has been sent to <Text style={firstRunStyle.nowrap}>{this.state.email}</Text>. Please follow the An email has been sent to {'\n\n'}
instructions in the message to verify your email address. {this.state.email}
{'\n\n'}
Please follow the instructions in the message to{' '}
{emailAlreadyExists ? 'finish signing in' : 'verify your email address'}.
</Text> </Text>
<View style={rewardStyle.buttonContainer}> <View style={rewardStyle.buttonContainer}>

View file

@ -118,6 +118,7 @@ class VerificationScreen extends React.PureComponent {
addUserEmail, addUserEmail,
checkSync, checkSync,
emailNewErrorMessage, emailNewErrorMessage,
emailAlreadyExists,
emailNewPending, emailNewPending,
emailToVerify, emailToVerify,
getSync, getSync,
@ -148,6 +149,7 @@ class VerificationScreen extends React.PureComponent {
page = ( page = (
<EmailVerifyPage <EmailVerifyPage
addUserEmail={addUserEmail} addUserEmail={addUserEmail}
emailAlreadyExists={emailAlreadyExists}
emailNewErrorMessage={emailNewErrorMessage} emailNewErrorMessage={emailNewErrorMessage}
emailNewPending={emailNewPending} emailNewPending={emailNewPending}
emailToVerify={emailToVerify} emailToVerify={emailToVerify}