berrypod/lib/simpleshop_theme_web/live/shop/content.ex
jamey deea04885f restructure LiveView directories: admin/, shop/, auth/
Consolidates admin_live/, theme_live/, provider_live/ into admin/
(with theme/ and providers/ subdirs). Renames shop_live/ to shop/
and user_live/ to auth/. Updates all module names, router refs,
test files, CSS source paths, and dialyzer ignore.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 00:16:32 +00:00

67 lines
1.7 KiB
Elixir
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

defmodule SimpleshopThemeWeb.Shop.Content do
use SimpleshopThemeWeb, :live_view
alias SimpleshopTheme.Theme.PreviewData
@impl true
def mount(_params, _session, socket) do
{:ok, socket}
end
@impl true
def handle_params(_params, _uri, socket) do
config = page_config(socket.assigns.live_action)
{:noreply, assign(socket, config)}
end
@impl true
def render(assigns) do
~H"""
<SimpleshopThemeWeb.PageTemplates.content {assigns} />
"""
end
defp page_config(:about) do
%{
page_title: "About",
active_page: "about",
hero_title: "About the studio",
hero_description: "Your story goes here this is sample content for the demo shop",
hero_background: :sunken,
image_src: "/mockups/night-sky-blanket-3",
image_alt: "Night sky blanket draped over a chair",
content_blocks: PreviewData.about_content()
}
end
defp page_config(:delivery) do
%{
page_title: "Delivery & returns",
active_page: "delivery",
hero_title: "Delivery & returns",
hero_description: "Everything you need to know about shipping and returns",
content_blocks: PreviewData.delivery_content()
}
end
defp page_config(:privacy) do
%{
page_title: "Privacy policy",
active_page: "privacy",
hero_title: "Privacy policy",
hero_description: "How we handle your personal information",
content_blocks: PreviewData.privacy_content()
}
end
defp page_config(:terms) do
%{
page_title: "Terms of service",
active_page: "terms",
hero_title: "Terms of service",
hero_description: "The legal bits",
content_blocks: PreviewData.terms_content()
}
end
end