mirror of
https://github.com/movie-web/native-app.git
synced 2025-09-13 18:13:25 +00:00
Compare commits
1 Commits
85ab358a13
...
0ff855ce2a
Author | SHA1 | Date | |
---|---|---|---|
|
0ff855ce2a |
@@ -1,5 +1,5 @@
|
|||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { Keyboard } from "react-native";
|
import { Keyboard, ScrollView } from "react-native";
|
||||||
import Animated, {
|
import Animated, {
|
||||||
Easing,
|
Easing,
|
||||||
useAnimatedStyle,
|
useAnimatedStyle,
|
||||||
@@ -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, ZStack } from "tamagui";
|
import { View, XStack } from "tamagui";
|
||||||
|
|
||||||
import { getMediaPoster, searchTitle } from "@movie-web/tmdb";
|
import { getMediaPoster, searchTitle } from "@movie-web/tmdb";
|
||||||
|
|
||||||
@@ -98,8 +98,9 @@ export default function SearchScreen() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ZStack flex={1}>
|
<ScreenLayout>
|
||||||
<ScreenLayout
|
<XStack flex={1}>
|
||||||
|
<ScrollView
|
||||||
onScrollBeginDrag={handleScrollBegin}
|
onScrollBeginDrag={handleScrollBegin}
|
||||||
onMomentumScrollEnd={handleScrollEnd}
|
onMomentumScrollEnd={handleScrollEnd}
|
||||||
scrollEnabled={searchResultsLoaded ? true : false}
|
scrollEnabled={searchResultsLoaded ? true : false}
|
||||||
@@ -123,12 +124,12 @@ export default function SearchScreen() {
|
|||||||
</View>
|
</View>
|
||||||
</Animated.View>
|
</Animated.View>
|
||||||
</View>
|
</View>
|
||||||
</ScreenLayout>
|
</ScrollView>
|
||||||
<Animated.View
|
<Animated.View
|
||||||
style={[
|
style={[
|
||||||
{
|
{
|
||||||
position: "absolute",
|
position: "absolute",
|
||||||
bottom: 5,
|
bottom: 0,
|
||||||
left: 0,
|
left: 0,
|
||||||
right: 0,
|
right: 0,
|
||||||
},
|
},
|
||||||
@@ -137,7 +138,8 @@ export default function SearchScreen() {
|
|||||||
>
|
>
|
||||||
<SearchBar onSearchChange={setQuery} />
|
<SearchBar onSearchChange={setQuery} />
|
||||||
</Animated.View>
|
</Animated.View>
|
||||||
</ZStack>
|
</XStack>
|
||||||
|
</ScreenLayout>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -5,23 +5,9 @@ import { Header } from "./Header";
|
|||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
children?: React.ReactNode;
|
children?: React.ReactNode;
|
||||||
onScrollBeginDrag?: () => void;
|
|
||||||
onMomentumScrollEnd?: () => void;
|
|
||||||
scrollEnabled?: boolean;
|
|
||||||
keyboardDismissMode?: "none" | "on-drag" | "interactive";
|
|
||||||
keyboardShouldPersistTaps?: "always" | "never" | "handled";
|
|
||||||
contentContainerStyle?: Record<string, unknown>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function ScreenLayout({
|
export default function ScreenLayout({ children }: Props) {
|
||||||
children,
|
|
||||||
onScrollBeginDrag,
|
|
||||||
onMomentumScrollEnd,
|
|
||||||
scrollEnabled,
|
|
||||||
keyboardDismissMode,
|
|
||||||
keyboardShouldPersistTaps,
|
|
||||||
contentContainerStyle,
|
|
||||||
}: Props) {
|
|
||||||
return (
|
return (
|
||||||
<LinearGradient
|
<LinearGradient
|
||||||
flex={1}
|
flex={1}
|
||||||
@@ -41,12 +27,6 @@ export default function ScreenLayout({
|
|||||||
>
|
>
|
||||||
<Header />
|
<Header />
|
||||||
<ScrollView
|
<ScrollView
|
||||||
onScrollBeginDrag={onScrollBeginDrag}
|
|
||||||
onMomentumScrollEnd={onMomentumScrollEnd}
|
|
||||||
scrollEnabled={scrollEnabled}
|
|
||||||
keyboardDismissMode={keyboardDismissMode}
|
|
||||||
keyboardShouldPersistTaps={keyboardShouldPersistTaps}
|
|
||||||
contentContainerStyle={contentContainerStyle}
|
|
||||||
marginTop="$4"
|
marginTop="$4"
|
||||||
flexGrow={1}
|
flexGrow={1}
|
||||||
showsVerticalScrollIndicator={false}
|
showsVerticalScrollIndicator={false}
|
||||||
|
Reference in New Issue
Block a user