wallet sign in driver #67

Merged
akinwale merged 2 commits from wallet-signin-driver into master 2019-10-29 13:36:12 +01:00
5 changed files with 120 additions and 24 deletions

View file

@ -32,7 +32,7 @@ class RewardEnrolment extends React.Component {
const { fetching, navigation, unclaimedRewardAmount, user } = this.props;
return (
<View style={rewardStyle.enrollContainer} onPress>
<View style={rewardStyle.enrollContainer}>
<View style={rewardStyle.summaryRow}>
<Icon name="award" size={36} color={Colors.White} />
<Text style={rewardStyle.summaryText}>{unclaimedRewardAmount} available credits</Text>

View file

@ -0,0 +1,19 @@
import { connect } from 'react-redux';
import { doToast } from 'lbry-redux';
import { doSetClientSetting } from 'redux/actions/settings';
import { selectUser } from 'lbryinc';
import WalletSignIn from './view';
const select = state => ({
user: selectUser(state),
});
const perform = dispatch => ({
notify: data => dispatch(doToast(data)),
setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)),
});
export default connect(
select,
perform
)(WalletSignIn);

View file

@ -0,0 +1,48 @@
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
import React from 'react';
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
import { Linking, NativeModules, Text, TouchableOpacity, View } from 'react-native';
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
import AsyncStorage from '@react-native-community/async-storage';
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
import Button from 'component/button';
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
import Link from 'component/link';
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
import Colors from 'styles/colors';
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
import Icon from 'react-native-vector-icons/FontAwesome5';
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
import walletStyle from 'styles/wallet';
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
class WalletSignIn extends React.Component {
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
onContinuePressed = () => {
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
const { navigation, setClientSetting } = this.props;
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
setClientSetting(Constants.SETTING_ALPHA_UNDERSTANDS_RISKS, true);
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
};
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
onSignInPressed = () => {
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
const { navigation } = this.props;
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
navigation.navigate({ routeName: 'Verification', key: 'verification', params: { syncFlow: true } });
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
};
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
render() {
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
const { navigation, user } = this.props;
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
return (
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
<View style={walletStyle.signInContainer}>
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
<View style={walletStyle.signInSummaryRow}>
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
<Text style={walletStyle.signInTitle}>Account Recommended</Text>
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
</View>
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
<View style={walletStyle.onboarding}>
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
<Text style={walletStyle.onboardingText}>
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
An account with LBRY Inc. allows you to earn rewards, backup your wallet, and keep everything synced..
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
{'\n\n'}
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
Without an account, you assume all responsibility for securing your wallet and LBRY data.{'\n\n'}
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
</Text>
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
</View>
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
<View style={walletStyle.buttonRow}>
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
<Link style={walletStyle.continueLink} text={'Skip Account'} onPress={this.onContinuePressed} />
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
<Button style={walletStyle.signInButton} theme={'light'} text={'Sign Up'} onPress={this.onSignInPressed} />
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
</View>
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
</View>
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
);
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
}
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
}
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"
export default WalletSignIn;
kauffj commented 2019-10-28 19:46:52 +01:00 (Migrated from github.com)
Review

"Sign In" in both the title and on the button, rather than "Sign in"

"Sign In" in both the title and on the button, rather than "Sign in"

View file

@ -5,6 +5,7 @@ import WalletAddress from 'component/walletAddress';
import WalletBalance from 'component/walletBalance';
import WalletSend from 'component/walletSend';
import WalletRewardsDriver from 'component/walletRewardsDriver';
import WalletSignIn from 'component/walletSignIn';
import WalletSyncDriver from 'component/walletSyncDriver';
import Button from 'component/button';
import Link from 'component/link';
@ -66,33 +67,15 @@ class WalletPage extends React.PureComponent {
understandsRisks,
setClientSetting,
navigation,
user,
} = this.props;
if (!understandsRisks) {
const signedIn = user && user.has_verified_email;
if (!signedIn && !understandsRisks) {
return (
<View>
<View style={walletStyle.container}>
<UriBar navigation={navigation} />
<View style={walletStyle.warning}>
<Text style={walletStyle.warningParagraph}>
This is beta software. You may lose any credits that you send to your wallet due to software bugs, deleted
files, or malicious third-party software. You should not use this wallet as your primary wallet.
</Text>
{!hasSyncedWallet && (
<Text style={walletStyle.warningParagraph}>
Since you are not using the LBRY sync service, you will lose all of your credits if you uninstall this
application. Instructions on how to enroll as well as how to backup your wallet manually are available
on the next page.
</Text>
)}
<Text style={walletStyle.warningText}>
If you understand the risks and you wish to continue, please tap the button below.
</Text>
</View>
<Button
text={'I understand the risks'}
style={[walletStyle.button, walletStyle.understand]}
onPress={() => setClientSetting(Constants.SETTING_ALPHA_UNDERSTANDS_RISKS, true)}
/>
<WalletSignIn navigation={navigation} />
</View>
);
}

View file

@ -305,6 +305,52 @@ const walletStyle = StyleSheet.create({
fontSize: 16,
marginLeft: 8,
},
buttonRow: {
width: '100%',
position: 'absolute',
alignItems: 'center',
left: 24,
bottom: 24,
flexDirection: 'row',
justifyContent: 'space-between',
},
continueLink: {
fontSize: 14,
fontFamily: 'Inter-UI-Regular',
color: Colors.White,
},
learnMoreLink: {
fontFamily: 'Inter-UI-Regular',
color: Colors.NextLbryGreen,
},
signInButton: {
backgroundColor: Colors.White,
paddingLeft: 16,
paddingRight: 16,
},
signInContainer: {
flex: 1,
marginTop: 60,
padding: 24,
backgroundColor: Colors.LbryGreen,
},
onboarding: {
marginTop: 36,
},
onboardingText: {
fontFamily: 'Inter-UI-Regular',
fontSize: 18,
lineHeight: 28,
color: Colors.White,
},
signInSummaryRow: {
flexDirection: 'row',
},
signInTitle: {
color: Colors.White,
fontFamily: 'Inter-UI-Regular',
fontSize: 28,
},
});
export default walletStyle;