fix nook subdomain routing
This commit is contained in:
21
src/routes/checkout.tsx
Normal file
21
src/routes/checkout.tsx
Normal file
@@ -0,0 +1,21 @@
|
||||
import { Switch, Match } from "solid-js";
|
||||
import { useSite } from "~/context/SiteContext";
|
||||
import NotFound from "./[...404]";
|
||||
import NookCheckout from "./nook/checkout";
|
||||
|
||||
/**
|
||||
* Host-aware checkout route — `/checkout`.
|
||||
*
|
||||
* Only The Nook has a checkout flow; all other sites fall back to 404.
|
||||
* Mirrors the dispatch pattern in `src/routes/index.tsx`.
|
||||
*/
|
||||
export default function CheckoutPage() {
|
||||
const site = useSite();
|
||||
return (
|
||||
<Switch fallback={<NotFound />}>
|
||||
<Match when={site().id === "nook"}>
|
||||
<NookCheckout />
|
||||
</Match>
|
||||
</Switch>
|
||||
);
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import NessaLanding from "./nessa";
|
||||
import LineageLanding from "./lineage";
|
||||
import GazeLanding from "./gaze";
|
||||
import InputHaloLanding from "./inputhalo";
|
||||
import NookLanding from "./nook";
|
||||
|
||||
/**
|
||||
* Root route handler.
|
||||
@@ -44,6 +45,9 @@ export default function Home(): JSX.Element {
|
||||
<Match when={site().id === "inputhalo"}>
|
||||
<InputHaloLanding />
|
||||
</Match>
|
||||
<Match when={site().id === "nook"}>
|
||||
<NookLanding />
|
||||
</Match>
|
||||
</Switch>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -4,8 +4,7 @@ import NotFound from "./[...404]";
|
||||
import NessaPrivacyPolicy from "./nessa/privacy";
|
||||
import LineagePrivacyPolicy from "./lineage/privacy";
|
||||
import GazePrivacyPolicy from "./gaze/privacy";
|
||||
import InputHaloPrivacyPolicy from "./inputhalo/privacy";
|
||||
|
||||
import NookPrivacyPolicy from "./nook/privacy";
|
||||
/**
|
||||
* Host-aware privacy policy route — `/privacy`.
|
||||
*
|
||||
@@ -41,6 +40,9 @@ export default function PrivacyPage() {
|
||||
<Match when={site().id === "inputhalo"}>
|
||||
<InputHaloPrivacyPolicy />
|
||||
</Match>
|
||||
<Match when={site().id === "nook"}>
|
||||
<NookPrivacyPolicy />
|
||||
</Match>
|
||||
</Switch>
|
||||
);
|
||||
}
|
||||
|
||||
21
src/routes/success.tsx
Normal file
21
src/routes/success.tsx
Normal file
@@ -0,0 +1,21 @@
|
||||
import { Switch, Match } from "solid-js";
|
||||
import { useSite } from "~/context/SiteContext";
|
||||
import NotFound from "./[...404]";
|
||||
import NookSuccess from "./nook/success";
|
||||
|
||||
/**
|
||||
* Host-aware success route — `/success`.
|
||||
*
|
||||
* Only The Nook has a post-checkout success page; all other sites fall
|
||||
* back to 404. Mirrors the dispatch pattern in `src/routes/index.tsx`.
|
||||
*/
|
||||
export default function SuccessPage() {
|
||||
const site = useSite();
|
||||
return (
|
||||
<Switch fallback={<NotFound />}>
|
||||
<Match when={site().id === "nook"}>
|
||||
<NookSuccess />
|
||||
</Match>
|
||||
</Switch>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user