berrypod/lib/simpleshop_theme_web/components/page_templates.ex
jamey 3eacd91fda refactor: split shop_components.ex into 5 focused sub-modules
4,487-line monolith → 23-line facade + 5 modules:
- Base (inputs, buttons, cards)
- Layout (header, footer, mobile nav, shop_layout)
- Cart (drawer, items, order summary)
- Product (cards, gallery, variant selector, hero)
- Content (rich text, images, contact, reviews)

`use SimpleshopThemeWeb.ShopComponents` imports all sub-modules.
No single file over ~1,600 lines now.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 14:30:25 +00:00

22 lines
769 B
Elixir

defmodule SimpleshopThemeWeb.PageTemplates do
@moduledoc """
Shared page templates used by both the public shop and theme preview.
These templates accept a `mode` parameter to control navigation behavior:
- `:shop` - Links navigate normally (real shop pages)
- `:preview` - Links send events to parent LiveView (theme editor)
All templates expect these common assigns:
- `theme_settings` - Current theme configuration
- `logo_image` - Logo image struct or nil
- `header_image` - Header image struct or nil
- `mode` - `:shop` or `:preview`
- `cart_items` - List of cart items (can be empty)
- `cart_count` - Number of items in cart
"""
use Phoenix.Component
use SimpleshopThemeWeb.ShopComponents
embed_templates "page_templates/*"
end