From fa768c1c592c22dda2b9af215e760fe2efe4d5d9 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Tue, 3 Dec 2019 15:14:16 +0100 Subject: [PATCH 1/2] update text for signed in users --- src/component/walletRewardsDriver/index.js | 3 ++- src/component/walletRewardsDriver/view.js | 20 +++++++++++++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/component/walletRewardsDriver/index.js b/src/component/walletRewardsDriver/index.js index d277a16..2856f8c 100644 --- a/src/component/walletRewardsDriver/index.js +++ b/src/component/walletRewardsDriver/index.js @@ -1,9 +1,10 @@ import { connect } from 'react-redux'; -import { selectUnclaimedRewardValue } from 'lbryinc'; +import { selectUnclaimedRewardValue, selectUser } from 'lbryinc'; import WalletRewardsDriver from './view'; const select = state => ({ unclaimedRewardAmount: selectUnclaimedRewardValue(state), + user: selectUser(state), }); export default connect(select)(WalletRewardsDriver); diff --git a/src/component/walletRewardsDriver/view.js b/src/component/walletRewardsDriver/view.js index d1f0d28..ea99f21 100644 --- a/src/component/walletRewardsDriver/view.js +++ b/src/component/walletRewardsDriver/view.js @@ -5,15 +5,25 @@ import walletStyle from 'styles/wallet'; class WalletRewardsDriver extends React.PureComponent { render() { - const { navigation, unclaimedRewardAmount } = this.props; + const { navigation, unclaimedRewardAmount, user } = this.props; + const signedIn = user && user.has_verified_email; return ( navigation.navigate('Rewards')}> - - Get {unclaimedRewardAmount > 0 ? unclaimedRewardAmount : ''} free credit - {unclaimedRewardAmount === 1 ? '' : 's'} after creating an account. - + {signedIn && ( + + {unclaimedRewardAmount > 0 ? unclaimedRewardAmount : ''} free credit{unclaimedRewardAmount === 1 ? '' : 's'}{' '} + available in rewards. Tap to learn more. + + )} + + {!signedIn && ( + + Get {unclaimedRewardAmount > 0 ? unclaimedRewardAmount : ''} free credit + {unclaimedRewardAmount === 1 ? '' : 's'} after creating an account. + + )} ); } -- 2.45.2 From 7eca3dfea2cb452f86a3c5f20e9705503e30d8ac Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Fri, 6 Dec 2019 15:58:17 +0100 Subject: [PATCH 2/2] i18n tweaks --- src/component/walletRewardsDriver/view.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/component/walletRewardsDriver/view.js b/src/component/walletRewardsDriver/view.js index ea99f21..c3220bf 100644 --- a/src/component/walletRewardsDriver/view.js +++ b/src/component/walletRewardsDriver/view.js @@ -13,15 +13,21 @@ class WalletRewardsDriver extends React.PureComponent { {signedIn && ( - {unclaimedRewardAmount > 0 ? unclaimedRewardAmount : ''} free credit{unclaimedRewardAmount === 1 ? '' : 's'}{' '} - available in rewards. Tap to learn more. + {unclaimedRewardAmount === 0 && __('Free credits available in rewards.')} + {unclaimedRewardAmount === 1 && + __('%amount% free credit available in rewards.', { amount: unclaimedRewardAmount })} + {unclaimedRewardAmount > 1 && + __('%amount% free credits available in rewards.', { amount: unclaimedRewardAmount })}{' '} + {__('Tap to learn more.')} )} {!signedIn && ( - Get {unclaimedRewardAmount > 0 ? unclaimedRewardAmount : ''} free credit - {unclaimedRewardAmount === 1 ? '' : 's'} after creating an account. + {unclaimedRewardAmount === 1 && + __('Get %amount% free credit after creating an account.', { amount: unclaimedRewardAmount })} + {unclaimedRewardAmount !== 1 && + __('Get %amount% free credits after creating an account.', { amount: unclaimedRewardAmount })} )} -- 2.45.2