mirror of
https://github.com/tooot-app/app
synced 2025-06-05 22:19:13 +02:00
Prevent going back when zoomed
This commit is contained in:
41
patches/react-native-reanimated-zoom+0.3.2.patch
Normal file
41
patches/react-native-reanimated-zoom+0.3.2.patch
Normal file
@ -0,0 +1,41 @@
|
||||
diff --git a/node_modules/react-native-reanimated-zoom/lib/typescript/zoom.d.ts b/node_modules/react-native-reanimated-zoom/lib/typescript/zoom.d.ts
|
||||
index 38fb6f1..e93c288 100644
|
||||
--- a/node_modules/react-native-reanimated-zoom/lib/typescript/zoom.d.ts
|
||||
+++ b/node_modules/react-native-reanimated-zoom/lib/typescript/zoom.d.ts
|
||||
@@ -6,6 +6,7 @@ declare type Props = {
|
||||
minimumZoomScale?: number;
|
||||
maximumZoomScale?: number;
|
||||
simultaneousGesture?: GestureType;
|
||||
+ isZoomed?: SharedValue<boolean>;
|
||||
} & ViewProps;
|
||||
export declare function Zoom(props: Props): JSX.Element;
|
||||
export {};
|
||||
diff --git a/node_modules/react-native-reanimated-zoom/src/zoom.tsx b/node_modules/react-native-reanimated-zoom/src/zoom.tsx
|
||||
index e07b415..d57a1eb 100644
|
||||
--- a/node_modules/react-native-reanimated-zoom/src/zoom.tsx
|
||||
+++ b/node_modules/react-native-reanimated-zoom/src/zoom.tsx
|
||||
@@ -7,6 +7,7 @@ import Animated, {
|
||||
withTiming,
|
||||
cancelAnimation,
|
||||
runOnJS,
|
||||
+ SharedValue,
|
||||
} from 'react-native-reanimated';
|
||||
import {
|
||||
Gesture,
|
||||
@@ -20,6 +21,7 @@ type Props = {
|
||||
minimumZoomScale?: number;
|
||||
maximumZoomScale?: number;
|
||||
simultaneousGesture?: GestureType;
|
||||
+ isZoomed?: SharedValue<boolean>;
|
||||
} & ViewProps;
|
||||
|
||||
export function Zoom(props: Props) {
|
||||
@@ -39,7 +41,7 @@ export function Zoom(props: Props) {
|
||||
const originY = useSharedValue(0);
|
||||
const scale = useSharedValue(1);
|
||||
const isPinching = useSharedValue(false);
|
||||
- const isZoomed = useSharedValue(false);
|
||||
+ const isZoomed = props.isZoomed || useSharedValue(false);
|
||||
const viewHeight = useSharedValue(0);
|
||||
const viewWidth = useSharedValue(0);
|
||||
|
Reference in New Issue
Block a user