From 7f54c02a1ced81fc91ed957b7fda8ca25f565351 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Tue, 22 Jan 2019 14:29:59 +0100 Subject: [PATCH 1/2] make the claim custom reward card always visible --- app/src/page/rewards/view.js | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) 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 => )} ); From f389e315a6a5ccfc612cf6d6e856a14a35412ffd Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Tue, 22 Jan 2019 14:33:30 +0100 Subject: [PATCH 2/2] dismiss soft keyboard upon claim button press --- app/src/component/customRewardCard/view.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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;