Remove unused onImageIndexChange
This commit is contained in:
@@ -12,7 +12,6 @@ import React, {
|
|||||||
ComponentType,
|
ComponentType,
|
||||||
useCallback,
|
useCallback,
|
||||||
useRef,
|
useRef,
|
||||||
useEffect,
|
|
||||||
useMemo,
|
useMemo,
|
||||||
useState,
|
useState,
|
||||||
} from 'react'
|
} from 'react'
|
||||||
@@ -41,7 +40,6 @@ type Props = {
|
|||||||
imageIndex: number
|
imageIndex: number
|
||||||
visible: boolean
|
visible: boolean
|
||||||
onRequestClose: () => void
|
onRequestClose: () => void
|
||||||
onImageIndexChange?: (imageIndex: number) => void
|
|
||||||
presentationStyle?: ModalProps['presentationStyle']
|
presentationStyle?: ModalProps['presentationStyle']
|
||||||
animationType?: ModalProps['animationType']
|
animationType?: ModalProps['animationType']
|
||||||
backgroundColor?: string
|
backgroundColor?: string
|
||||||
@@ -59,7 +57,6 @@ function ImageViewing({
|
|||||||
imageIndex,
|
imageIndex,
|
||||||
visible,
|
visible,
|
||||||
onRequestClose,
|
onRequestClose,
|
||||||
onImageIndexChange,
|
|
||||||
backgroundColor = DEFAULT_BG_COLOR,
|
backgroundColor = DEFAULT_BG_COLOR,
|
||||||
HeaderComponent,
|
HeaderComponent,
|
||||||
FooterComponent,
|
FooterComponent,
|
||||||
@@ -70,12 +67,6 @@ function ImageViewing({
|
|||||||
const [headerTransform, footerTransform, toggleBarsVisible] =
|
const [headerTransform, footerTransform, toggleBarsVisible] =
|
||||||
useAnimatedComponents()
|
useAnimatedComponents()
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (onImageIndexChange) {
|
|
||||||
onImageIndexChange(currentImageIndex)
|
|
||||||
}
|
|
||||||
}, [currentImageIndex, onImageIndexChange])
|
|
||||||
|
|
||||||
const onZoom = useCallback(
|
const onZoom = useCallback(
|
||||||
(isScaled: boolean) => {
|
(isScaled: boolean) => {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
|
|||||||
Reference in New Issue
Block a user