From 1f8dbd645da6896221b9cbd5c9d96c121ce05b2f Mon Sep 17 00:00:00 2001 From: Jamey Greenwood Date: Sat, 17 Jan 2026 21:49:16 +0000 Subject: [PATCH] feat: add About page to public storefront - Create ShopLive.About module and template - Add /about route to public shop live session - Reuse shop_components for header, footer, hero, rich text Co-Authored-By: Claude Opus 4.5 --- .../live/shop_live/about.ex | 34 +++++++++++++++++++ .../live/shop_live/about.html.heex | 27 +++++++++++++++ lib/simpleshop_theme_web/router.ex | 1 + 3 files changed, 62 insertions(+) create mode 100644 lib/simpleshop_theme_web/live/shop_live/about.ex create mode 100644 lib/simpleshop_theme_web/live/shop_live/about.html.heex diff --git a/lib/simpleshop_theme_web/live/shop_live/about.ex b/lib/simpleshop_theme_web/live/shop_live/about.ex new file mode 100644 index 0000000..43402fe --- /dev/null +++ b/lib/simpleshop_theme_web/live/shop_live/about.ex @@ -0,0 +1,34 @@ +defmodule SimpleshopThemeWeb.ShopLive.About do + use SimpleshopThemeWeb, :live_view + + alias SimpleshopTheme.Settings + alias SimpleshopTheme.Media + alias SimpleshopTheme.Theme.{CSSCache, CSSGenerator, PreviewData} + + @impl true + def mount(_params, _session, socket) do + theme_settings = Settings.get_theme_settings() + + generated_css = + case CSSCache.get() do + {:ok, css} -> css + :miss -> + css = CSSGenerator.generate(theme_settings) + CSSCache.put(css) + css + end + + logo_image = Media.get_logo() + header_image = Media.get_header() + + socket = + socket + |> assign(:page_title, "About") + |> assign(:theme_settings, theme_settings) + |> assign(:generated_css, generated_css) + |> assign(:logo_image, logo_image) + |> assign(:header_image, header_image) + + {:ok, socket} + end +end diff --git a/lib/simpleshop_theme_web/live/shop_live/about.html.heex b/lib/simpleshop_theme_web/live/shop_live/about.html.heex new file mode 100644 index 0000000..eb75b0f --- /dev/null +++ b/lib/simpleshop_theme_web/live/shop_live/about.html.heex @@ -0,0 +1,27 @@ +
+ <.skip_link /> + + <%= if @theme_settings.announcement_bar do %> + <.announcement_bar theme_settings={@theme_settings} /> + <% end %> + + <.shop_header theme_settings={@theme_settings} logo_image={@logo_image} header_image={@header_image} active_page="about" mode={:shop} cart_count={0} /> + +
+ <.hero_section + title="About the studio" + description="Nature photography, printed with care" + background={:sunken} + /> + + <.content_body image_url="/mockups/night-sky-blanket-3.jpg"> + <.rich_text blocks={SimpleshopTheme.Theme.PreviewData.about_content()} /> + +
+ + <.shop_footer theme_settings={@theme_settings} mode={:shop} /> + + <.cart_drawer cart_items={[]} subtotal="£0.00" mode={:shop} /> + + <.search_modal hint_text={~s(Try searching for "mountain", "forest", or "ocean")} /> +
diff --git a/lib/simpleshop_theme_web/router.ex b/lib/simpleshop_theme_web/router.ex index ce03774..fea438c 100644 --- a/lib/simpleshop_theme_web/router.ex +++ b/lib/simpleshop_theme_web/router.ex @@ -27,6 +27,7 @@ defmodule SimpleshopThemeWeb.Router do live_session :public_shop, layout: {SimpleshopThemeWeb.Layouts, :shop} do live "/", ShopLive.Home, :index + live "/about", ShopLive.About, :index end end