Skip to content

Commit

Permalink
fix: app crashes when message is empty close #99
Browse files Browse the repository at this point in the history
  • Loading branch information
BANG88 committed Dec 3, 2018
1 parent 2ba23ba commit 720a0fc
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions components/modal/PromptContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
/* tslint:disable:jsx-no-multiline-js */
import PropTypes from 'prop-types';
import React from 'react';
import {
KeyboardAvoidingView,
StyleSheet,
Text,
TextInput,
View,
TextStyle,
} from 'react-native';
import { KeyboardAvoidingView, StyleSheet, Text, TextInput, TextStyle, View } from 'react-native';
import { getComponentLocale } from '../_util/getLocale';
import zh_CN from './locale/zh_CN';
import Modal from './Modal';
import { CallbackOrActions } from './PropsType';
import promptStyle, { IPromptStyle } from './style/prompt';
import { getComponentLocale } from '../_util/getLocale';
import zh_CN from './locale/zh_CN';

export interface PropmptContainerProps {
title: React.ReactNode;
Expand Down Expand Up @@ -150,7 +143,7 @@ export default class PropmptContainer extends React.Component<
onAnimationEnd={onAnimationEnd}
>
<KeyboardAvoidingView behavior="padding">
{message && <Text style={styles.message}>{message}</Text>}
{message ? <Text style={styles.message}>{message}</Text> : null}
<View style={styles.inputGroup}>
{type !== 'secure-text' && (
<View style={firstStyle}>
Expand Down

0 comments on commit 720a0fc

Please sign in to comment.