mirror of
https://github.com/supabase/supabase.git
synced 2026-12-06 08:29:01 +00:00
Gives the `/org/_/…` and `/project/_/…` catch-alls proper TanStack routes and deletes `pages/org/_/[[...routeSlug]].tsx` and `pages/project/_/[[...routeSlug]].tsx` (FE-3106). They show an org or project picker whose links forward the trailing path and the query string (and, for projects, the hash) to the real org or project. Part 12 of the stack. **Depends on:** #53220 **Changed:** - `components/interfaces/Organization/SelectOrganizationPage.tsx`, `components/interfaces/Home/ProjectList/SelectProjectPage.tsx` – the picker bodies. The trailing path and query string come from `useLocation()` (repeated query keys survive): the splat routes nest under the `/org/_` and `/project/_` routes, which render the picker with no `<Outlet>`, so the picker can't rely on its own route's `_splat` - `routes/{org,project}.[_].tsx`, `routes/{org,project}.[_].$.tsx` – render the pickers - `tests/routes/org.[_].$.test.tsx` – covers path and query forwarding **Removed:** - both catch-all pages, and `parseCatchAllRoute` from `compat/next/router.ts` Addresses [FE-3106](https://linear.app/supabase/issue/FE-3106/move-page-bodies-into-route-files-and-delete-pages). ## To test - `/project/_/database/tables?schema=auth#x` – pick a project, lands on `/project/<ref>/database/tables?schema=auth#x` - `/org/_/billing?panel=x` – pick an org, lands on `/org/<slug>/billing?panel=x` - `/org/_` and `/project/_` – pickers link to the org or project home --------- Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
17 lines
615 B
TypeScript
17 lines
615 B
TypeScript
import { createFileRoute } from '@tanstack/react-router'
|
|
|
|
import { SelectProjectPage } from '@/components/interfaces/Home/ProjectList/SelectProjectPage'
|
|
|
|
export const Route = createFileRoute('/project/_')({
|
|
component: ProjectWildcardIndexRoute,
|
|
})
|
|
|
|
// Matches `/project/_`, and is also the parent of the splat route in
|
|
// `project.[_].$.tsx` (`/project/_/...`). It renders no `<Outlet>`, so this
|
|
// component renders for both. See `org.[_].tsx` for
|
|
// why this is named with the path-as-filename form rather than
|
|
// `project/[_]/index.tsx`.
|
|
function ProjectWildcardIndexRoute() {
|
|
return <SelectProjectPage />
|
|
}
|