From dda067e729a3cefca03954bc305c75e54f0c483b Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Tue, 5 Mar 2019 14:45:26 +0100 Subject: [PATCH 1/2] add rewards button beside wallet balance button --- .../component/floatingWalletBalance/view.js | 21 ++++++++++++------ app/src/styles/floatingButton.js | 22 +++++++++++++++++-- 2 files changed, 34 insertions(+), 9 deletions(-) diff --git a/app/src/component/floatingWalletBalance/view.js b/app/src/component/floatingWalletBalance/view.js index f48fb184..4719951c 100644 --- a/app/src/component/floatingWalletBalance/view.js +++ b/app/src/component/floatingWalletBalance/view.js @@ -16,13 +16,20 @@ class FloatingWalletBalance extends React.PureComponent { const { balance, navigation } = this.props; return ( - navigation && navigation.navigate({ routeName: 'WalletStack' })}> - {isNaN(balance) && } - - {(balance || balance === 0) && (formatCredits(parseFloat(balance), 2) + ' LBC')} - - + + navigation && navigation.navigate({ routeName: 'WalletStack' })}> + {isNaN(balance) && } + + {(balance || balance === 0) && (formatCredits(parseFloat(balance), 2) + ' LBC')} + + + + + get 40 + + + ); } } diff --git a/app/src/styles/floatingButton.js b/app/src/styles/floatingButton.js index 21587e3b..9c939984 100644 --- a/app/src/styles/floatingButton.js +++ b/app/src/styles/floatingButton.js @@ -2,8 +2,15 @@ import { StyleSheet } from 'react-native'; import Colors from './colors'; const floatingButtonStyle = StyleSheet.create({ - container: { + view: { position: 'absolute', + zIndex: 100, + borderRadius: 24, + padding: 14, + justifyContent: 'flex-end', + flexDirection: 'row' + }, + container: { zIndex: 100, borderRadius: 24, padding: 14, @@ -11,7 +18,7 @@ const floatingButtonStyle = StyleSheet.create({ paddingRight: 20, alignItems: 'center', justifyContent: 'center', - backgroundColor: Colors.BrighterLbryGreen, + backgroundColor: Colors.LbryGreen, shadowColor: 'black', shadowOpacity: 0.1, shadowRadius: StyleSheet.hairlineWidth, @@ -20,6 +27,17 @@ const floatingButtonStyle = StyleSheet.create({ }, elevation: 4 }, + pendingContainer: { + borderRadius: 24, + padding: 14, + paddingLeft: 70, + paddingRight: 20, + marginLeft: -60, + alignItems: 'center', + justifyContent: 'center', + backgroundColor: Colors.BrighterLbryGreen, + elevation: 3 + }, text: { color: Colors.White, fontFamily: 'Inter-UI-Bold', -- 2.45.3 From f1cc5151b578be6340c7dae6459840598f7f4e6e Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Fri, 8 Mar 2019 10:41:38 +0100 Subject: [PATCH 2/2] show unclaimed rewards amount beside floating wallet balance --- .../component/floatingWalletBalance/index.js | 2 ++ .../component/floatingWalletBalance/view.js | 12 +++++------ app/src/component/rewardSummary/view.js | 8 +++----- app/src/page/discover/view.js | 2 -- app/src/page/rewards/view.js | 2 ++ app/src/styles/reward.js | 20 +++++++++---------- 6 files changed, 22 insertions(+), 24 deletions(-) diff --git a/app/src/component/floatingWalletBalance/index.js b/app/src/component/floatingWalletBalance/index.js index 27e9e25d..e0ba24b4 100644 --- a/app/src/component/floatingWalletBalance/index.js +++ b/app/src/component/floatingWalletBalance/index.js @@ -1,9 +1,11 @@ import { connect } from 'react-redux'; import { selectBalance } from 'lbry-redux'; import FloatingWalletBalance from './view'; +import { doRewardList, selectUnclaimedRewardValue, selectFetchingRewards, selectUser } from 'lbryinc'; const select = state => ({ balance: selectBalance(state), + unclaimedRewardAmount: selectUnclaimedRewardValue(state), }); export default connect(select, null)(FloatingWalletBalance); diff --git a/app/src/component/floatingWalletBalance/view.js b/app/src/component/floatingWalletBalance/view.js index 4719951c..be0843f8 100644 --- a/app/src/component/floatingWalletBalance/view.js +++ b/app/src/component/floatingWalletBalance/view.js @@ -13,7 +13,7 @@ type Props = { class FloatingWalletBalance extends React.PureComponent { render() { - const { balance, navigation } = this.props; + const { balance, navigation, unclaimedRewardAmount } = this.props; return ( @@ -24,11 +24,11 @@ class FloatingWalletBalance extends React.PureComponent { {(balance || balance === 0) && (formatCredits(parseFloat(balance), 2) + ' LBC')} - - - get 40 - - + {unclaimedRewardAmount > 0 && + navigation && navigation.navigate({ routeName: 'Rewards' })} > + claim {unclaimedRewardAmount} + } ); } diff --git a/app/src/component/rewardSummary/view.js b/app/src/component/rewardSummary/view.js index 5009236b..20a847a2 100644 --- a/app/src/component/rewardSummary/view.js +++ b/app/src/component/rewardSummary/view.js @@ -56,14 +56,12 @@ class RewardSummary extends React.Component { } return ( - { - navigation.navigate('Rewards'); - }}> + - You have {unclaimedRewardAmount} LBC in unclaimed rewards. You have {this.state.actionsLeft} action{this.state.actionsLeft === 1 ? '' : 's'} left to claim your first reward. Tap here to continue. + You have {unclaimedRewardAmount} LBC in unclaimed rewards. LBC stands for LBRY Credits which are tokens that you can use in the digital marketplace. You have {this.state.actionsLeft} action{this.state.actionsLeft === 1 ? '' : 's'} left to claim your first reward.