feat(ux): accessible confirm dialog replaces window.confirm
- new components/ui/confirm.tsx: ConfirmProvider + useConfirm() built on the existing Radix alert-dialog (focus trap, ESC, aria for free) - wired once into the app layout - all 13 native window.confirm() delete/remove guards now use the styled, accessible confirm with a destructive action button
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { createClient } from '@/lib/supabase/server'
|
||||
import { redirect } from 'next/navigation'
|
||||
import { AppSidebar } from '@/components/app-sidebar'
|
||||
import { ConfirmProvider } from '@/components/ui/confirm'
|
||||
import { getRoleLabelMap } from '@/lib/role-labels'
|
||||
|
||||
// This layout is the auth/onboarding gate for the whole app. It must never be
|
||||
@@ -56,6 +57,7 @@ export default async function AppLayout({ children }: { children: React.ReactNod
|
||||
const roleName = roleMap[member.role]?.name ?? member.role
|
||||
|
||||
return (
|
||||
<ConfirmProvider>
|
||||
<div className="flex h-screen bg-background overflow-hidden">
|
||||
<a
|
||||
href="#main-content"
|
||||
@@ -83,5 +85,6 @@ export default async function AppLayout({ children }: { children: React.ReactNod
|
||||
)}
|
||||
</main>
|
||||
</div>
|
||||
</ConfirmProvider>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user