diff --git a/app/src/component/customRewardCard/view.js b/app/src/component/customRewardCard/view.js index dda1c0a4..f0b1091b 100644 --- a/app/src/component/customRewardCard/view.js +++ b/app/src/component/customRewardCard/view.js @@ -1,6 +1,6 @@ // @flow import React from 'react'; -import { ActivityIndicator, Text, TextInput, TouchableOpacity, View } from 'react-native'; +import { ActivityIndicator, Keyboard, Text, TextInput, TouchableOpacity, View } from 'react-native'; import Colors from '../../styles/colors'; import Icon from 'react-native-vector-icons/FontAwesome5'; import Button from '../button'; @@ -31,6 +31,8 @@ class CustomRewardCard extends React.PureComponent { const { canClaim, notify, submitRewardCode } = this.props; const { rewardCode } = this.state; + Keyboard.dismiss(); + if (!canClaim) { notify({ message: 'Unfortunately, you are not eligible to claim this reward at this time.' }); return; diff --git a/app/src/page/rewards/view.js b/app/src/page/rewards/view.js index 053d179e..82e7b825 100644 --- a/app/src/page/rewards/view.js +++ b/app/src/page/rewards/view.js @@ -92,6 +92,7 @@ class RewardsPage extends React.PureComponent { renderUnclaimedRewards() { const { claimed, fetching, rewards, user } = this.props; + const unclaimedRewards = (rewards && rewards.length) ? rewards : []; if (fetching) { return ( @@ -106,25 +107,15 @@ class RewardsPage extends React.PureComponent { This app is unable to earn rewards due to an authentication failure. ); - } else if (!rewards || rewards.length <= 0) { - return ( - - - {(claimed && claimed.length) ? - "You have claimed all available rewards! We're regularly adding more so be sure to check back later." : - "There are no rewards available at this time, please check back later."} - - - ); } const isNotEligible = !user || !user.primary_email || !user.has_verified_email || !user.is_reward_approved; return ( - {rewards.map(reward => )} + {unclaimedRewards.map(reward => )} );