From c3a431b40c0de2dc368ee3497511f3f8d4cc26c9 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Fri, 25 Oct 2019 16:26:14 +0100 Subject: [PATCH 1/2] wallet sign in driver --- src/component/rewardEnrolment/view.js | 2 +- src/component/walletSignIn/index.js | 19 +++++++++++ src/component/walletSignIn/view.js | 47 +++++++++++++++++++++++++++ src/page/wallet/view.js | 29 ++++------------- src/styles/wallet.js | 46 ++++++++++++++++++++++++++ 5 files changed, 119 insertions(+), 24 deletions(-) create mode 100644 src/component/walletSignIn/index.js create mode 100644 src/component/walletSignIn/view.js diff --git a/src/component/rewardEnrolment/view.js b/src/component/rewardEnrolment/view.js index f9e74b0..c4b6457 100644 --- a/src/component/rewardEnrolment/view.js +++ b/src/component/rewardEnrolment/view.js @@ -32,7 +32,7 @@ class RewardEnrolment extends React.Component { const { fetching, navigation, unclaimedRewardAmount, user } = this.props; return ( - + {unclaimedRewardAmount} available credits diff --git a/src/component/walletSignIn/index.js b/src/component/walletSignIn/index.js new file mode 100644 index 0000000..1872254 --- /dev/null +++ b/src/component/walletSignIn/index.js @@ -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); diff --git a/src/component/walletSignIn/view.js b/src/component/walletSignIn/view.js new file mode 100644 index 0000000..ab88549 --- /dev/null +++ b/src/component/walletSignIn/view.js @@ -0,0 +1,47 @@ +import React from 'react'; +import { Linking, NativeModules, Text, TouchableOpacity, View } from 'react-native'; +import AsyncStorage from '@react-native-community/async-storage'; +import Button from 'component/button'; +import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api +import Link from 'component/link'; +import Colors from 'styles/colors'; +import Icon from 'react-native-vector-icons/FontAwesome5'; +import walletStyle from 'styles/wallet'; + +class WalletSignIn extends React.Component { + onContinuePressed = () => { + const { navigation, setClientSetting } = this.props; + setClientSetting(Constants.SETTING_ALPHA_UNDERSTANDS_RISKS, true); + }; + + onSignInPressed = () => { + const { navigation } = this.props; + navigation.navigate({ routeName: 'Verification', key: 'verification', params: { syncFlow: true } }); + }; + + render() { + const { navigation, user } = this.props; + + return ( + + + Sign in + + + + + An account will allow you to earn rewards and keep your account and settings synced.{'\n\n'} + Without an account, you will not receive rewards, sync and backup services, or security updates.{'\n\n'} + + + + + +