Skip to content

Commit 49797c2

Browse files
committed
fix: ImageViewer padding
1 parent 20a18e0 commit 49797c2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

app/containers/ImageViewer/ImageViewer.tsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React, { useState } from 'react';
22
import { LayoutChangeEvent, StyleSheet, StyleProp, ViewStyle, View } from 'react-native';
3-
import { useSafeAreaInsets } from 'react-native-safe-area-context';
43
import { Gesture, GestureDetector } from 'react-native-gesture-handler';
54
import Animated, { withTiming, useSharedValue, useAnimatedStyle, withSpring } from 'react-native-reanimated';
65
import { Image, ImageStyle } from 'expo-image';
@@ -110,9 +109,9 @@ export const ImageViewer = ({ uri = '', width, height, ...props }: ImageViewerPr
110109
const gesture = Gesture.Simultaneous(pinchGesture, panGesture, doubleTapGesture);
111110

112111
const { colors } = useTheme();
113-
const { right, left } = useSafeAreaInsets();
112+
114113
return (
115-
<View style={[styles.flex, { width: width - right - left, height, backgroundColor: colors.surfaceNeutral }]}>
114+
<View style={[styles.flex, { width, height, backgroundColor: colors.surfaceNeutral }]}>
116115
<GestureDetector gesture={gesture}>
117116
<Animated.View onLayout={onLayout} style={[styles.flex, style]}>
118117
<Image

app/views/ShareView/Preview.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ const Preview = React.memo(({ item, theme, length }: IPreview) => {
9898
}
9999

100100
if (type?.match(/image/)) {
101-
return <ImageViewer uri={item.path} width={width} height={calculatedHeight} />;
101+
const imageViewerWidth = width - insets.left - insets.right;
102+
return <ImageViewer uri={item.path} width={imageViewerWidth} height={calculatedHeight} />;
102103
}
103104

104105
return (

0 commit comments

Comments
 (0)