Skip to content

Commit

Permalink
Fix linter error on main
Browse files Browse the repository at this point in the history
  • Loading branch information
francoisl committed May 30, 2024
1 parent ec495a3 commit 893df99
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 36 deletions.
64 changes: 31 additions & 33 deletions src/components/AttachmentModal.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -527,38 +526,37 @@ function AttachmentModal({
onLinkPress={() => Navigation.dismissModal()}
/>
)}
{!shouldShowNotFoundPage && (
!isEmptyObject(report) && !isReceiptAttachment ? (
<AttachmentCarousel
accountID={accountID}
type={type}
report={report}
onNavigate={onNavigate}
onClose={closeModal}
source={source}
setDownloadButtonVisibility={setDownloadButtonVisibility}
/>
) : (
!!sourceForAttachmentView &&
shouldLoadAttachment &&
!isLoading &&
(
<AttachmentCarouselPagerContext.Provider value={context}>
<AttachmentView
containerStyles={[styles.mh5]}
source={sourceForAttachmentView}
isAuthTokenRequired={isAuthTokenRequiredState}
file={file}
onToggleKeyboard={updateConfirmButtonVisibility}
isWorkspaceAvatar={isWorkspaceAvatar}
maybeIcon={maybeIcon}
fallbackSource={fallbackSource}
isUsedInAttachmentModal
transactionID={transaction?.transactionID}
/>
</AttachmentCarouselPagerContext.Provider>
)
))}
{!shouldShowNotFoundPage &&
(!isEmptyObject(report) && !isReceiptAttachment ? (
<AttachmentCarousel
accountID={accountID}
type={type}
report={report}
onNavigate={onNavigate}
onClose={closeModal}
source={source}
setDownloadButtonVisibility={setDownloadButtonVisibility}
/>
) : (
!!sourceForAttachmentView &&
shouldLoadAttachment &&
!isLoading && (
<AttachmentCarouselPagerContext.Provider value={context}>
<AttachmentView
containerStyles={[styles.mh5]}
source={sourceForAttachmentView}
isAuthTokenRequired={isAuthTokenRequiredState}
file={file}
onToggleKeyboard={updateConfirmButtonVisibility}
isWorkspaceAvatar={isWorkspaceAvatar}
maybeIcon={maybeIcon}
fallbackSource={fallbackSource}
isUsedInAttachmentModal
transactionID={transaction?.transactionID}
/>
</AttachmentCarouselPagerContext.Provider>
)
))}
</View>
{/* If we have an onConfirm method show a confirmation button */}
{!!onConfirm && (
Expand Down
6 changes: 3 additions & 3 deletions src/pages/home/report/ReportAttachments.tsx
Original file line number Diff line number Diff line change
@@ -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<AuthScreensParamList, typeof SCREENS.ATTACHMENTS>;

Expand All @@ -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;
Expand Down

0 comments on commit 893df99

Please sign in to comment.