Skip to content

Commit 379036f

Browse files
committed
fix: added report to AttachmentComposerModal
1 parent f228ae8 commit 379036f

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

src/components/AttachmentComposerModal.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, {memo, useCallback, useEffect, useRef, useState} from 'react';
22
import type {View} from 'react-native';
33
import {InteractionManager} from 'react-native';
44
import {GestureHandlerRootView} from 'react-native-gesture-handler';
5+
import type {OnyxEntry} from 'react-native-onyx';
56
import Animated, {FadeIn, LayoutAnimationConfig} from 'react-native-reanimated';
67
import type {ValueOf} from 'type-fest';
78
import useFilesValidation from '@hooks/useFilesValidation';
@@ -10,6 +11,7 @@ import useResponsiveLayout from '@hooks/useResponsiveLayout';
1011
import useThemeStyles from '@hooks/useThemeStyles';
1112
import {cleanFileName, getFileValidationErrorText} from '@libs/fileDownload/FileUtils';
1213
import CONST from '@src/CONST';
14+
import type * as OnyxTypes from '@src/types/onyx';
1315
import type ModalType from '@src/types/utils/ModalType';
1416
import viewRef from '@src/types/utils/viewRef';
1517
import AttachmentCarouselView from './Attachments/AttachmentCarousel/AttachmentCarouselView';
@@ -57,9 +59,12 @@ type AttachmentComposerModalProps = {
5759

5860
/** Should disable send button */
5961
shouldDisableSendButton: boolean;
62+
63+
/** The report currently being looked at */
64+
report?: OnyxEntry<OnyxTypes.Report>;
6065
};
6166

62-
function AttachmentComposerModal({onConfirm, onModalShow = () => {}, onModalHide = () => {}, headerTitle, children, shouldDisableSendButton = false}: AttachmentComposerModalProps) {
67+
function AttachmentComposerModal({onConfirm, onModalShow = () => {}, onModalHide = () => {}, headerTitle, children, shouldDisableSendButton = false, report}: AttachmentComposerModalProps) {
6368
const styles = useThemeStyles();
6469
const {translate} = useLocalize();
6570
const {shouldUseNarrowLayout} = useResponsiveLayout();
@@ -284,6 +289,7 @@ function AttachmentComposerModal({onConfirm, onModalShow = () => {}, onModalHide
284289
setShouldShowArrows={setShouldShowArrows}
285290
onAttachmentError={setAttachmentError}
286291
shouldShowArrows={shouldShowArrows}
292+
report={report}
287293
/>
288294
)}
289295
<LayoutAnimationConfig skipEntering>

src/pages/home/report/ReportActionCompose/ReportActionCompose.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,7 @@ function ReportActionCompose({
580580
onModalShow={() => setIsAttachmentPreviewActive(true)}
581581
onModalHide={onAttachmentPreviewClose}
582582
shouldDisableSendButton={!!exceededMaxLength}
583+
report={report}
583584
>
584585
{({displayFilesInModal}) => {
585586
const handleAttachmentDrop = (event: DragEvent) => {

0 commit comments

Comments
 (0)