dismiss soft keyboard upon claim button press

This commit is contained in:
Akinwale Ariwodola 2019-01-22 14:33:30 +01:00
parent 7f54c02a1c
commit f389e315a6

View file

@ -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<Props> {
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;