File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ area : webapp
3+ type : improvement
4+ ---
5+
6+ Preserve search string when switching between the Users and Organizations tabs in the admin dashboard.
Original file line number Diff line number Diff line change 1- import { Outlet } from "@remix-run/react" ;
1+ import { Outlet , useSearchParams } from "@remix-run/react" ;
22import { typedjson } from "remix-typedjson" ;
33import { LinkButton } from "~/components/primitives/Buttons" ;
44import { Tabs } from "~/components/primitives/Tabs" ;
@@ -10,18 +10,22 @@ export const loader = dashboardLoader(
1010) ;
1111
1212export default function Page ( ) {
13+ const [ searchParams ] = useSearchParams ( ) ;
14+ const search = searchParams . get ( "search" ) ;
15+ const searchSuffix = search ? `?search=${ encodeURIComponent ( search ) } ` : "" ;
16+
1317 return (
1418 < div className = "h-full w-full" >
1519 < div className = "flex items-center justify-between p-4" >
1620 < Tabs
1721 tabs = { [
1822 {
1923 label : "Users" ,
20- to : " /admin" ,
24+ to : ` /admin${ searchSuffix } ` ,
2125 } ,
2226 {
2327 label : "Organizations" ,
24- to : " /admin/orgs" ,
28+ to : ` /admin/orgs${ searchSuffix } ` ,
2529 } ,
2630 {
2731 label : "Concurrency" ,
You can’t perform that action at this time.
0 commit comments