feat(ui): add app shell, router, and base path handling
Base path comes from BUN_PUBLIC_BASE_PATH so the same bundle serves both a root Docker deploy and a GitHub Pages subpath. Deviation from the task-16 brief: does not install @happy-dom/global-registrator, does not create test/setup.ts, and does not add a [test] preload to bunfig.toml. A global DOM preload would make src/domain/smoke.test.ts's "importable without a DOM" assertion vacuously true, silently retiring the check that guards the domain-layer-stays-pure invariant. Nothing in this task needs a DOM: basePath.test.ts is pure string logic, and the shell render test was intentionally omitted by the brief itself. A later task will register happy-dom per-file where a DOM is genuinely required.
This commit is contained in:
1 parent
69bf4393fb
commit
7edcc7f31e
14 files changed
+168
-14
No files matched your search
@@ -0,0 +1,6 @@
|
||||
import { useParams } from "react-router";
|
||||
|
||||
export function MonthRoute() {
|
||||
const { monthId } = useParams();
|
||||
return <h1 className="text-2xl font-semibold">{monthId}</h1>;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import { useParams } from "react-router";
|
||||
|
||||
export function PostMonthRoute() {
|
||||
const { postId, monthId } = useParams();
|
||||
return (
|
||||
<h1 className="text-2xl font-semibold">
|
||||
Post {postId} — {monthId}
|
||||
</h1>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import { useParams } from "react-router";
|
||||
|
||||
export function PostYearRoute() {
|
||||
const { postId, year } = useParams();
|
||||
return (
|
||||
<h1 className="text-2xl font-semibold">
|
||||
Post {postId} — Year {year}
|
||||
</h1>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export function SettingsRoute() {
|
||||
return <h1 className="text-2xl font-semibold">Settings</h1>;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export function SummaryRoute() {
|
||||
return <h1 className="text-2xl font-semibold">Summary</h1>;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import { useParams } from "react-router";
|
||||
|
||||
export function YearRoute() {
|
||||
const { year } = useParams();
|
||||
return <h1 className="text-2xl font-semibold">Year {year}</h1>;
|
||||
}
|
||||
Reference in new issue
Block a user