From 1788f59d85d9f51a61742917caa988f553e19848 Mon Sep 17 00:00:00 2001 From: Rocio Perez-Cano Date: Thu, 9 Nov 2023 12:47:26 -0500 Subject: [PATCH] Merge pull request #31130 from Expensify/beaman-reFixPdfAttachmentModal [CP Staging] Move View wrapper to AttachmentViewPdf (cherry picked from commit 9e02e969789094e350737c3233b1c625767f64f6) --- src/components/AttachmentModal.js | 25 ++++++-------- .../Attachments/AttachmentView/index.js | 33 +++++++++++-------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/components/AttachmentModal.js b/src/components/AttachmentModal.js index 8fcf765ef7c5..8231dd7c4fe2 100755 --- a/src/components/AttachmentModal.js +++ b/src/components/AttachmentModal.js @@ -443,21 +443,16 @@ function AttachmentModal(props) { ) : ( Boolean(sourceForAttachmentView) && shouldLoadAttachment && ( - // We need the following View component on android native - // So that the event will propagate properly and - // the Password protected preview will be shown for pdf attachement we are about to send. - - - + ) )} diff --git a/src/components/Attachments/AttachmentView/index.js b/src/components/Attachments/AttachmentView/index.js index 98086dcc4a0c..de8c0fff45e8 100755 --- a/src/components/Attachments/AttachmentView/index.js +++ b/src/components/Attachments/AttachmentView/index.js @@ -122,21 +122,26 @@ function AttachmentView({ if ((_.isString(source) && Str.isPDF(source)) || (file && Str.isPDF(file.name || translate('attachmentView.unknownFilename')))) { const encryptedSourceUrl = isAuthTokenRequired ? addEncryptedAuthTokenToURL(source) : source; + // We need the following View component on android native + // So that the event will propagate properly and + // the Password protected preview will be shown for pdf attachement we are about to send. return ( - !loadComplete && setLoadComplete(true)} - errorLabelStyles={isUsedInAttachmentModal ? [styles.textLabel, styles.textLarge] : [cursor.cursorAuto]} - style={isUsedInAttachmentModal ? styles.imageModalPDF : styles.flex1} - /> + + !loadComplete && setLoadComplete(true)} + errorLabelStyles={isUsedInAttachmentModal ? [styles.textLabel, styles.textLarge] : [cursor.cursorAuto]} + style={isUsedInAttachmentModal ? styles.imageModalPDF : styles.flex1} + /> + ); }