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>
13 lines
381 B
TypeScript
13 lines
381 B
TypeScript
import { createFileRoute, redirect } from "@tanstack/react-router";
|
|
import { RoundScreen } from "../features/round/round-screen";
|
|
import { useGameStore } from "../shared/stores/game-store";
|
|
|
|
export const Route = createFileRoute("/round")({
|
|
beforeLoad: () => {
|
|
if (useGameStore.getState().phase !== "round") {
|
|
throw redirect({ to: "/" });
|
|
}
|
|
},
|
|
component: RoundScreen,
|
|
});
|