@wix/agent-skills 1.19.2 → 1.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/skills/wix-app/references/SERVICE_PLUGIN.md +14 -1
- package/skills/wix-app/references/editor-react-component/ANIMATED-COMPONENTS.md +7 -6
- package/skills/wix-app/references/service-plugin/ADDITIONAL-FEES.md +4 -0
- package/skills/wix-app/references/service-plugin/AVAILABILITY-TIME-SLOTS-CONFIGURATION.md +118 -0
- package/skills/wix-app/references/service-plugin/BOOKING-POLICY.md +65 -0
- package/skills/wix-app/references/service-plugin/BOOKINGS-PRICING.md +71 -0
- package/skills/wix-app/references/service-plugin/BOOKINGS-STAFF-SORTING.md +11 -3
- package/skills/wix-app/references/service-plugin/BOOKINGS-VALIDATION.md +137 -0
- package/skills/wix-app/references/service-plugin/DISCOUNT-TRIGGERS.md +23 -16
- package/skills/wix-app/references/service-plugin/GIFT-CARDS.md +4 -0
- package/skills/wix-app/references/service-plugin/PAYMENT-SETTINGS.md +4 -2
- package/skills/wix-app/references/service-plugin/REALTIME-PERMISSIONS.md +45 -0
- package/skills/wix-app/references/service-plugin/SHIPPING-RATES.md +15 -0
- package/skills/wix-app/references/service-plugin/TOOLS_PROVIDER.md +4 -0
- package/skills/wix-app/references/service-plugin/VALIDATIONS.md +4 -0
- package/skills/wix-headless/references/CAPABILITIES.md +2 -2
- package/skills/wix-headless/references/inline-recipes/experience-store.md +4 -3
- package/skills/wix-headless/references/inline-recipes/how-to-code-a-store.md +98 -18
- package/skills/wix-headless/references/managed/DEPLOYMENT.md +8 -8
- package/skills/wix-headless-fast/install/fast-path.mjs +3 -1
- package/skills/wix-headless-fast/references/shared/app/wix/media.ts +13 -0
- package/skills/wix-headless-fast/references/storefront/INSTRUCTIONS.md +227 -56
- package/skills/wix-headless-fast/references/storefront/app/components/storefront/CartDrawer.tsx +37 -3
- package/skills/wix-headless-fast/references/storefront/app/components/storefront/FilterPanel.tsx +266 -0
- package/skills/wix-headless-fast/references/storefront/app/components/storefront/QuickAdd.tsx +165 -0
- package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useProductDetail.ts +48 -15
- package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useShop.ts +129 -11
- package/skills/wix-headless-fast/references/storefront/app/wix/storefront/cart.ts +36 -6
- package/skills/wix-headless-fast/references/storefront/app/wix/storefront/catalog.ts +190 -24
- package/skills/wix-headless-fast/references/storefront/app/wix/storefront/types.ts +62 -4
- package/skills/wix-headless-fast/references/storefront/app-astro/layouts/SiteLayout.astro +21 -2
- package/skills/wix-headless-fast/references/storefront/seed/SEED.md +5 -1
- package/skills/wix-headless-fast/references/storefront/seed/seed-store.mjs +59 -6
- package/skills/wix-manage/SKILL.md +4 -1
- package/skills/wix-manage/references/events/create-wix-event.md +46 -0
- package/skills/wix-manage/references/events/manage-wix-events.md +51 -1
- package/skills/wix-manage/references/google-ads/manage-campaign-lifecycle.md +6 -6
- package/skills/wix-manage/references/seo/manage-seo-suggestions.md +351 -0
- package/skills/wix-vibe-headless/install/deploy.cjs +33 -2
- package/skills/wix-vibe-headless/platforms/base44-ecom-light-seed-with-install.md +1 -1
- package/skills/wix-vibe-headless/platforms/base44-ecom-light-seed.md +13 -4
- package/skills/wix-vibe-headless/platforms/base44-ecom-light.md +1 -1
- package/skills/wix-vibe-headless/platforms/base44.md +19 -4
- package/skills/wix-vibe-headless/platforms/generic.md +6 -0
- package/skills/wix-vibe-headless/references/_shared/nav/nav.tanstack.js +30 -0
- package/skills/wix-vibe-headless/references/_shared/routing.md +86 -0
- package/skills/wix-vibe-headless/references/blog/INSTRUCTIONS.md +44 -0
- package/skills/wix-vibe-headless/references/blog/app/components/PostCard.jsx +1 -1
- package/skills/wix-vibe-headless/references/blog/app/components/PostChips.jsx +1 -1
- package/skills/wix-vibe-headless/references/blog/app/pages/CategoryPage.jsx +1 -1
- package/skills/wix-vibe-headless/references/blog/app/pages/PostDetail.jsx +1 -1
- package/skills/wix-vibe-headless/references/blog/app/pages/TagPage.jsx +1 -1
- package/skills/wix-vibe-headless/references/bookings/INSTRUCTIONS.md +42 -0
- package/skills/wix-vibe-headless/references/bookings/app/components/ServiceCard.jsx +1 -1
- package/skills/wix-vibe-headless/references/bookings/app/pages/ServiceDetail.jsx +1 -1
- package/skills/wix-vibe-headless/references/events/INSTRUCTIONS.md +42 -0
- package/skills/wix-vibe-headless/references/events/app/components/EventCard.jsx +1 -1
- package/skills/wix-vibe-headless/references/events/app/pages/EventDetail.jsx +1 -1
- package/skills/wix-vibe-headless/references/members/INSTRUCTIONS.md +42 -0
- package/skills/wix-vibe-headless/references/members/app/components/MemberMenu.jsx +1 -1
- package/skills/wix-vibe-headless/references/members/app/components/RequireAuth.jsx +1 -1
- package/skills/wix-vibe-headless/references/members/app/pages/Login.jsx +1 -1
- package/skills/wix-vibe-headless/references/portfolio/INSTRUCTIONS.md +43 -0
- package/skills/wix-vibe-headless/references/portfolio/app/components/CollectionCard.jsx +1 -1
- package/skills/wix-vibe-headless/references/portfolio/app/components/ProjectCard.jsx +1 -1
- package/skills/wix-vibe-headless/references/portfolio/app/pages/CollectionPage.jsx +1 -1
- package/skills/wix-vibe-headless/references/portfolio/app/pages/ProjectDetail.jsx +1 -1
- package/skills/wix-vibe-headless/references/pricing-plans/INSTRUCTIONS.md +43 -0
- package/skills/wix-vibe-headless/references/pricing-plans/app/components/PlanCard.jsx +1 -1
- package/skills/wix-vibe-headless/references/pricing-plans/app/pages/PlanDetail.jsx +1 -1
- package/skills/wix-vibe-headless/references/restaurants/INSTRUCTIONS.md +36 -0
- package/skills/wix-vibe-headless/references/shared/app/lib/nav.js +9 -0
- package/skills/wix-vibe-headless/references/storefront/INSTRUCTIONS.md +43 -2
- package/skills/wix-vibe-headless/references/storefront/app/hooks/useProductCard.js +7 -1
|
@@ -39,12 +39,29 @@ real fallback — a runtime error, or a field the snippets don't cover (see "Fal
|
|
|
39
39
|
end). (Files missing? the install's `deploy` result lists what it wrote; re-run install, or copy
|
|
40
40
|
`references/blog/app/` → `src/`.)
|
|
41
41
|
|
|
42
|
+
**Their `Link`/`useParams` imports come from `@/lib/nav`**, so the same sources run on either
|
|
43
|
+
template. That adapter is installed at `src/lib/nav.js` with the rest of the deployed tree — use
|
|
44
|
+
the file that is there, and on TanStack check it first ([which template?](../_shared/routing.md)).
|
|
45
|
+
Import from `@/lib/nav` in the pages you write too, and they stay portable the same way.
|
|
46
|
+
|
|
47
|
+
|
|
42
48
|
|
|
43
49
|
## STEP 2 — Theme
|
|
44
50
|
Use the existing Base44 theme in `src/index.css` so your pages and the shipped components
|
|
45
51
|
share the same colors and typography.
|
|
46
52
|
|
|
47
53
|
## STEP 3 — Wire routes + provider (surgical `find_replace` on `src/App.jsx`, never a rewrite)
|
|
54
|
+
|
|
55
|
+
> **The template decides this step, and `src/routes/__root.jsx` is the question to ask first.**
|
|
56
|
+
> Present → TanStack Start, which mounts these pages as route files at the end of this step; absent
|
|
57
|
+
> → React Router, which the wiring below is written for. Ask in that order: an `src/App.jsx` can
|
|
58
|
+
> exist on a TanStack app because an agent created one, and `__root.jsx` is never there by mistake.
|
|
59
|
+
> The installed `src/lib/nav.js` defaults to the React Router adapter, so on TanStack swap it:
|
|
60
|
+
> [both patterns](../_shared/routing.md).
|
|
61
|
+
>
|
|
62
|
+
> **Import `Link`, `useParams` and friends from `@/lib/nav` in the pages you write too** — same
|
|
63
|
+
> names as the router exports, and nothing you write is pinned to one template.
|
|
64
|
+
|
|
48
65
|
**No file reads needed to wire this.** Every shipped page and `WixManageBanner` is a default export that takes **no props** — wire them exactly as the snippet shows; nothing in those files needs looking up.
|
|
49
66
|
`App.jsx` carries required platform auth scaffolding (`AuthProvider`/`useAuth`) — edit it in, don't
|
|
50
67
|
replace it.
|
|
@@ -108,6 +125,33 @@ function Layout() {
|
|
|
108
125
|
</TaxonomyProvider>
|
|
109
126
|
```
|
|
110
127
|
|
|
128
|
+
|
|
129
|
+
### TanStack Start template — the same pages, mounted as files
|
|
130
|
+
|
|
131
|
+
Chrome (header, footer, the fixed banner region described above) goes in `src/routes/__root.jsx`
|
|
132
|
+
around its `<Outlet/>`, and any provider this vertical asks for wraps that `<Outlet/>` once. Each
|
|
133
|
+
route is a two-line file; shipped pages stay in `src/pages/` untouched.
|
|
134
|
+
|
|
135
|
+
| route | file | component |
|
|
136
|
+
|---|---|---|
|
|
137
|
+
| `/` | `src/routes/index.jsx` | `Home` |
|
|
138
|
+
| `/blog` | `src/routes/blog.index.jsx` | `Blog` |
|
|
139
|
+
| `/blog/:slug` | `src/routes/blog.$slug.jsx` | `PostDetail` |
|
|
140
|
+
| `/blog/category/:slug` | `src/routes/blog.category.$slug.jsx` | `CategoryPage` |
|
|
141
|
+
| `/blog/tag/:slug` | `src/routes/blog.tag.$slug.jsx` | `TagPage` |
|
|
142
|
+
|
|
143
|
+
```jsx
|
|
144
|
+
// src/routes/blog.index.jsx
|
|
145
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
146
|
+
import Blog from "@/pages/Blog";
|
|
147
|
+
|
|
148
|
+
export const Route = createFileRoute("/blog")({ component: Blog });
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Path params are `$name` in both the filename and the route path; `useParams()` from `@/lib/nav`
|
|
152
|
+
reads them unchanged. Full pattern, including `ssr: false` for per-user routes:
|
|
153
|
+
[`../_shared/routing.md`](../_shared/routing.md).
|
|
154
|
+
|
|
111
155
|
## What you build (not shipped)
|
|
112
156
|
The **home / landing page**, the **`Header`** and a **`Footer`** — the two you drop into the `Layout`
|
|
113
157
|
(STEP 3) so they wrap every route — plus the overall brand story, styled with the same base44
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Feed tile. Styled with base44 design tokens (shadcn Tailwind classes) — re-skin via those tokens, not this
|
|
2
2
|
// JSX. The cover-image path (post.media.wixMedia.image.url) and the text-only fallback are
|
|
3
3
|
// load-bearing: never substitute a stock/placeholder image. Routes to the detail page by slug.
|
|
4
|
-
import { Link } from "
|
|
4
|
+
import { Link } from "@/lib/nav";
|
|
5
5
|
|
|
6
6
|
function coverImage(post) {
|
|
7
7
|
const url = post?.media?.wixMedia?.image?.url; // ready-to-use https url; //-fix is defensive
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Category + tag chips for a post. Resolves the post's categoryIds/tagIds against the SHARED
|
|
2
2
|
// taxonomy maps (fetched once by TaxonomyProvider — never re-query here), displays each by .label
|
|
3
3
|
// (NOT .name), and routes by .slug. Styled with base44 design tokens (shadcn Tailwind classes).
|
|
4
|
-
import { Link } from "
|
|
4
|
+
import { Link } from "@/lib/nav";
|
|
5
5
|
import { useTaxonomy } from "@/context/TaxonomyContext";
|
|
6
6
|
|
|
7
7
|
const chip = "inline-flex items-center py-1 px-2.5 text-[12px] no-underline text-foreground bg-card border border-border rounded-full";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// feed, so paging is identical). Displays the category by .label; cover from category.coverImage.url
|
|
4
4
|
// (a DIFFERENT path from the post cover). Styled with base44 design tokens (shadcn Tailwind classes).
|
|
5
5
|
import { useEffect, useState } from "react";
|
|
6
|
-
import { useParams } from "
|
|
6
|
+
import { useParams } from "@/lib/nav";
|
|
7
7
|
import { getCategoryBySlug, queryPostsByCategory } from "@/rest/wix-blog";
|
|
8
8
|
import PostGrid from "@/components/PostGrid";
|
|
9
9
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// category/tag chips, and the plain-text body as paragraphs. For a faithful render of embeds/images/
|
|
3
3
|
// formatting, render `d.post.richContent` with a Ricos renderer (see INSTRUCTIONS "Extending").
|
|
4
4
|
// Styled with base44 design tokens (shadcn Tailwind classes).
|
|
5
|
-
import { useParams } from "
|
|
5
|
+
import { useParams } from "@/lib/nav";
|
|
6
6
|
import { usePostDetail } from "@/hooks/usePostDetail";
|
|
7
7
|
import PostChips from "@/components/PostChips";
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// tag's posts via queryPostsByTag (same { posts, nextCursor } shape as the feed). Displays the tag by
|
|
3
3
|
// .label (per-tag count is publishedPostCount). Styled with base44 design tokens (shadcn Tailwind classes).
|
|
4
4
|
import { useEffect, useState } from "react";
|
|
5
|
-
import { useParams } from "
|
|
5
|
+
import { useParams } from "@/lib/nav";
|
|
6
6
|
import { getTagBySlug, queryPostsByTag } from "@/rest/wix-blog";
|
|
7
7
|
import PostGrid from "@/components/PostGrid";
|
|
8
8
|
|
|
@@ -50,12 +50,29 @@ on a real fallback — a runtime error, or a field the snippets don't cover (see
|
|
|
50
50
|
the end). (Files missing? the install's `deploy` result lists what it wrote; re-run install, or copy
|
|
51
51
|
`references/bookings/app/` → `src/`.)
|
|
52
52
|
|
|
53
|
+
**Their `Link`/`useParams` imports come from `@/lib/nav`**, so the same sources run on either
|
|
54
|
+
template. That adapter is installed at `src/lib/nav.js` with the rest of the deployed tree — use
|
|
55
|
+
the file that is there, and on TanStack check it first ([which template?](../_shared/routing.md)).
|
|
56
|
+
Import from `@/lib/nav` in the pages you write too, and they stay portable the same way.
|
|
57
|
+
|
|
58
|
+
|
|
53
59
|
|
|
54
60
|
## STEP 2 — Theme
|
|
55
61
|
Use the existing Base44 theme in `src/index.css` so your pages and the shipped components
|
|
56
62
|
share the same colors and typography.
|
|
57
63
|
|
|
58
64
|
## STEP 3 — Wire routes (surgical `find_replace` on `src/App.jsx`, never a rewrite)
|
|
65
|
+
|
|
66
|
+
> **The template decides this step, and `src/routes/__root.jsx` is the question to ask first.**
|
|
67
|
+
> Present → TanStack Start, which mounts these pages as route files at the end of this step; absent
|
|
68
|
+
> → React Router, which the wiring below is written for. Ask in that order: an `src/App.jsx` can
|
|
69
|
+
> exist on a TanStack app because an agent created one, and `__root.jsx` is never there by mistake.
|
|
70
|
+
> The installed `src/lib/nav.js` defaults to the React Router adapter, so on TanStack swap it:
|
|
71
|
+
> [both patterns](../_shared/routing.md).
|
|
72
|
+
>
|
|
73
|
+
> **Import `Link`, `useParams` and friends from `@/lib/nav` in the pages you write too** — same
|
|
74
|
+
> names as the router exports, and nothing you write is pinned to one template.
|
|
75
|
+
|
|
59
76
|
**No file reads needed to wire this.** Every shipped page and `WixManageBanner` is a default export that takes **no props** — wire them exactly as the snippet shows; nothing in those files needs looking up.
|
|
60
77
|
`App.jsx` carries required platform auth scaffolding (`AuthProvider`/`useAuth`) — edit it in, don't
|
|
61
78
|
replace it. Bookings needs **no cross-page provider** (there's no cart — each booking completes on
|
|
@@ -111,6 +128,31 @@ function Layout() {
|
|
|
111
128
|
</Routes>
|
|
112
129
|
```
|
|
113
130
|
|
|
131
|
+
|
|
132
|
+
### TanStack Start template — the same pages, mounted as files
|
|
133
|
+
|
|
134
|
+
Chrome (header, footer, the fixed banner region described above) goes in `src/routes/__root.jsx`
|
|
135
|
+
around its `<Outlet/>`, and any provider this vertical asks for wraps that `<Outlet/>` once. Each
|
|
136
|
+
route is a two-line file; shipped pages stay in `src/pages/` untouched.
|
|
137
|
+
|
|
138
|
+
| route | file | component |
|
|
139
|
+
|---|---|---|
|
|
140
|
+
| `/` | `src/routes/index.jsx` | `Home` |
|
|
141
|
+
| `/services` | `src/routes/services.jsx` | `Services` |
|
|
142
|
+
| `/service/:serviceId` | `src/routes/service.$serviceId.jsx` | `ServiceDetail` |
|
|
143
|
+
|
|
144
|
+
```jsx
|
|
145
|
+
// src/routes/services.jsx
|
|
146
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
147
|
+
import Services from "@/pages/Services";
|
|
148
|
+
|
|
149
|
+
export const Route = createFileRoute("/services")({ component: Services });
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Path params are `$name` in both the filename and the route path; `useParams()` from `@/lib/nav`
|
|
153
|
+
reads them unchanged. Full pattern, including `ssr: false` for per-user routes:
|
|
154
|
+
[`../_shared/routing.md`](../_shared/routing.md).
|
|
155
|
+
|
|
114
156
|
## What you build (not shipped)
|
|
115
157
|
The **home / landing page**, the **`Header`** and a **`Footer`** — the two you drop into the
|
|
116
158
|
`Layout` (STEP 3) so they wrap every route — plus the overall brand story, styled with the same
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// (src/index.css :root/.dark), not this JSX. Load-bearing: the image goes through mediaUrl() (Wix
|
|
4
4
|
// media can be a bare handle), the link uses `service.id`, and every price/duration/capacity label
|
|
5
5
|
// comes from lib/serviceFacts.js so the card and the detail page can't disagree.
|
|
6
|
-
import { Link } from "
|
|
6
|
+
import { Link } from "@/lib/nav";
|
|
7
7
|
import { mediaUrl } from "@/rest/wix-bookings-services";
|
|
8
8
|
import { serviceCapacityLabel, serviceDuration, servicePriceLabel } from "@/lib/serviceFacts";
|
|
9
9
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// pick a slot, enter details, book → hosted checkout. Two columns: what you're booking on the left,
|
|
3
3
|
// the booking panel on the right, sticky on desktop so the times stay in reach while reading.
|
|
4
4
|
// Styled with base44 design tokens (shadcn Tailwind classes).
|
|
5
|
-
import { useParams } from "
|
|
5
|
+
import { useParams } from "@/lib/nav";
|
|
6
6
|
import { useServiceDetail } from "@/hooks/useServiceDetail";
|
|
7
7
|
import { mediaUrl } from "@/rest/wix-bookings-services";
|
|
8
8
|
import SlotPicker from "@/components/SlotPicker";
|
|
@@ -46,12 +46,29 @@ real fallback — a runtime error, or a field the snippets don't cover (see "Fal
|
|
|
46
46
|
end). (Files missing? the install's `deploy` result lists what it wrote; re-run install, or copy
|
|
47
47
|
`references/events/app/` → `src/`.)
|
|
48
48
|
|
|
49
|
+
**Their `Link`/`useParams` imports come from `@/lib/nav`**, so the same sources run on either
|
|
50
|
+
template. That adapter is installed at `src/lib/nav.js` with the rest of the deployed tree — use
|
|
51
|
+
the file that is there, and on TanStack check it first ([which template?](../_shared/routing.md)).
|
|
52
|
+
Import from `@/lib/nav` in the pages you write too, and they stay portable the same way.
|
|
53
|
+
|
|
54
|
+
|
|
49
55
|
|
|
50
56
|
## STEP 2 — Theme
|
|
51
57
|
Use the existing Base44 theme in `src/index.css` so your pages and the shipped components
|
|
52
58
|
share the same colors and typography.
|
|
53
59
|
|
|
54
60
|
## STEP 3 — Wire routes + provider (surgical `find_replace` on `src/App.jsx`, never a rewrite)
|
|
61
|
+
|
|
62
|
+
> **The template decides this step, and `src/routes/__root.jsx` is the question to ask first.**
|
|
63
|
+
> Present → TanStack Start, which mounts these pages as route files at the end of this step; absent
|
|
64
|
+
> → React Router, which the wiring below is written for. Ask in that order: an `src/App.jsx` can
|
|
65
|
+
> exist on a TanStack app because an agent created one, and `__root.jsx` is never there by mistake.
|
|
66
|
+
> The installed `src/lib/nav.js` defaults to the React Router adapter, so on TanStack swap it:
|
|
67
|
+
> [both patterns](../_shared/routing.md).
|
|
68
|
+
>
|
|
69
|
+
> **Import `Link`, `useParams` and friends from `@/lib/nav` in the pages you write too** — same
|
|
70
|
+
> names as the router exports, and nothing you write is pinned to one template.
|
|
71
|
+
|
|
55
72
|
**No file reads needed to wire this.** Every shipped page and `WixManageBanner` is a default export that takes **no props** — wire them exactly as the snippet shows; nothing in those files needs looking up.
|
|
56
73
|
`App.jsx` carries required platform auth scaffolding (`AuthProvider`/`useAuth`) — edit it in, don't
|
|
57
74
|
replace it. (Events needs no cross-page provider — there's no cart; the RSVP/ticketing state is local
|
|
@@ -107,6 +124,31 @@ function Layout() {
|
|
|
107
124
|
</Routes>
|
|
108
125
|
```
|
|
109
126
|
|
|
127
|
+
|
|
128
|
+
### TanStack Start template — the same pages, mounted as files
|
|
129
|
+
|
|
130
|
+
Chrome (header, footer, the fixed banner region described above) goes in `src/routes/__root.jsx`
|
|
131
|
+
around its `<Outlet/>`, and any provider this vertical asks for wraps that `<Outlet/>` once. Each
|
|
132
|
+
route is a two-line file; shipped pages stay in `src/pages/` untouched.
|
|
133
|
+
|
|
134
|
+
| route | file | component |
|
|
135
|
+
|---|---|---|
|
|
136
|
+
| `/` | `src/routes/index.jsx` | `Home` |
|
|
137
|
+
| `/events` | `src/routes/events.index.jsx` | `Events` |
|
|
138
|
+
| `/events/:slug` | `src/routes/events.$slug.jsx` | `EventDetail` |
|
|
139
|
+
|
|
140
|
+
```jsx
|
|
141
|
+
// src/routes/events.index.jsx
|
|
142
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
143
|
+
import Events from "@/pages/Events";
|
|
144
|
+
|
|
145
|
+
export const Route = createFileRoute("/events")({ component: Events });
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Path params are `$name` in both the filename and the route path; `useParams()` from `@/lib/nav`
|
|
149
|
+
reads them unchanged. Full pattern, including `ssr: false` for per-user routes:
|
|
150
|
+
[`../_shared/routing.md`](../_shared/routing.md).
|
|
151
|
+
|
|
110
152
|
## What you build (not shipped)
|
|
111
153
|
The **home / landing page**, the **`Header`** and a **`Footer`** — the two you drop into the `Layout`
|
|
112
154
|
(STEP 3) so they wrap every route — plus the overall brand story, styled with the same base44
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// formattedValue } — render formattedValue, NEVER the raw object (React "objects are not valid as a
|
|
5
5
|
// child" crash). This is a different shape from the ticket-definition price (pricing.fixedPrice.amount)
|
|
6
6
|
// used in the picker.
|
|
7
|
-
import { Link } from "
|
|
7
|
+
import { Link } from "@/lib/nav";
|
|
8
8
|
|
|
9
9
|
export default function EventCard({ event }) {
|
|
10
10
|
const when = event.dateAndTimeSettings?.formatted?.dateAndTime;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// shortDescription is a PLAIN string (safe to render). event.description is Ricos rich content
|
|
5
5
|
// { nodes: [...] } — NOT a string; to show the full body render it with @wix/ricos or walk `nodes`.
|
|
6
6
|
// NEVER call string methods (.slice/.substring/.split) on event.description — that crashes the page.
|
|
7
|
-
import { useParams } from "
|
|
7
|
+
import { useParams } from "@/lib/nav";
|
|
8
8
|
import { useEventDetail } from "@/hooks/useEventDetail";
|
|
9
9
|
import EventRegistration from "@/components/EventRegistration";
|
|
10
10
|
|
|
@@ -65,6 +65,12 @@ fallback — a runtime error, or a field the snippets don't cover (see "Fallback
|
|
|
65
65
|
(Files missing? the install's `deploy` result lists what it wrote; re-run install, or copy
|
|
66
66
|
`references/members/app/` → `src/`.)
|
|
67
67
|
|
|
68
|
+
**Their `Link`/`useParams` imports come from `@/lib/nav`**, so the same sources run on either
|
|
69
|
+
template. That adapter is installed at `src/lib/nav.js` with the rest of the deployed tree — use
|
|
70
|
+
the file that is there, and on TanStack check it first ([which template?](../_shared/routing.md)).
|
|
71
|
+
Import from `@/lib/nav` in the pages you write too, and they stay portable the same way.
|
|
72
|
+
|
|
73
|
+
|
|
68
74
|
> **⚠️ Copy `wix-members-auth.js` verbatim — do NOT rewrite its internals.** The OAuth wire shapes are
|
|
69
75
|
> exact and unforgiving: the `createRedirectSession` body needs the `auth.authRequest` wrapper, flat
|
|
70
76
|
> PKCE fields, and `responseType`/`scope` — "simplifying" it returns **400** and login dies. Extend by
|
|
@@ -77,6 +83,17 @@ Use the existing Base44 theme in `src/index.css` so your pages and the shipped c
|
|
|
77
83
|
share the same colors and typography.
|
|
78
84
|
|
|
79
85
|
## STEP 3 — Wire routes + provider (surgical `find_replace` on `src/App.jsx`, never a rewrite)
|
|
86
|
+
|
|
87
|
+
> **The template decides this step, and `src/routes/__root.jsx` is the question to ask first.**
|
|
88
|
+
> Present → TanStack Start, which mounts these pages as route files at the end of this step; absent
|
|
89
|
+
> → React Router, which the wiring below is written for. Ask in that order: an `src/App.jsx` can
|
|
90
|
+
> exist on a TanStack app because an agent created one, and `__root.jsx` is never there by mistake.
|
|
91
|
+
> The installed `src/lib/nav.js` defaults to the React Router adapter, so on TanStack swap it:
|
|
92
|
+
> [both patterns](../_shared/routing.md).
|
|
93
|
+
>
|
|
94
|
+
> **Import `Link`, `useParams` and friends from `@/lib/nav` in the pages you write too** — same
|
|
95
|
+
> names as the router exports, and nothing you write is pinned to one template.
|
|
96
|
+
|
|
80
97
|
**No file reads needed to wire this.** Every shipped page and `WixManageBanner` is a default export that takes **no props** — wire them exactly as the snippet shows; nothing in those files needs looking up.
|
|
81
98
|
`App.jsx` carries required platform auth scaffolding (`AuthProvider`/`useAuth`, the **Base44 builder
|
|
82
99
|
account**) — edit it in, don't replace it. The Wix member session is separate and ships under its own
|
|
@@ -140,6 +157,31 @@ function Layout() {
|
|
|
140
157
|
</MemberProvider>
|
|
141
158
|
```
|
|
142
159
|
|
|
160
|
+
|
|
161
|
+
### TanStack Start template — the same pages, mounted as files
|
|
162
|
+
|
|
163
|
+
Chrome (header, footer, the fixed banner region described above) goes in `src/routes/__root.jsx`
|
|
164
|
+
around its `<Outlet/>`, and any provider this vertical asks for wraps that `<Outlet/>` once. Each
|
|
165
|
+
route is a two-line file; shipped pages stay in `src/pages/` untouched.
|
|
166
|
+
|
|
167
|
+
| route | file | component |
|
|
168
|
+
|---|---|---|
|
|
169
|
+
| `/` | `src/routes/index.jsx` | `Home` |
|
|
170
|
+
| `/login` | `src/routes/login.jsx` | `Login` |
|
|
171
|
+
| `/callback` | `src/routes/callback.jsx` | `Callback` |
|
|
172
|
+
|
|
173
|
+
```jsx
|
|
174
|
+
// src/routes/login.jsx
|
|
175
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
176
|
+
import Login from "@/pages/Login";
|
|
177
|
+
|
|
178
|
+
export const Route = createFileRoute("/login")({ component: Login });
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Path params are `$name` in both the filename and the route path; `useParams()` from `@/lib/nav`
|
|
182
|
+
reads them unchanged. Full pattern, including `ssr: false` for per-user routes:
|
|
183
|
+
[`../_shared/routing.md`](../_shared/routing.md).
|
|
184
|
+
|
|
143
185
|
## What you build (not shipped)
|
|
144
186
|
The **home / landing page**, the **`Header`** (mount `<MemberMenu/>` in it) and a **`Footer`** — the
|
|
145
187
|
two you drop into the `Layout` (STEP 3) so they wrap every route — plus the overall brand story,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// session state: a "Log in" link for a visitor, or the member's name + a log-out button once signed
|
|
3
3
|
// in. Drop it into the Header you build (STEP 4), same as the storefront's CartButton. Pure UI reading
|
|
4
4
|
// useMember + base44 design tokens (shadcn Tailwind classes) — render it as-is; don't wrap it in your own auth logic.
|
|
5
|
-
import { Link } from "
|
|
5
|
+
import { Link } from "@/lib/nav";
|
|
6
6
|
import { useMember } from "@/context/MemberContext";
|
|
7
7
|
|
|
8
8
|
export default function MemberMenu() {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// children only for a logged-in member, otherwise redirects to /login (carrying the attempted path so
|
|
3
3
|
// login can return there). This is the gate the shipped Account page uses; reuse it for your own
|
|
4
4
|
// member-only routes ("my orders", "my plans", …). Reads useMember; no styling of its own.
|
|
5
|
-
import { Navigate, useLocation } from "
|
|
5
|
+
import { Navigate, useLocation } from "@/lib/nav";
|
|
6
6
|
import { useMember } from "@/context/MemberContext";
|
|
7
7
|
|
|
8
8
|
export default function RequireAuth({ children, fallback = "/login" }) {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// they came from (RequireAuth stashes it in location.state.from) or home. Social login returns via
|
|
4
4
|
// /callback instead. Styled with base44 design tokens (shadcn Tailwind classes) — don't rewrite this page to add chrome
|
|
5
5
|
// (the Header/Footer live in the Layout).
|
|
6
|
-
import { useNavigate, useLocation } from "
|
|
6
|
+
import { useNavigate, useLocation } from "@/lib/nav";
|
|
7
7
|
import LoginForm from "@/components/LoginForm";
|
|
8
8
|
import SocialButtons from "@/components/SocialButtons";
|
|
9
9
|
|
|
@@ -47,12 +47,29 @@ a real fallback — a runtime error, or a field the snippets don't cover (see "F
|
|
|
47
47
|
end). (Files missing? the install's `deploy` result lists what it wrote; re-run install, or copy
|
|
48
48
|
`references/portfolio/app/` → `src/`.)
|
|
49
49
|
|
|
50
|
+
**Their `Link`/`useParams` imports come from `@/lib/nav`**, so the same sources run on either
|
|
51
|
+
template. That adapter is installed at `src/lib/nav.js` with the rest of the deployed tree — use
|
|
52
|
+
the file that is there, and on TanStack check it first ([which template?](../_shared/routing.md)).
|
|
53
|
+
Import from `@/lib/nav` in the pages you write too, and they stay portable the same way.
|
|
54
|
+
|
|
55
|
+
|
|
50
56
|
|
|
51
57
|
## STEP 2 — Theme
|
|
52
58
|
Use the existing Base44 theme in `src/index.css` so your pages and the shipped components
|
|
53
59
|
share the same colors and typography.
|
|
54
60
|
|
|
55
61
|
## STEP 3 — Wire routes (surgical `find_replace` on `src/App.jsx`, never a rewrite)
|
|
62
|
+
|
|
63
|
+
> **The template decides this step, and `src/routes/__root.jsx` is the question to ask first.**
|
|
64
|
+
> Present → TanStack Start, which mounts these pages as route files at the end of this step; absent
|
|
65
|
+
> → React Router, which the wiring below is written for. Ask in that order: an `src/App.jsx` can
|
|
66
|
+
> exist on a TanStack app because an agent created one, and `__root.jsx` is never there by mistake.
|
|
67
|
+
> The installed `src/lib/nav.js` defaults to the React Router adapter, so on TanStack swap it:
|
|
68
|
+
> [both patterns](../_shared/routing.md).
|
|
69
|
+
>
|
|
70
|
+
> **Import `Link`, `useParams` and friends from `@/lib/nav` in the pages you write too** — same
|
|
71
|
+
> names as the router exports, and nothing you write is pinned to one template.
|
|
72
|
+
|
|
56
73
|
**No file reads needed to wire this.** Every shipped page and `WixManageBanner` is a default export that takes **no props** — wire them exactly as the snippet shows; nothing in those files needs looking up.
|
|
57
74
|
`App.jsx` carries required platform auth scaffolding (`AuthProvider`/`useAuth`) — edit it in, don't
|
|
58
75
|
replace it. Portfolio is read-only with no cross-page state, so there's **no provider to wrap** (no
|
|
@@ -110,6 +127,32 @@ function Layout() {
|
|
|
110
127
|
</Routes>
|
|
111
128
|
```
|
|
112
129
|
|
|
130
|
+
|
|
131
|
+
### TanStack Start template — the same pages, mounted as files
|
|
132
|
+
|
|
133
|
+
Chrome (header, footer, the fixed banner region described above) goes in `src/routes/__root.jsx`
|
|
134
|
+
around its `<Outlet/>`, and any provider this vertical asks for wraps that `<Outlet/>` once. Each
|
|
135
|
+
route is a two-line file; shipped pages stay in `src/pages/` untouched.
|
|
136
|
+
|
|
137
|
+
| route | file | component |
|
|
138
|
+
|---|---|---|
|
|
139
|
+
| `/` | `src/routes/index.jsx` | `Home` |
|
|
140
|
+
| `/portfolio` | `src/routes/portfolio.jsx` | `Portfolio` |
|
|
141
|
+
| `/collection/:slug` | `src/routes/collection.$slug.jsx` | `CollectionPage` |
|
|
142
|
+
| `/project/:slug` | `src/routes/project.$slug.jsx` | `ProjectDetail` |
|
|
143
|
+
|
|
144
|
+
```jsx
|
|
145
|
+
// src/routes/portfolio.jsx
|
|
146
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
147
|
+
import Portfolio from "@/pages/Portfolio";
|
|
148
|
+
|
|
149
|
+
export const Route = createFileRoute("/portfolio")({ component: Portfolio });
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Path params are `$name` in both the filename and the route path; `useParams()` from `@/lib/nav`
|
|
153
|
+
reads them unchanged. Full pattern, including `ssr: false` for per-user routes:
|
|
154
|
+
[`../_shared/routing.md`](../_shared/routing.md).
|
|
155
|
+
|
|
113
156
|
## What you build (not shipped)
|
|
114
157
|
The **home / landing page**, the **`Header`** and a **`Footer`** — the two you drop into the `Layout`
|
|
115
158
|
(STEP 3) so they wrap every route — plus the overall brand story, styled with the same base44
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Collection tile → links to /collection/:slug. Styled with base44 design tokens (shadcn Tailwind
|
|
2
2
|
// classes) — re-skin via the app's design tokens (src/index.css :root/.dark), not this JSX. The
|
|
3
3
|
// `//`-protocol image fix and the coverImage.imageInfo.url field path are load-bearing.
|
|
4
|
-
import { Link } from "
|
|
4
|
+
import { Link } from "@/lib/nav";
|
|
5
5
|
|
|
6
6
|
function coverUrl(collection) {
|
|
7
7
|
const url = collection?.coverImage?.imageInfo?.url;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// — re-skin via the app's design tokens (src/index.css :root/.dark), not this JSX. The cover is a
|
|
3
3
|
// one-of: image when present, else the video's poster / first resolution. The `//`-protocol fix and
|
|
4
4
|
// these field paths are load-bearing.
|
|
5
|
-
import { Link } from "
|
|
5
|
+
import { Link } from "@/lib/nav";
|
|
6
6
|
|
|
7
7
|
function https(url) {
|
|
8
8
|
return url ? (url.startsWith("//") ? `https:${url}` : url) : null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Collection page — collection header + its project grid (paged). Thin view over
|
|
2
2
|
// useCollectionProjects (all data logic lives in the hook). Styled with base44 design tokens (shadcn Tailwind classes).
|
|
3
|
-
import { useParams } from "
|
|
3
|
+
import { useParams } from "@/lib/nav";
|
|
4
4
|
import { useCollectionProjects } from "@/hooks/useCollectionProjects";
|
|
5
5
|
import ProjectGrid from "@/components/ProjectGrid";
|
|
6
6
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Project detail — thin view over useProjectDetail (all data logic lives in the hook). Renders the
|
|
2
2
|
// header, the details[] rows (text OR link), and the media gallery (each item via ProjectMedia,
|
|
3
3
|
// which branches on item.type). Styled with base44 design tokens (shadcn Tailwind classes).
|
|
4
|
-
import { useParams } from "
|
|
4
|
+
import { useParams } from "@/lib/nav";
|
|
5
5
|
import { useProjectDetail } from "@/hooks/useProjectDetail";
|
|
6
6
|
import ProjectMedia from "@/components/ProjectMedia";
|
|
7
7
|
|
|
@@ -50,12 +50,29 @@ a real fallback — a runtime error, or a field the snippets don't cover (see "F
|
|
|
50
50
|
end). (Files missing? the install's `deploy` result lists what it wrote; re-run install, or copy
|
|
51
51
|
`references/pricing-plans/app/` → `src/`.)
|
|
52
52
|
|
|
53
|
+
**Their `Link`/`useParams` imports come from `@/lib/nav`**, so the same sources run on either
|
|
54
|
+
template. That adapter is installed at `src/lib/nav.js` with the rest of the deployed tree — use
|
|
55
|
+
the file that is there, and on TanStack check it first ([which template?](../_shared/routing.md)).
|
|
56
|
+
Import from `@/lib/nav` in the pages you write too, and they stay portable the same way.
|
|
57
|
+
|
|
58
|
+
|
|
53
59
|
|
|
54
60
|
## STEP 2 — Theme
|
|
55
61
|
Use the existing Base44 theme in `src/index.css` so your pages and the shipped components
|
|
56
62
|
share the same colors and typography.
|
|
57
63
|
|
|
58
64
|
## STEP 3 — Wire routes + provider (surgical `find_replace` on `src/App.jsx`, never a rewrite)
|
|
65
|
+
|
|
66
|
+
> **The template decides this step, and `src/routes/__root.jsx` is the question to ask first.**
|
|
67
|
+
> Present → TanStack Start, which mounts these pages as route files at the end of this step; absent
|
|
68
|
+
> → React Router, which the wiring below is written for. Ask in that order: an `src/App.jsx` can
|
|
69
|
+
> exist on a TanStack app because an agent created one, and `__root.jsx` is never there by mistake.
|
|
70
|
+
> The installed `src/lib/nav.js` defaults to the React Router adapter, so on TanStack swap it:
|
|
71
|
+
> [both patterns](../_shared/routing.md).
|
|
72
|
+
>
|
|
73
|
+
> **Import `Link`, `useParams` and friends from `@/lib/nav` in the pages you write too** — same
|
|
74
|
+
> names as the router exports, and nothing you write is pinned to one template.
|
|
75
|
+
|
|
59
76
|
**No file reads needed to wire this.** Every shipped page and `WixManageBanner` is a default export that takes **no props** — wire them exactly as the snippet shows; nothing in those files needs looking up.
|
|
60
77
|
`App.jsx` carries required platform auth scaffolding (`AuthProvider`/`useAuth`) — edit it in, don't
|
|
61
78
|
replace it. Pricing Plans needs **no** cross-page provider (checkout is a redirect, not client
|
|
@@ -113,6 +130,32 @@ function Layout() {
|
|
|
113
130
|
</Routes>
|
|
114
131
|
```
|
|
115
132
|
|
|
133
|
+
|
|
134
|
+
### TanStack Start template — the same pages, mounted as files
|
|
135
|
+
|
|
136
|
+
Chrome (header, footer, the fixed banner region described above) goes in `src/routes/__root.jsx`
|
|
137
|
+
around its `<Outlet/>`, and any provider this vertical asks for wraps that `<Outlet/>` once. Each
|
|
138
|
+
route is a two-line file; shipped pages stay in `src/pages/` untouched.
|
|
139
|
+
|
|
140
|
+
| route | file | component |
|
|
141
|
+
|---|---|---|
|
|
142
|
+
| `/` | `src/routes/index.jsx` | `Home` |
|
|
143
|
+
| `/plans` | `src/routes/plans.index.jsx` | `Plans` |
|
|
144
|
+
| `/plans/:slug` | `src/routes/plans.$slug.jsx` | `PlanDetail` |
|
|
145
|
+
| `/my-plans` | `src/routes/my-plans.jsx` | `MyPlans` |
|
|
146
|
+
|
|
147
|
+
```jsx
|
|
148
|
+
// src/routes/plans.index.jsx
|
|
149
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
150
|
+
import Plans from "@/pages/Plans";
|
|
151
|
+
|
|
152
|
+
export const Route = createFileRoute("/plans")({ component: Plans });
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Path params are `$name` in both the filename and the route path; `useParams()` from `@/lib/nav`
|
|
156
|
+
reads them unchanged. Full pattern, including `ssr: false` for per-user routes:
|
|
157
|
+
[`../_shared/routing.md`](../_shared/routing.md).
|
|
158
|
+
|
|
116
159
|
## What you build (not shipped)
|
|
117
160
|
The **home / landing page**, the **`Header`** and a **`Footer`** — the two you drop into the
|
|
118
161
|
`Layout` (STEP 3) so they wrap every route — plus the overall brand story, styled with the same
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// plan.image is a WixMedia object { id, width, height, altText } with NO .url — its id must be
|
|
8
8
|
// resolved to a URL before it can render. Rendering plan text only here avoids that trap; see
|
|
9
9
|
// INSTRUCTIONS ("Plan image") for the resolve-or-omit fallback if you want the image.
|
|
10
|
-
import { Link } from "
|
|
10
|
+
import { Link } from "@/lib/nav";
|
|
11
11
|
import PlanPrice from "./PlanPrice";
|
|
12
12
|
|
|
13
13
|
export default function PlanCard({ plan, onSubscribe, featured = false }) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// price/billing summary, perks, terms & conditions if present, and a Subscribe button (only when
|
|
3
3
|
// plan.buyable). Not-found state on a bad slug — never invent a plan. Styled with base44 design
|
|
4
4
|
// tokens (shadcn Tailwind classes). termsAndConditions is plain text; render as-is.
|
|
5
|
-
import { useParams } from "
|
|
5
|
+
import { useParams } from "@/lib/nav";
|
|
6
6
|
import { usePlanDetail } from "@/hooks/usePlanDetail";
|
|
7
7
|
import PlanPrice from "@/components/PlanPrice";
|
|
8
8
|
|
|
@@ -56,6 +56,17 @@ Use the existing Base44 theme in `src/index.css` so your pages and the shipped c
|
|
|
56
56
|
share the same colors and typography.
|
|
57
57
|
|
|
58
58
|
## STEP 3 — Wire routes + provider (surgical `find_replace` on `src/App.jsx`, never a rewrite)
|
|
59
|
+
|
|
60
|
+
> **The template decides this step, and `src/routes/__root.jsx` is the question to ask first.**
|
|
61
|
+
> Present → TanStack Start, which mounts these pages as route files at the end of this step; absent
|
|
62
|
+
> → React Router, which the wiring below is written for. Ask in that order: an `src/App.jsx` can
|
|
63
|
+
> exist on a TanStack app because an agent created one, and `__root.jsx` is never there by mistake.
|
|
64
|
+
> The installed `src/lib/nav.js` defaults to the React Router adapter, so on TanStack swap it:
|
|
65
|
+
> [both patterns](../_shared/routing.md).
|
|
66
|
+
>
|
|
67
|
+
> **Import `Link`, `useParams` and friends from `@/lib/nav` in the pages you write too** — same
|
|
68
|
+
> names as the router exports, and nothing you write is pinned to one template.
|
|
69
|
+
|
|
59
70
|
**No file reads needed to wire this.** Every shipped page and `WixManageBanner` is a default export that takes **no props** — wire them exactly as the snippet shows; nothing in those files needs looking up.
|
|
60
71
|
`App.jsx` carries required platform auth scaffolding (`AuthProvider`/`useAuth`) — edit it in, don't
|
|
61
72
|
replace it.
|
|
@@ -116,6 +127,31 @@ function Layout() {
|
|
|
116
127
|
</OrderCartProvider>
|
|
117
128
|
```
|
|
118
129
|
|
|
130
|
+
|
|
131
|
+
### TanStack Start template — the same pages, mounted as files
|
|
132
|
+
|
|
133
|
+
Chrome (header, footer, the fixed banner region described above) goes in `src/routes/__root.jsx`
|
|
134
|
+
around its `<Outlet/>`, and any provider this vertical asks for wraps that `<Outlet/>` once. Each
|
|
135
|
+
route is a two-line file; shipped pages stay in `src/pages/` untouched.
|
|
136
|
+
|
|
137
|
+
| route | file | component |
|
|
138
|
+
|---|---|---|
|
|
139
|
+
| `/` | `src/routes/index.jsx` | `Home` |
|
|
140
|
+
| `/menu` | `src/routes/menu.jsx` | `Menu` |
|
|
141
|
+
| `/reservations` | `src/routes/reservations.jsx` | `Reservations` |
|
|
142
|
+
|
|
143
|
+
```jsx
|
|
144
|
+
// src/routes/menu.jsx
|
|
145
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
146
|
+
import Menu from "@/pages/Menu";
|
|
147
|
+
|
|
148
|
+
export const Route = createFileRoute("/menu")({ component: Menu });
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Path params are `$name` in both the filename and the route path; `useParams()` from `@/lib/nav`
|
|
152
|
+
reads them unchanged. Full pattern, including `ssr: false` for per-user routes:
|
|
153
|
+
[`../_shared/routing.md`](../_shared/routing.md).
|
|
154
|
+
|
|
119
155
|
## What you build (not shipped)
|
|
120
156
|
The **home / landing page**, the **`Header`** (mount `<OrderCartButton/>` in it) and a **`Footer`** —
|
|
121
157
|
the two you drop into the `Layout` (STEP 3) so they wrap every route — plus the overall brand story,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Navigation adapter — React Router template (src/App.jsx + react-router-dom).
|
|
2
|
+
// Shipped components import Link/useParams/etc from "@/lib/nav" so the same files run on either
|
|
3
|
+
// Base44 template; this file is the only place the router is named.
|
|
4
|
+
//
|
|
5
|
+
// It rides in the deployed tree, so every install path lands it — including the ones that copy
|
|
6
|
+
// `shared/app/` directly instead of running install/deploy.cjs. On the TanStack Start template
|
|
7
|
+
// (src/routes/__root.jsx present) `_shared/nav/nav.tanstack.js` replaces it; deploy.cjs does that
|
|
8
|
+
// swap on its own. See `_shared/routing.md`.
|
|
9
|
+
export { Link, useParams, useNavigate, useLocation, Navigate } from "react-router-dom";
|