From 130f39ef8a95b1646bfd930a11bff69e03968876 Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Wed, 22 Nov 2023 08:49:24 +0500 Subject: [PATCH] web: reuse search query --- apps/web/src/components/route-container/index.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/web/src/components/route-container/index.tsx b/apps/web/src/components/route-container/index.tsx index b1ef2f9fc..561a98a73 100644 --- a/apps/web/src/components/route-container/index.tsx +++ b/apps/web/src/components/route-container/index.tsx @@ -67,6 +67,7 @@ function Header(props: RouteContainerProps) { const toggleSideMenu = useStore((store) => store.toggleSideMenu); const isMobile = useMobile(); const isSearching = useSearchStore((store) => store.isSearching); + const query = useSearchStore((store) => store.query); if (isSearching) return ( @@ -81,6 +82,7 @@ function Header(props: RouteContainerProps) { type="text" sx={{ m: 0, flex: 1 }} styles={{ input: { p: "7px" } }} + defaultValue={query} placeholder="Type your query here" onChange={debounce( (e) => useSearchStore.setState({ query: e.target.value }),