Files
elegalsoftware/apps/web/src/components/app/AppLayout.tsx
T
Leon SerfatyandClaude Fable 5 d9b807662a
CI / build-and-test (push) Has been cancelled
Add e2e auth test suite, retention crons, and email-verification UX
- E2E suite (23 tests, `npm run test:e2e -w @lawdesk/api`): boots the real
  Fastify app against a disposable Dockerized Postgres (never a real DB) and
  covers signup/login/lockout/rate limits, CSRF (incl. forged-token
  rejection), logout, password reset, email verification, the superadmin
  verified-email promotion gate, and cross-firm tenancy isolation
- packages/db: DATABASE_SSL=disable opt-out for local/test databases that
  don't speak TLS; refused in production
- retention-sweep.ts cron enforcing Privacy Policy windows (sessions,
  tokens, login attempts, tool usage, contact messages, audit log) +
  sweep-orphaned-storage.ts Spaces reconciliation + scripts/README
- Expose emailVerified on the session user; in-app verify-email banner
  with resend, and verified=1|0 toasts on the login page
- Silence Fastify logger under NODE_ENV=test; fix footer resource link;
  document login-attempt/tool-usage retention in the Privacy Policy

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 14:32:55 -04:00

51 lines
1.3 KiB
TypeScript

import { Navigate, Outlet } from 'react-router-dom';
import { useMe } from '@/hooks/useAuth';
import { Sidebar } from './Sidebar';
import { Topbar } from './Topbar';
import { VerifyEmailBanner } from './VerifyEmailBanner';
export function AppLayout() {
const me = useMe();
if (me.isLoading) {
return <div className="min-h-screen grid place-items-center text-sm text-ink-500">Loading</div>;
}
if (!me.data) {
return <Navigate to="/login" replace />;
}
return (
<div className="min-h-screen flex bg-ink-50">
<Sidebar />
<div className="flex-1 flex flex-col min-w-0">
<Topbar />
<VerifyEmailBanner />
<main className="flex-1 overflow-y-auto">
<Outlet />
</main>
</div>
</div>
);
}
export function PageHeader({
title,
description,
action,
}: {
title: string;
description?: React.ReactNode;
action?: React.ReactNode;
}) {
return (
<div className="flex flex-col gap-3 md:flex-row md:items-end md:justify-between mb-6">
<div>
<h1 className="text-2xl font-bold text-ink-950 font-display">{title}</h1>
{description && <p className="mt-1 text-sm text-ink-600">{description}</p>}
</div>
{action && <div className="flex items-center gap-2">{action}</div>}
</div>
);
}