From 893df990dae60d301c2b3faeadba9e84bf852931 Mon Sep 17 00:00:00 2001 From: Francois Laithier Date: Thu, 30 May 2024 15:21:22 -0700 Subject: [PATCH] Fix linter error on `main` --- src/components/AttachmentModal.tsx | 64 ++++++++++----------- src/pages/home/report/ReportAttachments.tsx | 6 +- 2 files changed, 34 insertions(+), 36 deletions(-) diff --git a/src/components/AttachmentModal.tsx b/src/components/AttachmentModal.tsx index 743b8933c517..d1c027378563 100644 --- a/src/components/AttachmentModal.tsx +++ b/src/components/AttachmentModal.tsx @@ -1,4 +1,3 @@ - import Str from 'expensify-common/lib/str'; import React, {memo, useCallback, useEffect, useMemo, useState} from 'react'; import {Animated, Keyboard, View} from 'react-native'; @@ -527,38 +526,37 @@ function AttachmentModal({ onLinkPress={() => Navigation.dismissModal()} /> )} - {!shouldShowNotFoundPage && ( - !isEmptyObject(report) && !isReceiptAttachment ? ( - - ) : ( - !!sourceForAttachmentView && - shouldLoadAttachment && - !isLoading && - ( - - - - ) - ))} + {!shouldShowNotFoundPage && + (!isEmptyObject(report) && !isReceiptAttachment ? ( + + ) : ( + !!sourceForAttachmentView && + shouldLoadAttachment && + !isLoading && ( + + + + ) + ))} {/* If we have an onConfirm method show a confirmation button */} {!!onConfirm && ( diff --git a/src/pages/home/report/ReportAttachments.tsx b/src/pages/home/report/ReportAttachments.tsx index 91832f3ffe6f..c537fedfe994 100644 --- a/src/pages/home/report/ReportAttachments.tsx +++ b/src/pages/home/report/ReportAttachments.tsx @@ -1,15 +1,15 @@ import type {StackScreenProps} from '@react-navigation/stack'; import React, {useCallback} from 'react'; +import {useOnyx} from 'react-native-onyx'; import AttachmentModal from '@components/AttachmentModal'; import type {Attachment} from '@components/Attachments/types'; import ComposerFocusManager from '@libs/ComposerFocusManager'; import Navigation from '@libs/Navigation/Navigation'; import type {AuthScreensParamList} from '@libs/Navigation/types'; import * as ReportUtils from '@libs/ReportUtils'; +import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; import type SCREENS from '@src/SCREENS'; -import {useOnyx} from 'react-native-onyx'; -import ONYXKEYS from '@src/ONYXKEYS'; type ReportAttachmentsProps = StackScreenProps; @@ -18,7 +18,7 @@ function ReportAttachments({route}: ReportAttachmentsProps) { const type = route.params.type; const accountID = route.params.accountID; const report = ReportUtils.getReport(reportID); - const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP) + const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); // In native the imported images sources are of type number. Ref: https://reactnative.dev/docs/image#imagesource const source = Number(route.params.source) || route.params.source;