Update homepage static-image slots and customer login links.

Align slot catalog with slider / our-experts / two-service-banner and send guests to customer portal /login.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Alireza Hassani
2026-10-01 21:23:22 +03:30
co-authored by Cursor
parent 29ff589c5b
commit e7e5381b80
8 changed files with 50 additions and 52 deletions
+16 -9
View File
@@ -59,12 +59,13 @@ Helpers: `src/lib/meshkee.ts` → `meshkeeGet`, `tenantPath`, `getTenant`, `getB
- **Note:** Tenant currently has no published workshops in API; homepage/list fall back to static samples in `src/data/site.ts`.
### Auth / customer portal
- Login icon → `https://customer.clinicsamen.com` (`customerPortalUrl` in `src/lib/config.ts`)
- Session: `src/lib/session.tsx` + shared cookies (`src/lib/shared-auth-cookie.ts`)
- Login / user icon → `https://customer.{domain}/login` (`customerPortalUrl` in `src/lib/config.ts` → `customer.clinicsamen.com`)
- Session: `src/lib/session.tsx` + shared cookies (`src/lib/shared-auth-cookie.ts`) — reads `meshkee_customer_access_token` from parent domain
- Profile API proxy: `GET /api/auth/me` → Meshkee `/auth/me`
- Admin handoff: `POST /api/auth/handoff` → Meshkee `/auth/handoff` → `https://business.clinicsamen.com`
- Logged-in header: user name + «عزیز»; dropdown: پروفایل من، خروج، مدیریت وبسایت (admins only)
- Component: `src/components/AccountMenu.tsx`
- Logged-in header: `{firstName lastName} عزیز` via `userDisplayName`
- Dropdown (`AccountMenu`): پروفایل من → `/profile`; مدیریت وبسایت (admins/owners/team only, handoff ticket); خروج (clears shared cookies)
- Component: `src/components/AccountMenu.tsx` (wired in `Header` topbar)
## Static image slots
API: `GET /tenants/{domain}/website/static-images?pageKey=home`
@@ -72,17 +73,23 @@ Catalog for dashboard Refresh: `GET /meshkee/static-image-slots` → `STATIC_IMA
| key | kind | itemCount | aspectRatio | recommendedWidth | homepage section |
| --- | --- | --- | --- | --- | --- |
| `slider` | list | null | `1920:740` | 1180 | Hero slider |
| `4-people-image` | list | 4 | `325:356` | 280 | Home therapists row |
| `our-services-icon` | list | 4 | `1:1` | 110 | Services icons |
| `two-banner-bg` | list | 2 | `540:312` | 560 | Dual promo banners |
| `slider` | list (duplicatable) | null | `1920:740` | 1180 | Hero slider |
| `our-experts` | list (duplicatable) | null | `325:356` | 280 | Home therapists / experts row |
| `two-service-banner` | list | 2 | `540:312` | 560 | Dual promo banners under services |
Field → UI mapping (match original homepage; empty API → local placeholders):
- `slider`: `url` → slide image; `linkUrl` → wrap slide. `titleFa` / `titleEn` / `subtext` not rendered in hero (image-only).
- `our-experts`: `url` → photo; `linkUrl` → card link (fallback `/ourdr`); `titleFa` → name (`h3`); `subtext` → role (`p`). `titleEn` not shown (original therapist cards have no English line).
- `two-service-banner`: `url` → banner background; `linkUrl` → CTA href; `titleFa` → banner title (`h3`). `titleEn` / `subtext` not shown on banners.
Service icons on the homepage stay local (`serviceCards` in `src/data/site.ts`) — not a Meshkee static-image slot.
Rules:
- Use `slot.images` (all if `kind=list`, first if `kind=single`)
- `url` → `<img src>`; `linkUrl` → wrap in link
- Empty / fail → keep local placeholders from `src/data/site.ts` / `public/images/`
- Use `slot.aspectRatio` (via `parseAspectRatio`)
- **If a slot’s on-page size or aspect ratio changes in CSS, update `STATIC_IMAGE_SLOTS` in the same change**
- **If a slot’s on-page size or aspect ratio changes in CSS, update `STATIC_IMAGE_SLOTS` in the same change** (Meshkee reads the catalog as the static-image source of truth)
Helpers: `src/lib/static-images.ts`, `src/components/SlotImage.tsx`, `src/components/SlotLink.tsx`
Home wiring: `src/app/page.tsx`