feat: wrap all authenticated pages in DashboardShell, fix site card actions

- Move DashboardShell wrapping to layout-content.tsx for all dashboard
  pages (home, integrations, pricing) instead of per-page
- GlassTopBar derives page title from pathname (Integrations, Pricing)
- Site card: gear icon now opens site settings, separate trash icon for delete
This commit is contained in:
Usman Baig
2026-03-28 19:35:23 +01:00
parent 45c518b3ba
commit c36c1b0696
4 changed files with 40 additions and 11 deletions

View File

@@ -28,6 +28,18 @@ function usePageTitle() {
return PAGE_TITLES[segment] ?? (segment ? segment.charAt(0).toUpperCase() + segment.slice(1) : 'Dashboard')
}
const HOME_PAGE_TITLES: Record<string, string> = {
'': 'Your Sites',
integrations: 'Integrations',
pricing: 'Pricing',
}
function useHomePageTitle() {
const pathname = usePathname()
const segment = pathname.split('/').filter(Boolean)[0] ?? ''
return HOME_PAGE_TITLES[segment] ?? (segment ? segment.charAt(0).toUpperCase() + segment.slice(1) : 'Your Sites')
}
// Load sidebar only on the client — prevents SSR flash
const Sidebar = dynamic(() => import('./Sidebar'), {
ssr: false,
@@ -58,7 +70,8 @@ function GlassTopBar({ siteId }: { siteId: string | null }) {
}, [realtime])
const dashboardTitle = usePageTitle()
const pageTitle = siteId ? dashboardTitle : 'Your Sites'
const homeTitle = useHomePageTitle()
const pageTitle = siteId ? dashboardTitle : homeTitle
return (
<div className="hidden md:flex items-center justify-between shrink-0 px-3 pt-1.5 pb-1">