Files
supabase/apps/studio/routes/maintenance.tsx
Alaister YoungandAlaister Young 33ae2caa0d [FE-3106] (part 4) – refactor(studio): move sign-in and standalone page bodies (#53213)
Moves the sign-in and standalone page bodies (`/sign-in`, `/sign-up`,
`/sign-in-sso`, `/sign-in-partner`, `/sign-in-mfa`,
`/sign-in-recovery-code`, `/forgot-password`, `/forgot-password-mfa`,
`/reset-password`, `/cli/login`, `/partners/stripe/projects/login`,
`/authorize`, `/redeem`, `/logout`, `/maintenance`, `/verify-email`,
`/support/csat`, `/mcp/secrets`) into their route files and deletes the
pages (FE-3106). Part 4 of the stack.

**Depends on:** #53212

**Changed:**
- `routes/_auth/**` and the standalone routes – page bodies inlined;
`next/router`/`next/link`/`next/head` → native TanStack (`navigate({ to,
search })`, `search: true` to carry the query, `href` for runtime return
URLs) and inline `<title>`. Layout chains match the old `getLayout`s
- `components/interfaces/CliLogin/CliLoginScreen.tsx` – the CLI login
screen moves out of the page so its test can import it without the route
file exporting it
- `tests/routes/{authorize,_auth/**}.test.tsx` – moved from
`tests/pages/**` and rendered with `renderRoute`

**Removed:**
- 18 page files

Addresses
[FE-3106](https://linear.app/supabase/issue/FE-3106/move-page-bodies-into-route-files-and-delete-pages).

## To test

- Sign out, open `/sign-in` and `/sign-up` – same layout and title;
switching between them keeps `returnTo`
- Sign in with MFA – `/sign-in-mfa` returns to the original page
- `/cli/login?session_id=…` and `/authorize?…` – flows complete as
before
- `/logout` – redirects to `/sign-in`

---------

Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
2026-11-17 14:57:50 +09:00

75 lines
2.3 KiB
TypeScript

import { createFileRoute } from '@tanstack/react-router'
import { RefreshCwIcon } from 'lucide-react'
import { useTheme } from 'next-themes'
import { useMemo } from 'react'
import { Button, cn } from 'ui'
import { BASE_PATH } from '@/lib/constants'
export const Route = createFileRoute('/maintenance')({
component: Maintenance,
})
function Maintenance() {
return (
<div
className={cn(
'flex h-full min-h-screen bg-studio',
'w-full flex-col place-items-center',
'items-center justify-center gap-8 px-5'
)}
>
<MaintenancePage />
</div>
)
}
function MaintenancePage() {
const { resolvedTheme } = useTheme()
const isDarkMode = resolvedTheme?.includes('dark')
const imgUrl = useMemo(
() =>
isDarkMode ? `${BASE_PATH}/img/supabase-dark.svg` : `${BASE_PATH}/img/supabase-light.svg`,
[isDarkMode]
)
return (
<>
<title>Supabase | Under Maintenance</title>
<div className="flex flex-col items-center gap-6 text-center">
<div className="flex items-center justify-center mb-4">
<img src={imgUrl} alt="Supabase" className="h-8" />
</div>
<div className="space-y-1">
<h1 className="text-2xl font-medium text-foreground">Under Maintenance</h1>
<p className="text-foreground-light max-w-xs mx-auto">
We are currently improving our services. The dashboard will be back online shortly.
</p>
</div>
<p className="text-sm text-foreground-lighter max-w-xs mx-auto">
If you need support while the dashboard is inaccessible, you can email us at{' '}
<a
href="mailto:support+maintenance@supabase.io"
className="text-foreground-light underline hover:text-foreground"
>
support+maintenance@supabase.io
</a>
</p>
<div className="flex flex-col items-center gap-2 mt-4">
<p className="text-sm text-foreground-lighter">
Reload the page to check if the maintenance window has ended
</p>
<Button
onClick={() => window.location.reload()}
variant="primary"
icon={<RefreshCwIcon />}
>
Reload
</Button>
</div>
</div>
</>
)
}