Add sx-get to cross-domain cart and auth-menu fragment links

Cart mini and auth-menu components were rendering plain <a href>
links for cross-domain navigation. Add sx-get with OOB swap
attributes so these use the SX fetch path instead of full reloads.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-01 10:47:24 +00:00
parent 82b411f25a
commit 17cebe07e7

View File

@@ -26,6 +26,8 @@
(img :src (str blog-url "static/img/logo.jpg")
:class "h-full w-full rounded-full object-cover border border-stone-300 flex-shrink-0")))
(a :href cart-url
:sx-get cart-url
:sx-target "#main-panel" :sx-swap "outerHTML" :sx-push-url "true"
:class "relative inline-flex items-center justify-center text-stone-700 hover:text-emerald-700"
(i :class "fa fa-shopping-cart text-5xl" :aria-hidden "true")
(span :class "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 inline-flex items-center justify-center rounded-full bg-emerald-600 text-white text-sm w-5 h-5"
@@ -36,21 +38,30 @@
(span :id "auth-menu-desktop" :class "hidden md:inline-flex"
(if user-email
(a :href account-url
:sx-get account-url
:sx-target "#main-panel" :sx-swap "outerHTML" :sx-push-url "true"
:class "justify-center cursor-pointer flex flex-row items-center p-3 gap-2 rounded bg-stone-200 text-black"
:data-close-details true
(i :class "fa-solid fa-user")
(span user-email))
(a :href account-url
:sx-get account-url
:sx-target "#main-panel" :sx-swap "outerHTML" :sx-push-url "true"
:class "justify-center cursor-pointer flex flex-row items-center p-3 gap-2 rounded bg-stone-200 text-black"
:data-close-details true
(i :class "fa-solid fa-key")
(span "sign in or register"))))
(span :id "auth-menu-mobile" :class "block md:hidden text-md font-bold"
(if user-email
(a :href account-url :data-close-details true
(a :href account-url
:sx-get account-url
:sx-target "#main-panel" :sx-swap "outerHTML" :sx-push-url "true"
:data-close-details true
(i :class "fa-solid fa-user")
(span user-email))
(a :href account-url
:sx-get account-url
:sx-target "#main-panel" :sx-swap "outerHTML" :sx-push-url "true"
(i :class "fa-solid fa-key")
(span "sign in or register"))))))