diff --git a/README.md b/README.md index 9ecf0cb..e1e2298 100644 --- a/README.md +++ b/README.md @@ -251,6 +251,23 @@ command and `npx opennextjs-cloudflare deploy` as the deploy command. Set the the bundle at build time, and set `SEATLAYER_SECRET_KEY` as a secret on the worker. +`npm run deploy` creates your own Worker named `seatlayer-nextjs-example`, with +no custom domain. Rename it in `wrangler.jsonc` if you like. + +### Hosting our copy + +The live demo at examples.seatlayer.io is this repository deployed with the +`hosted` environment in `wrangler.jsonc`, which sets the Worker name +`seatlayer-examples`, the custom domain and the matching +`WORKER_SELF_REFERENCE` service: + +```sh +npm run deploy:hosted +``` + +Its `NEXT_PUBLIC_` variables are set at build time and `SEATLAYER_SECRET_KEY` +is a Worker secret. You do not need this environment for your own copy. + Two extras help when the examples are shown inside another page: - Add `?embed=1` to any route to hide the navigation and the route heading, so diff --git a/app/globals.css b/app/globals.css index 94cbf31..9f64eb3 100644 --- a/app/globals.css +++ b/app/globals.css @@ -83,6 +83,12 @@ h2 { min-height: 420px; } +/* The season picker draws its offer and steps above the map, so it takes the + height it needs instead of the fixed map height. */ +.seatmap.seatmap--season { + height: auto; +} + .seat-list { list-style: none; margin: 0 0 12px; diff --git a/components/SeasonWidget.tsx b/components/SeasonWidget.tsx index b6d47b8..3ecb2f8 100644 --- a/components/SeasonWidget.tsx +++ b/components/SeasonWidget.tsx @@ -30,7 +30,7 @@ export const SeasonWidget = forwardRef(fu season={seasonKey} publicKey={publicKey} maxSelection={4} - className="seatmap" + className="seatmap seatmap--season" offer={{ eyebrow: "2027 membership", priceLabel: "From $480", diff --git a/package.json b/package.json index f788dd7..58f3f05 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "start": "next start", "preview": "opennextjs-cloudflare build && opennextjs-cloudflare preview", "deploy": "opennextjs-cloudflare build && opennextjs-cloudflare deploy", + "deploy:hosted": "opennextjs-cloudflare build && opennextjs-cloudflare deploy --env hosted", "cf-typegen": "wrangler types --env-interface CloudflareEnv cloudflare-env.d.ts" }, "dependencies": { diff --git a/wrangler.jsonc b/wrangler.jsonc index f78df74..2474bf5 100644 --- a/wrangler.jsonc +++ b/wrangler.jsonc @@ -1,13 +1,14 @@ { // Cloudflare Workers configuration for the OpenNext adapter. // Guide: https://opennext.js.org/cloudflare/get-started + // `npm run deploy` deploys your own copy under the name below, with no custom + // domain. The "hosted" environment is the SeatLayer copy on + // examples.seatlayer.io; you do not need it. "$schema": "node_modules/wrangler/config-schema.json", - "name": "seatlayer-examples", + "name": "seatlayer-nextjs-example", "main": ".open-next/worker.js", "compatibility_date": "2026-09-01", "compatibility_flags": ["nodejs_compat", "global_fetch_strictly_public"], - // The live demo site linked from docs.seatlayer.io. - "routes": [{ "pattern": "examples.seatlayer.io", "custom_domain": true }], "assets": { "directory": ".open-next/assets", "binding": "ASSETS" @@ -17,7 +18,19 @@ // Self reference used by the OpenNext cache. The service name must match // the worker name above. "binding": "WORKER_SELF_REFERENCE", - "service": "seatlayer-examples" + "service": "seatlayer-nextjs-example" } - ] + ], + "env": { + "hosted": { + "name": "seatlayer-examples", + "routes": [{ "pattern": "examples.seatlayer.io", "custom_domain": true }], + "services": [ + { + "binding": "WORKER_SELF_REFERENCE", + "service": "seatlayer-examples" + } + ] + } + } }