Imported from tongthanhdat009/OnlineMarket (
frontend-customer/src/layouts/AGENTS.md). Install upstream withnpx skills add tongthanhdat009/OnlineMarket --skill layouts. Copyright stays with the author.
layouts
Purpose
Storefront shells.
Key Files
| File | Description |
|---|---|
StoreLayout.tsx |
181 lines. Exports StoreLayout — the header, the category nav, the outlet, the AI assistant mount and the footer — plus AuthLayout. |
AccountLayout.tsx |
48 lines. Exports AccountLayout — the /account side nav (profile, security, orders, bills, refunds) around the outlet. |
For AI Agents
Working In This Directory
StoreLayoutwraps every public page;AuthLayoutwraps the login and register pages, which sit outsideStoreLayoutin../app/router.tsx.AccountLayoutrenders inside theProtectedRoutebranch — it may assume a signed-in customer.- The AI assistant is mounted in
StoreLayout, not in a page. Do not mount it a second time. - The header reads the cart count from
useCart()and the session fromuseAuth()— both come from../app/providers.tsx.
Testing Requirements
npm run build --prefix frontend-customer.npm test --prefix frontend-customer -- --run.- No layout test. Verify manually: browse anonymously, sign in, open
/account.
Common Patterns
- The layouts use
useOutlet/Outletfor the page slot — the route tree defines the child, the layout provides the chrome. - Vietnamese copy and the storefront tokens from
../styles.css.
Dependencies
Internal
../app/router.tsx— where the layouts are placed in the route tree../app/providers.tsx—useAuth,useCart,useToast../components/store-ui.tsx— buttons and search../components/StoreFooter.tsx— the footer../components/ai/AiAssistant.tsx— the AI assistant mount
External
- react-router-dom 7.18.4 —
Outlet,NavLink
