@gyjshow/react-native-image-viewing 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -28,6 +28,8 @@ type Props = {
28
28
  FooterComponent?: ComponentType<{
29
29
  imageIndex: number;
30
30
  }>;
31
+ /** 关键新增 */
32
+ modalProps?: Partial<ModalProps>;
31
33
  };
32
34
  declare const EnhancedImageViewing: (props: Props) => React.JSX.Element;
33
35
  export default EnhancedImageViewing;
@@ -18,7 +18,7 @@ const DEFAULT_BG_COLOR = "#000";
18
18
  const DEFAULT_DELAY_LONG_PRESS = 800;
19
19
  const SCREEN = Dimensions.get("screen");
20
20
  const SCREEN_WIDTH = SCREEN.width;
21
- function ImageViewing({ images, keyExtractor, imageIndex, visible, onRequestClose, onLongPress = () => { }, onImageIndexChange, animationType = DEFAULT_ANIMATION_TYPE, backgroundColor = DEFAULT_BG_COLOR, presentationStyle, swipeToCloseEnabled, doubleTapToZoomEnabled, delayLongPress = DEFAULT_DELAY_LONG_PRESS, HeaderComponent, FooterComponent, }) {
21
+ function ImageViewing({ images, keyExtractor, imageIndex, visible, onRequestClose, onLongPress = () => { }, onImageIndexChange, animationType = DEFAULT_ANIMATION_TYPE, backgroundColor = DEFAULT_BG_COLOR, presentationStyle, swipeToCloseEnabled, doubleTapToZoomEnabled, delayLongPress = DEFAULT_DELAY_LONG_PRESS, HeaderComponent, FooterComponent, modalProps, }) {
22
22
  const imageList = useRef(null);
23
23
  const [opacity, onRequestCloseEnhanced] = useRequestClose(onRequestClose);
24
24
  const [currentImageIndex, onScroll] = useImageIndexChange(imageIndex, SCREEN);
@@ -37,7 +37,7 @@ function ImageViewing({ images, keyExtractor, imageIndex, visible, onRequestClos
37
37
  if (!visible) {
38
38
  return null;
39
39
  }
40
- return (<Modal transparent={presentationStyle === "overFullScreen"} visible={visible} presentationStyle={presentationStyle} animationType={animationType} onRequestClose={onRequestCloseEnhanced} supportedOrientations={["portrait"]} hardwareAccelerated>
40
+ return (<Modal transparent={presentationStyle === "overFullScreen"} visible={visible} presentationStyle={presentationStyle} animationType={animationType} onRequestClose={onRequestCloseEnhanced} supportedOrientations={["portrait"]} hardwareAccelerated {...modalProps}>
41
41
  <StatusBarManager presentationStyle={presentationStyle}/>
42
42
  <View style={[styles.container, { opacity, backgroundColor }]}>
43
43
  <Animated.View style={[styles.header, { transform: headerTransform }]}>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gyjshow/react-native-image-viewing",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "\"Enhanced image viewing component for React Native (Fork of react-native-image-viewing)",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",