From e40f3467a43a77cf98aa47c2622a25b99aea94ce Mon Sep 17 00:00:00 2001 From: miroslav Date: Tue, 8 Nov 2022 04:43:14 +0100 Subject: [PATCH] fix isuses in pdf password form --- src/components/PDFView/PDFPasswordForm.js | 17 ++--------------- src/components/PDFView/index.native.js | 2 +- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/src/components/PDFView/PDFPasswordForm.js b/src/components/PDFView/PDFPasswordForm.js index 144de7de6497..482e31405ef0 100644 --- a/src/components/PDFView/PDFPasswordForm.js +++ b/src/components/PDFView/PDFPasswordForm.js @@ -5,10 +5,7 @@ import {View, ScrollView} from 'react-native'; import Button from '../Button'; import Text from '../Text'; import TextInput from '../TextInput'; -import Icon from '../Icon'; -import * as Expensicons from '../Icon/Expensicons'; import styles from '../../styles/styles'; -import colors from '../../styles/colors'; import PDFInfoMessage from './PDFInfoMessage'; import compose from '../../libs/compose'; import withLocalize, {withLocalizePropTypes} from '../withLocalize'; @@ -120,26 +117,16 @@ class PDFPasswordForm extends Component { onChangeText={this.updatePassword} returnKeyType="done" onSubmitEditing={this.submitPassword} - errorText={this.state.validationErrorText} + errorText={this.props.isPasswordInvalid ? this.props.translate('attachmentView.passwordIncorrect') : this.state.validationErrorText} onFocus={() => this.props.onPasswordFieldFocused(true)} onBlur={this.validateAndNotifyPasswordBlur} autoFocus={this.props.shouldAutofocusPasswordField} secureTextEntry /> - {this.props.isPasswordInvalid && ( - - - - - {this.props.translate('attachmentView.passwordIncorrect')} - - - - )}