fix: use zstack to keep searchbar visible on search screen

This commit is contained in:
Adrian Castro
2024-04-02 01:25:59 +02:00
parent 6a4a19a41c
commit 07b9f7cd4b

View File

@@ -7,7 +7,7 @@ import Animated, {
withTiming, withTiming,
} from "react-native-reanimated"; } from "react-native-reanimated";
import { useQuery } from "@tanstack/react-query"; import { useQuery } from "@tanstack/react-query";
import { View } from "tamagui"; import { View, XStack } from "tamagui";
import { getMediaPoster, searchTitle } from "@movie-web/tmdb"; import { getMediaPoster, searchTitle } from "@movie-web/tmdb";
@@ -99,6 +99,7 @@ export default function SearchScreen() {
return ( return (
<ScreenLayout> <ScreenLayout>
<XStack flex={1}>
<ScrollView <ScrollView
onScrollBeginDrag={handleScrollBegin} onScrollBeginDrag={handleScrollBegin}
onMomentumScrollEnd={handleScrollEnd} onMomentumScrollEnd={handleScrollEnd}
@@ -127,7 +128,7 @@ export default function SearchScreen() {
<Animated.View <Animated.View
style={[ style={[
{ {
position: "relative", position: "absolute",
bottom: 0, bottom: 0,
left: 0, left: 0,
right: 0, right: 0,
@@ -137,6 +138,7 @@ export default function SearchScreen() {
> >
<SearchBar onSearchChange={setQuery} /> <SearchBar onSearchChange={setQuery} />
</Animated.View> </Animated.View>
</XStack>
</ScreenLayout> </ScreenLayout>
); );
} }