Add lightbox handling for menu bar taps
This commit is contained in:
@@ -5,6 +5,7 @@ import Animated, {
|
|||||||
useAnimatedScrollHandler,
|
useAnimatedScrollHandler,
|
||||||
} from 'react-native-reanimated'
|
} from 'react-native-reanimated'
|
||||||
|
|
||||||
|
import {useLightbox} from '#/state/lightbox'
|
||||||
import {atoms as a, useTheme, web} from '#/alf'
|
import {atoms as a, useTheme, web} from '#/alf'
|
||||||
import {useListScrollContext} from '#/components/List/ListScrollProvider'
|
import {useListScrollContext} from '#/components/List/ListScrollProvider'
|
||||||
|
|
||||||
@@ -41,6 +42,7 @@ export const List = forwardRef(function List<Item>(
|
|||||||
ref: React.Ref<FlatList<Item>>,
|
ref: React.Ref<FlatList<Item>>,
|
||||||
) {
|
) {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
|
const {activeLightbox} = useLightbox()
|
||||||
const scrollHandlers = useListScrollContext()
|
const scrollHandlers = useListScrollContext()
|
||||||
const onScroll = useAnimatedScrollHandler({
|
const onScroll = useAnimatedScrollHandler({
|
||||||
onScroll(e, ctx) {
|
onScroll(e, ctx) {
|
||||||
@@ -126,6 +128,7 @@ export const List = forwardRef(function List<Item>(
|
|||||||
contentOffset={
|
contentOffset={
|
||||||
props.headerOffset ? {x: 0, y: props.headerOffset * -1} : undefined
|
props.headerOffset ? {x: 0, y: props.headerOffset * -1} : undefined
|
||||||
}
|
}
|
||||||
|
scrollsToTop={!activeLightbox}
|
||||||
{...(props as FlatListPropsWithLayout<Item>)}
|
{...(props as FlatListPropsWithLayout<Item>)}
|
||||||
style={[
|
style={[
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user