feat(app): sheet draft editor route, modes, recovery offer and conflict dialog

This commit is contained in:
bchanot committed 2026-11-04 12:35:33 +01:00
1 parent b14509f221
commit 6aba9711f0
44 files changed
+3143 -13

No files matched your search

+6 -2
View File
@@ -1,5 +1,5 @@
import { useState, type MouseEvent } from 'react'
import { Link, Outlet, useLocation, useNavigate } from 'react-router-dom'
import { Link, Outlet, matchPath, useLocation, useNavigate } from 'react-router-dom'
import Brand from '@/components/brand/Brand'
import LanguageSwitcher from '@/components/brand/LanguageSwitcher'
import Button from '@/components/ui/Button'
@@ -13,6 +13,9 @@ import { useAuthStore } from '@/state/authStore'
import { useLeaveGuardStore } from '@/state/leaveGuardStore'
import { useT } from '@/i18n/useT'
/** The draft editor takes the whole width (board 04's three columns). */
const DRAFT_EDITOR_PATH = '/app/admin/sheets/:sheetId/draft'
/** Title of the current /app page for the top bar, from the nav table. */
function pageTitleKey(pathname: string): string {
const match = NAV_ITEMS.find((item) =>
@@ -64,6 +67,7 @@ export default function AppLayout() {
}
const profile = useAuthStore((s) => s.profile)
const user = useAuthStore((s) => s.user)
const fullWidth = matchPath(DRAFT_EDITOR_PATH, location.pathname) !== null
const displayName = profile?.display_name ?? user?.email ?? ''
return (
@@ -114,7 +118,7 @@ export default function AppLayout() {
</div>
</header>
<main className="flex-1 px-4 py-6 sm:px-8 sm:py-8">
<div className="mx-auto w-full max-w-4xl">
<div className={`mx-auto w-full ${fullWidth ? '' : 'max-w-4xl'}`}>
<Outlet />
</div>
</main>