fix(mobile): update navigation handling in SearchFeed and SearchList components
- Changed navigation method from `pushControllerView` to `presentControllerView` for better user experience. - Added `itemStyle` prop with `ItemPressableStyle.Plain` to `ItemPressable` in both components for consistent styling. These updates enhance the navigation flow and visual consistency within the search functionality of the mobile application. Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
@@ -9,6 +9,7 @@ import Animated, { FadeInUp } from "react-native-reanimated"
|
||||
|
||||
import { FeedIcon } from "@/src/components/ui/icon/feed-icon"
|
||||
import { Image } from "@/src/components/ui/image/Image"
|
||||
import { ItemPressableStyle } from "@/src/components/ui/pressable/enum"
|
||||
import { ItemPressable } from "@/src/components/ui/pressable/ItemPressable"
|
||||
import { apiClient } from "@/src/lib/api-fetch"
|
||||
import { useNavigation } from "@/src/lib/navigation/hooks"
|
||||
@@ -69,10 +70,11 @@ const SearchFeedItem: FC<ListRenderItemInfo<SearchResultItem>> = ({ item }) => {
|
||||
return (
|
||||
<Animated.View entering={FadeInUp}>
|
||||
<ItemPressable
|
||||
itemStyle={ItemPressableStyle.Plain}
|
||||
className="py-4"
|
||||
onPress={() => {
|
||||
if (item.feed?.id) {
|
||||
navigation.pushControllerView(FollowScreen, {
|
||||
navigation.presentControllerView(FollowScreen, {
|
||||
id: item.feed.id,
|
||||
type: "feed",
|
||||
})
|
||||
|
||||
@@ -5,6 +5,7 @@ import { Text, View } from "react-native"
|
||||
|
||||
import { FallbackIcon } from "@/src/components/ui/icon/fallback-icon"
|
||||
import { Image } from "@/src/components/ui/image/Image"
|
||||
import { ItemPressableStyle } from "@/src/components/ui/pressable/enum"
|
||||
import { ItemPressable } from "@/src/components/ui/pressable/ItemPressable"
|
||||
import { apiClient } from "@/src/lib/api-fetch"
|
||||
import { useNavigation } from "@/src/lib/navigation/hooks"
|
||||
@@ -62,10 +63,11 @@ const SearchListCard = memo(({ item }: { item: SearchResultItem }) => {
|
||||
const navigation = useNavigation()
|
||||
return (
|
||||
<ItemPressable
|
||||
itemStyle={ItemPressableStyle.Plain}
|
||||
className="py-2"
|
||||
onPress={() => {
|
||||
if (item.list?.id) {
|
||||
navigation.pushControllerView(FollowScreen, {
|
||||
navigation.presentControllerView(FollowScreen, {
|
||||
id: item.list.id,
|
||||
type: "list",
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user