initial commit

This commit is contained in:
Sone
2026-05-19 18:46:16 +02:00
parent a92d70ca74
commit 7e67fa8ea0
33 changed files with 6316 additions and 3952 deletions
+5 -5
View File
@@ -2,9 +2,9 @@ import { useEffect, useState, useCallback, useMemo } from "react";
import { View, Text, FlatList } from "react-native";
import { useLocalSearchParams, router } from "expo-router";
import { ActivityIndicator } from "react-native-paper";
import { useAppSelector } from "@/store/hooks";
import { selectIsMobile } from "@/store/screen/screenSizeSlice";
import { SearchResult, useGlobalSearchQuery } from "@/store/api/searchApi";
import { SearchBar } from "@/components/ui/SearchBar";
import { SizeEnum } from "@/constants/sizeEnum";
@@ -31,7 +31,7 @@ const SearchPage = () => {
skip: !debouncedQ || debouncedQ.trim().length < 2,
refetchOnMountOrArgChange: true,
refetchOnFocus: true,
}
},
);
const results = useMemo(() => data?.results ?? [], [data?.results]);
@@ -42,7 +42,7 @@ const SearchPage = () => {
}, []);
const isExpanded = useCallback(
(id: string) => !!expandedIds[id],
[expandedIds]
[expandedIds],
);
// Reset expansions when new query results arrive
@@ -68,7 +68,7 @@ const SearchPage = () => {
? new Date(item.createdAt).toLocaleString()
: null,
})),
[results]
[results],
);
const renderResult = useCallback(
@@ -79,7 +79,7 @@ const SearchPage = () => {
onToggle={toggleExpanded}
/>
),
[isExpanded, toggleExpanded]
[isExpanded, toggleExpanded],
);
return (