Skip to content

Commit b3599a2

Browse files
committed
Remove download button for natives as well
1 parent 9a1634e commit b3599a2

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/components/Attachments/AttachmentCarousel/Pager/index.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import PagerView from 'react-native-pager-view';
99
import Animated, {useAnimatedProps, useSharedValue} from 'react-native-reanimated';
1010
import CarouselItem from '@components/Attachments/AttachmentCarousel/CarouselItem';
1111
import useCarouselContextEvents from '@components/Attachments/AttachmentCarousel/useCarouselContextEvents';
12+
import type {UseAttachmentErrors} from '@components/Attachments/AttachmentView/useAttachmentErrors';
1213
import type {Attachment, AttachmentSource} from '@components/Attachments/types';
1314
import useThemeStyles from '@hooks/useThemeStyles';
1415
import shouldUseNewPager from '@libs/shouldUseNewPager';
@@ -55,10 +56,13 @@ type AttachmentCarouselPagerProps = {
5556

5657
/** The reportID related to the attachment */
5758
reportID?: string;
59+
60+
/** Optional property providing methods to manage error states for attachments. */
61+
attachmentErrors?: UseAttachmentErrors;
5862
};
5963

6064
function AttachmentCarouselPager(
61-
{items, activeAttachmentID, initialPage, setShouldShowArrows, onPageSelected, onClose, reportID}: AttachmentCarouselPagerProps,
65+
{items, activeAttachmentID, initialPage, setShouldShowArrows, onPageSelected, onClose, reportID, attachmentErrors}: AttachmentCarouselPagerProps,
6266
ref: ForwardedRef<AttachmentCarouselPagerHandle>,
6367
) {
6468
const {handleTap, handleScaleChange, isScrollEnabled} = useCarouselContextEvents(setShouldShowArrows);
@@ -100,8 +104,9 @@ function AttachmentCarouselPager(
100104
onTap: handleTap,
101105
onSwipeDown: onClose,
102106
onScaleChanged: handleScaleChange,
107+
attachmentErrors,
103108
}),
104-
[pagerItems, activePageIndex, isPagerScrolling, isScrollEnabled, handleTap, onClose, handleScaleChange],
109+
[pagerItems, activePageIndex, isPagerScrolling, isScrollEnabled, handleTap, onClose, handleScaleChange, attachmentErrors],
105110
);
106111

107112
const animatedProps = useAnimatedProps(() => ({

src/components/Attachments/AttachmentCarousel/index.native.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import AttachmentCarouselPager from './Pager';
1818
import type {AttachmentCarouselProps} from './types';
1919
import useCarouselArrows from './useCarouselArrows';
2020

21-
function AttachmentCarousel({report, source, attachmentID, onNavigate, setDownloadButtonVisibility, onClose, type, accountID}: AttachmentCarouselProps) {
21+
function AttachmentCarousel({report, source, attachmentID, onNavigate, setDownloadButtonVisibility, onClose, type, accountID, attachmentErrors}: AttachmentCarouselProps) {
2222
const styles = useThemeStyles();
2323
const {translate} = useLocalize();
2424
const pagerRef = useRef<AttachmentCarouselPagerHandle>(null);
@@ -144,6 +144,7 @@ function AttachmentCarousel({report, source, attachmentID, onNavigate, setDownlo
144144
<AttachmentCarouselPager
145145
items={attachments}
146146
initialPage={page}
147+
attachmentErrors={attachmentErrors}
147148
activeAttachmentID={activeAttachmentID}
148149
setShouldShowArrows={setShouldShowArrows}
149150
onPageSelected={({nativeEvent: {position: newPage}}) => updatePage(newPage)}

0 commit comments

Comments
 (0)