migrate from vanilla TypeScript + Bun bundler to React 19, Vite, TanStack Router, Zustand, shadcn-style components, Tailwind v4, vite-plugin-pwa. game logic moves into a Zustand store, UI into React feature components with file-based routing. all 27 tests pass, biome lint clean. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
16 lines
486 B
TypeScript
16 lines
486 B
TypeScript
import { createFileRoute, redirect } from "@tanstack/react-router";
|
|
import { SetupScreen } from "../features/setup/setup-screen";
|
|
import { useGameStore } from "../shared/stores/game-store";
|
|
|
|
export const Route = createFileRoute("/")({
|
|
beforeLoad: () => {
|
|
const phase = useGameStore.getState().phase;
|
|
if (phase !== "setup") {
|
|
throw redirect({
|
|
to: `/${phase === "round" ? "round" : phase === "discussion" ? "discussion" : "done"}`,
|
|
});
|
|
}
|
|
},
|
|
component: SetupScreen,
|
|
});
|