feat(storefront): barra de navegación desktop con categorías, personajes, ayuda y ubicación
- Desktop xl+: las 6 categorías raíz directo en la barra con desplegable de subcategorías; lg-xl mantiene "Departamentos"; "Personajes" (colecciones) y "Ayuda" a la derecha; hamburguesa solo en mobile. - "Enviar a <nombre> · <ciudad>" (location-store persistido) que precarga departamento/ciudad en el checkout; "Hola X / Mi cuenta" y "Cambios y devoluciones" en xl+. - Header compacto al hacer scroll en lg+ (histéresis 160/40px). - Fix de menús (también en DepartmentsMegaMenu, ya presente en prod): el click de mouse ya no cierra el menú recién abierto por hover (keepOpenAfterHover) y el hover solo reacciona a pointerType "mouse", así el mouseleave sintético de touch no autocierra en tablets. Revisado por el subagente frontend-critic (3 hallazgos, todos corregidos y re-verificados) + Playwright contra build de producción local: sin solapes a 1024/1280/1440/1920, click real, touch, mobile 390/320 sin cambios. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018r19s4H8MBGegqToqw5guP
This commit is contained in:
1 parent
503f56977d
commit
e6f031a366
4 files changed
+399
-33
No files matched your search
@@ -0,0 +1,34 @@
|
||||
"use client";
|
||||
|
||||
import { create } from "zustand";
|
||||
import { createJSONStorage, persist } from "zustand/middleware";
|
||||
|
||||
// Ciudad de envio elegida desde el header ("Enviar a ... · Cali"), mismo
|
||||
// patron persistido que wishlist/cart. Se guardan los ids DIVIPOLA (no
|
||||
// texto libre, ver lib/data/colombia.ts) para que el checkout arranque con
|
||||
// el mismo departamento/ciudad ya seleccionados.
|
||||
interface LocationState {
|
||||
departmentId: number | null;
|
||||
cityId: number | null;
|
||||
hasHydrated: boolean;
|
||||
setHasHydrated: (value: boolean) => void;
|
||||
setLocation: (departmentId: number, cityId: number) => void;
|
||||
}
|
||||
|
||||
export const useLocationStore = create<LocationState>()(
|
||||
persist(
|
||||
(set) => ({
|
||||
departmentId: null,
|
||||
cityId: null,
|
||||
hasHydrated: false,
|
||||
setHasHydrated: (value) => set({ hasHydrated: value }),
|
||||
setLocation: (departmentId, cityId) => set({ departmentId, cityId }),
|
||||
}),
|
||||
{
|
||||
name: "ari-shopping-location-v1",
|
||||
storage: createJSONStorage(() => localStorage),
|
||||
partialize: (state) => ({ departmentId: state.departmentId, cityId: state.cityId }),
|
||||
onRehydrateStorage: () => (state) => state?.setHasHydrated(true),
|
||||
},
|
||||
),
|
||||
);
|
||||
Reference in new issue
Block a user