Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions 6 .server-changes/admin-tabs-preserve-search.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
area: webapp
type: improvement
---

Preserve search string when switching between the Users and Organizations tabs in the admin dashboard.
10 changes: 7 additions & 3 deletions 10 apps/webapp/app/routes/admin.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Outlet } from "@remix-run/react";
import { Outlet, useSearchParams } from "@remix-run/react";
import { typedjson } from "remix-typedjson";
import { LinkButton } from "~/components/primitives/Buttons";
import { Tabs } from "~/components/primitives/Tabs";
Expand All @@ -10,18 +10,22 @@ export const loader = dashboardLoader(
);

export default function Page() {
const [searchParams] = useSearchParams();
const search = searchParams.get("search");
const searchSuffix = search ? `?search=${encodeURIComponent(search)}` : "";

return (
<div className="h-full w-full">
<div className="flex items-center justify-between p-4">
<Tabs
tabs={[
{
label: "Users",
to: "/admin",
to: `/admin${searchSuffix}`,
},
{
label: "Organizations",
to: "/admin/orgs",
to: `/admin/orgs${searchSuffix}`,
},
{
label: "Concurrency",
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.