b3ffb2d4b6
Two-step email + one-time-code sign-in behind both doors; pure entry-routing rule unit- tested with Vitest (§6.8); storefront routing reaches a SLICE-2 signed-in placeholder with sign-out (PUC-9). check.sh now runs the frontend unit tests. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
35 lines
932 B
TypeScript
35 lines
932 B
TypeScript
// SLICE-2 placeholder for the signed-in surfaces (create-storefront, admin) that land in
|
|
// SLICE-3. It honestly states what's next and makes PUC-9 sign-out reachable now. No
|
|
// fabricated capability (INV-9).
|
|
import { logout } from "../api";
|
|
|
|
interface Props {
|
|
email: string;
|
|
created: boolean;
|
|
onSignedOut: () => void;
|
|
}
|
|
|
|
export default function SignedIn({ email, created, onSignedOut }: Props) {
|
|
async function signOut() {
|
|
await logout();
|
|
onSignedOut();
|
|
}
|
|
|
|
return (
|
|
<main>
|
|
<header>
|
|
<strong>ecomm</strong>
|
|
<span>{email}</span>
|
|
<button type="button" onClick={signOut}>
|
|
Sign out
|
|
</button>
|
|
</header>
|
|
<section>
|
|
<h1>{created ? "Welcome to ecomm" : "Welcome back"}</h1>
|
|
<p>You're signed in as {email}.</p>
|
|
<p>Creating your storefront arrives in the next slice. Nothing else is needed yet.</p>
|
|
</section>
|
|
</main>
|
|
);
|
|
}
|