update text for signed in users #89
2 changed files with 17 additions and 6 deletions
|
@ -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);
|
||||
|
|
|
@ -5,15 +5,25 @@ import walletStyle from 'styles/wallet';
|
|||
|
||||
class WalletRewardsDriver extends React.PureComponent<Props> {
|
||||
render() {
|
||||
const { navigation, unclaimedRewardAmount } = this.props;
|
||||
const { navigation, unclaimedRewardAmount, user } = this.props;
|
||||
const signedIn = user && user.has_verified_email;
|
||||
|
||||
return (
|
||||
<TouchableOpacity style={walletStyle.rewardDriverCard} onPress={() => navigation.navigate('Rewards')}>
|
||||
<Icon name="award" size={16} style={walletStyle.rewardIcon} />
|
||||
<Text style={walletStyle.rewardDriverText}>
|
||||
Get {unclaimedRewardAmount > 0 ? unclaimedRewardAmount : ''} free credit
|
||||
{unclaimedRewardAmount === 1 ? '' : 's'} after creating an account.
|
||||
</Text>
|
||||
{signedIn && (
|
||||
<Text style={walletStyle.rewardDriverText}>
|
||||
{unclaimedRewardAmount > 0 ? unclaimedRewardAmount : ''} free credit{unclaimedRewardAmount === 1 ? '' : 's'}{' '}
|
||||
available in rewards. Tap to learn more.
|
||||
</Text>
|
||||
)}
|
||||
|
||||
{!signedIn && (
|
||||
<Text style={walletStyle.rewardDriverText}>
|
||||
Get {unclaimedRewardAmount > 0 ? unclaimedRewardAmount : ''} free credit
|
||||
{unclaimedRewardAmount === 1 ? '' : 's'} after creating an account.
|
||||
</Text>
|
||||
)}
|
||||
</TouchableOpacity>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue