Files
rose-ash/market/sx/layouts.sx
giles 1dbf600af2 Convert test/cart/blog/market layouts to use _ctx_to_env + render_to_sx_with_env
Phase 4 (Test): Update ~test-layout-full and ~test-detail-layout-full defcomps
to use ~root-header with env free variables. Switch render functions to
render_to_sx_with_env.

Phase 5 (Cart): Convert cart-page, cart-admin, and order render functions.
Update cart .sx layout defcomps to use ~root-header from free variables.

Phase 6 (Blog): Convert all 7 blog layouts (blog, settings, sub-settings x5).
Remove all root_header_sx calls from blog.

Phase 7 (Market): Convert market and market-admin layouts plus browse/product
render functions. Remove root_header_sx import.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 15:02:59 +00:00

51 lines
2.4 KiB
Plaintext

;; Market layout defcomps — root header from env free variables,
;; market-specific headers passed as &key params.
;; --- Browse layout: root + post header + market header ---
(defcomp ~market-browse-layout-full (&key post-header market-header)
(<> (~root-header :cart-mini cart-mini :blog-url blog-url :site-title site-title
:app-label app-label :nav-tree nav-tree :auth-menu auth-menu
:nav-panel nav-panel :settings-url settings-url :is-admin is-admin)
(~header-child-sx :inner (<> post-header market-header))))
(defcomp ~market-browse-layout-oob (&key oob-header post-header-oob clear-oob)
(<> oob-header post-header-oob clear-oob))
;; --- Product layout: root + post + market + product ---
(defcomp ~market-product-layout-full (&key post-header market-header product-header)
(<> (~root-header :cart-mini cart-mini :blog-url blog-url :site-title site-title
:app-label app-label :nav-tree nav-tree :auth-menu auth-menu
:nav-panel nav-panel :settings-url settings-url :is-admin is-admin)
(~header-child-sx :inner (<> post-header market-header product-header))))
;; --- Product admin layout: root + post + market + product + admin ---
(defcomp ~market-product-admin-layout-full (&key post-header market-header product-header admin-header)
(<> (~root-header :cart-mini cart-mini :blog-url blog-url :site-title site-title
:app-label app-label :nav-tree nav-tree :auth-menu auth-menu
:nav-panel nav-panel :settings-url settings-url :is-admin is-admin)
(~header-child-sx :inner (<> post-header market-header product-header admin-header))))
;; --- Market admin layout: root + post + market + market-admin ---
(defcomp ~market-admin-layout-full (&key post-header market-header admin-header)
(<> (~root-header :cart-mini cart-mini :blog-url blog-url :site-title site-title
:app-label app-label :nav-tree nav-tree :auth-menu auth-menu
:nav-panel nav-panel :settings-url settings-url :is-admin is-admin)
(~header-child-sx :inner (<> post-header market-header admin-header))))
(defcomp ~market-admin-layout-oob (&key market-header-oob admin-oob-header clear-oob)
(<> market-header-oob admin-oob-header clear-oob))
;; --- OOB wrappers ---
(defcomp ~market-oob-wrap (&key parts)
(<> parts))
;; --- Content wrappers ---
(defcomp ~market-content-padded (&key content)
(<> content (div :class "pb-8")))