36 lines
6.7 KiB
Markdown
36 lines
6.7 KiB
Markdown
|
|
# Checkout
|
||
|
|
|
||
|
|
`/checkout/[username]` · `apps/{bull,bear}/src/app/(flow)/checkout/[username]/page.tsx` · Type: cart and checkout · Layout: [layout.md](layout.md)
|
||
|
|
|
||
|
|
| Field | Value |
|
||
|
|
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||
|
|
| Robots | `noindex` (page `metadata`) |
|
||
|
|
| Status | `200`, because `loading.tsx` streams the page: an invalid or unknown username renders the not-found UI in the stream; another spelling of the username redirects in the stream to the stored one, with `?code=` kept (0059), not a 308; a suspended channel redirects in the stream to the channel |
|
||
|
|
| loading.tsx | `checkout/[username]/loading.tsx`: bull: the bar; bear: the header and title; then `CheckoutSkeleton` with `CheckoutCreatorSkeleton`, `delayed` |
|
||
|
|
| First flush | none: the page entry awaits `getChannel(username)` through `readOnServer` under `loading.tsx`, so the page streams behind the skeleton |
|
||
|
|
| Canonical | none: `noindex` |
|
||
|
|
| H1 | bull: none (the bar's name isn't a heading); bear: `DesktopPageTitle`, `payment:checkout.title` |
|
||
|
|
| JSON-LD | none |
|
||
|
|
| Scripts | none beyond the layout's |
|
||
|
|
|
||
|
|
## Sections
|
||
|
|
|
||
|
|
In bull's document order.
|
||
|
|
|
||
|
|
| Section | Data | HTML | JS | Index | Notes |
|
||
|
|
| ------------------------------------------------------- | ---------------------- | -------- | ------- | ----- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||
|
|
| MobileTopBar (bull) | config | streamed | hydrate | no | back to the channel; no bottom nav |
|
||
|
|
| DesktopHeader (bear) | viewer | streamed | hydrate | no | rows as in [layout-main.md](layout-main.md) |
|
||
|
|
| DesktopPageTitle (bear) | config | streamed | hydrate | no | back to the channel, beside the title |
|
||
|
|
| CheckoutCreator | `getChannel(username)` | streamed | none | no | avatar, name and @username; a Server Component passed into the client panel, so the skeleton shows it too |
|
||
|
|
| CheckoutPanel | viewer | skeleton | hydrate | no | `AuthGuard role="investor"`: a guest goes to login and back, a creator gets no-access; `useInviteLink` keeps `?code=` for this creator on arrival (0059, 0030); its own `PartBoundary` |
|
||
|
|
| ↳ CheckoutForm: tiers, invite note and code, pay footer | query | skeleton | hydrate | no | `useCheckoutPage`'s browser read; the skeleton stays while a payment left at the bank settles (0033); a reactivation shows the start-today note instead of the code (U11) |
|
||
|
|
| ↳ CheckoutHalts | query | none | hydrate | no | dialogs when the investor can't pay here |
|
||
|
|
| ↳ NoCodeSheet | `getChannel(username)` | none | hydrate | no | «کد ندارم»: where to get a code, from the creator's links; mounts when opened |
|
||
|
|
|
||
|
|
## Notes
|
||
|
|
|
||
|
|
- bull pins the pay block to the bottom of the screen; bear sticks it to the bottom of the window in a 480 column. Same sections otherwise.
|
||
|
|
- The redirect and not-found cases run after the skeleton is sent, so they never set the status line. That is fine for a `noindex` page reached only from the channel's «اشتراک».
|
||
|
|
- Debt: different H1 per app. bull has no `h1`; add a screen-reader `h1` to `CheckoutTemplate` in bull (`apps/bull/src/app/(flow)/checkout/[username]/templates/checkout-template/CheckoutTemplate.tsx:19`).
|