Add scrollEnabled
This commit is contained in:
@@ -77,6 +77,7 @@ function ImageViewing({
|
|||||||
FooterComponent,
|
FooterComponent,
|
||||||
}: Props) {
|
}: Props) {
|
||||||
const imageList = useRef<VirtualizedList<ImageSource>>(null)
|
const imageList = useRef<VirtualizedList<ImageSource>>(null)
|
||||||
|
const [isScaled, setIsScaled] = useState(false)
|
||||||
const [opacity, onRequestCloseEnhanced] = useRequestClose(onRequestClose)
|
const [opacity, onRequestCloseEnhanced] = useRequestClose(onRequestClose)
|
||||||
const [currentImageIndex, onScroll] = useImageIndexChange(imageIndex, SCREEN)
|
const [currentImageIndex, onScroll] = useImageIndexChange(imageIndex, SCREEN)
|
||||||
const [headerTransform, footerTransform, toggleBarsVisible] =
|
const [headerTransform, footerTransform, toggleBarsVisible] =
|
||||||
@@ -91,6 +92,7 @@ function ImageViewing({
|
|||||||
const onZoom = useCallback(
|
const onZoom = useCallback(
|
||||||
(isScaled: boolean) => {
|
(isScaled: boolean) => {
|
||||||
toggleBarsVisible(!isScaled)
|
toggleBarsVisible(!isScaled)
|
||||||
|
setIsScaled(isScaled)
|
||||||
},
|
},
|
||||||
[toggleBarsVisible],
|
[toggleBarsVisible],
|
||||||
)
|
)
|
||||||
@@ -135,6 +137,7 @@ function ImageViewing({
|
|||||||
data={images}
|
data={images}
|
||||||
horizontal
|
horizontal
|
||||||
pagingEnabled
|
pagingEnabled
|
||||||
|
scrollEnabled={!isScaled}
|
||||||
showsHorizontalScrollIndicator={false}
|
showsHorizontalScrollIndicator={false}
|
||||||
showsVerticalScrollIndicator={false}
|
showsVerticalScrollIndicator={false}
|
||||||
getItem={(_, index) => images[index]}
|
getItem={(_, index) => images[index]}
|
||||||
|
|||||||
Reference in New Issue
Block a user