diff --git a/lib/simpleshop_theme_web/components/page_templates.ex b/lib/simpleshop_theme_web/components/page_templates.ex new file mode 100644 index 0000000..d6f5cf2 --- /dev/null +++ b/lib/simpleshop_theme_web/components/page_templates.ex @@ -0,0 +1,21 @@ +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 + import SimpleshopThemeWeb.ShopComponents + + embed_templates "page_templates/*" +end diff --git a/lib/simpleshop_theme_web/live/shop_live/about.html.heex b/lib/simpleshop_theme_web/components/page_templates/about.html.heex similarity index 83% rename from lib/simpleshop_theme_web/live/shop_live/about.html.heex rename to lib/simpleshop_theme_web/components/page_templates/about.html.heex index eb75b0f..fbbacf8 100644 --- a/lib/simpleshop_theme_web/live/shop_live/about.html.heex +++ b/lib/simpleshop_theme_web/components/page_templates/about.html.heex @@ -5,7 +5,7 @@ <.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} /> + <.shop_header theme_settings={@theme_settings} logo_image={@logo_image} header_image={@header_image} active_page="about" mode={@mode} cart_count={@cart_count} />
<.hero_section @@ -19,9 +19,9 @@
- <.shop_footer theme_settings={@theme_settings} mode={:shop} /> + <.shop_footer theme_settings={@theme_settings} mode={@mode} /> - <.cart_drawer cart_items={[]} subtotal="£0.00" mode={:shop} /> + <.cart_drawer cart_items={@cart_items} subtotal={@cart_subtotal} mode={@mode} /> <.search_modal hint_text={~s(Try searching for "mountain", "forest", or "ocean")} /> diff --git a/lib/simpleshop_theme_web/components/page_templates/cart.html.heex b/lib/simpleshop_theme_web/components/page_templates/cart.html.heex new file mode 100644 index 0000000..7371879 --- /dev/null +++ b/lib/simpleshop_theme_web/components/page_templates/cart.html.heex @@ -0,0 +1,19 @@ +
+ <.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="cart" mode={@mode} cart_count={@cart_count} /> + +
+ <.page_title text="Your basket" /> + <.cart_layout items={@cart_page_items} subtotal={@cart_page_subtotal} mode={@mode} /> +
+ + <.shop_footer theme_settings={@theme_settings} mode={@mode} /> + + <.cart_drawer cart_items={@cart_items} subtotal={@cart_subtotal} mode={@mode} /> + <.search_modal hint_text={~s(Try searching for "mountain", "forest", or "ocean")} /> +
diff --git a/lib/simpleshop_theme_web/live/shop_live/products.html.heex b/lib/simpleshop_theme_web/components/page_templates/collection.html.heex similarity index 83% rename from lib/simpleshop_theme_web/live/shop_live/products.html.heex rename to lib/simpleshop_theme_web/components/page_templates/collection.html.heex index 0e6f1fe..2dd9029 100644 --- a/lib/simpleshop_theme_web/live/shop_live/products.html.heex +++ b/lib/simpleshop_theme_web/components/page_templates/collection.html.heex @@ -5,7 +5,7 @@ <.announcement_bar theme_settings={@theme_settings} /> <% end %> - <.shop_header theme_settings={@theme_settings} logo_image={@logo_image} header_image={@header_image} active_page="collection" mode={:shop} cart_count={0} /> + <.shop_header theme_settings={@theme_settings} logo_image={@logo_image} header_image={@header_image} active_page="collection" mode={@mode} cart_count={@cart_count} />
<.collection_header title="All Products" product_count={length(@preview_data.products)} /> @@ -18,7 +18,7 @@ <.product_card product={product} theme_settings={@theme_settings} - mode={:shop} + mode={@mode} variant={:default} show_category={true} /> @@ -27,9 +27,9 @@
- <.shop_footer theme_settings={@theme_settings} mode={:shop} /> + <.shop_footer theme_settings={@theme_settings} mode={@mode} /> - <.cart_drawer cart_items={[]} subtotal="£0.00" mode={:shop} /> + <.cart_drawer cart_items={@cart_items} subtotal={@cart_subtotal} mode={@mode} /> <.search_modal hint_text={~s(Try searching for "mountain", "forest", or "ocean")} /> diff --git a/lib/simpleshop_theme_web/live/shop_live/contact.html.heex b/lib/simpleshop_theme_web/components/page_templates/contact.html.heex similarity index 87% rename from lib/simpleshop_theme_web/live/shop_live/contact.html.heex rename to lib/simpleshop_theme_web/components/page_templates/contact.html.heex index aac2474..c920788 100644 --- a/lib/simpleshop_theme_web/live/shop_live/contact.html.heex +++ b/lib/simpleshop_theme_web/components/page_templates/contact.html.heex @@ -5,7 +5,7 @@ <.announcement_bar theme_settings={@theme_settings} /> <% end %> - <.shop_header theme_settings={@theme_settings} logo_image={@logo_image} header_image={@header_image} active_page="contact" mode={:shop} cart_count={0} /> + <.shop_header theme_settings={@theme_settings} logo_image={@logo_image} header_image={@header_image} active_page="contact" mode={@mode} cart_count={@cart_count} />
<.hero_section @@ -33,9 +33,9 @@
- <.shop_footer theme_settings={@theme_settings} mode={:shop} /> + <.shop_footer theme_settings={@theme_settings} mode={@mode} /> - <.cart_drawer cart_items={[]} subtotal="£0.00" mode={:shop} /> + <.cart_drawer cart_items={@cart_items} subtotal={@cart_subtotal} mode={@mode} /> <.search_modal hint_text={~s(Try searching for "mountain", "forest", or "ocean")} /> diff --git a/lib/simpleshop_theme_web/components/page_templates/error.html.heex b/lib/simpleshop_theme_web/components/page_templates/error.html.heex new file mode 100644 index 0000000..0d07e0c --- /dev/null +++ b/lib/simpleshop_theme_web/components/page_templates/error.html.heex @@ -0,0 +1,42 @@ +
+ <.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="error" mode={@mode} cart_count={@cart_count} /> + +
+
+ <.hero_section + variant={:error} + pre_title={@error_code} + title={@error_title} + description={@error_description} + cta_text="Go to Homepage" + cta_page="home" + secondary_cta_text="Browse Products" + secondary_cta_page="collection" + mode={@mode} + /> + + <.product_grid columns={:fixed_4} gap="gap-4" class="mt-12 max-w-xl mx-auto"> + <%= for product <- Enum.take(@preview_data.products, 4) do %> + <.product_card + product={product} + theme_settings={@theme_settings} + mode={@mode} + variant={:minimal} + /> + <% end %> + +
+
+ + <.shop_footer theme_settings={@theme_settings} mode={@mode} /> + + <.cart_drawer cart_items={@cart_items} subtotal={@cart_subtotal} mode={@mode} /> + + <.search_modal hint_text={~s(Try searching for "mountain", "forest", or "ocean")} /> +
diff --git a/lib/simpleshop_theme_web/live/shop_live/home.html.heex b/lib/simpleshop_theme_web/components/page_templates/home.html.heex similarity index 81% rename from lib/simpleshop_theme_web/live/shop_live/home.html.heex rename to lib/simpleshop_theme_web/components/page_templates/home.html.heex index aed1647..31dadc2 100644 --- a/lib/simpleshop_theme_web/live/shop_live/home.html.heex +++ b/lib/simpleshop_theme_web/components/page_templates/home.html.heex @@ -5,7 +5,7 @@ <.announcement_bar theme_settings={@theme_settings} /> <% end %> - <.shop_header theme_settings={@theme_settings} logo_image={@logo_image} header_image={@header_image} active_page="home" mode={:shop} cart_count={0} /> + <.shop_header theme_settings={@theme_settings} logo_image={@logo_image} header_image={@header_image} active_page="home" mode={@mode} cart_count={@cart_count} />
<.hero_section @@ -13,16 +13,16 @@ description="From art prints to apparel – unique products created by independent artists and delivered straight to your door." cta_text="Shop the collection" cta_page="collection" - mode={:shop} + mode={@mode} /> - <.category_nav categories={@preview_data.categories} mode={:shop} /> + <.category_nav categories={@preview_data.categories} mode={@mode} /> <.featured_products_section title="Featured products" products={@preview_data.products} theme_settings={@theme_settings} - mode={:shop} + mode={@mode} /> <.image_text_section @@ -31,13 +31,13 @@ image_url="/mockups/mountain-sunrise-print-3.jpg" link_text="Learn more about the studio →" link_page="about" - mode={:shop} + mode={@mode} />
- <.shop_footer theme_settings={@theme_settings} mode={:shop} /> + <.shop_footer theme_settings={@theme_settings} mode={@mode} /> - <.cart_drawer cart_items={[]} subtotal="£0.00" mode={:shop} /> + <.cart_drawer cart_items={@cart_items} subtotal={@cart_subtotal} mode={@mode} /> <.search_modal hint_text={~s(Try searching for "mountain", "forest", or "ocean")} /> diff --git a/lib/simpleshop_theme_web/live/shop_live/product_show.html.heex b/lib/simpleshop_theme_web/components/page_templates/pdp.html.heex similarity index 84% rename from lib/simpleshop_theme_web/live/shop_live/product_show.html.heex rename to lib/simpleshop_theme_web/components/page_templates/pdp.html.heex index 5b78c58..7d93ad3 100644 --- a/lib/simpleshop_theme_web/live/shop_live/product_show.html.heex +++ b/lib/simpleshop_theme_web/components/page_templates/pdp.html.heex @@ -5,14 +5,14 @@ <.announcement_bar theme_settings={@theme_settings} /> <% end %> - <.shop_header theme_settings={@theme_settings} logo_image={@logo_image} header_image={@header_image} active_page="pdp" mode={:shop} cart_count={0} /> + <.shop_header theme_settings={@theme_settings} logo_image={@logo_image} header_image={@header_image} active_page="pdp" mode={@mode} cart_count={@cart_count} />
<.breadcrumb items={[ %{label: "Home", page: "home", href: "/"}, %{label: @product.category, page: "collection", href: "/products"}, %{label: @product.name, current: true} - ]} mode={:shop} /> + ]} mode={@mode} />
<.product_gallery images={@gallery_images} product_name={@product.name} /> @@ -33,12 +33,12 @@ :if={@theme_settings.pdp_related_products} products={@related_products} theme_settings={@theme_settings} - mode={:shop} + mode={@mode} />
- <.shop_footer theme_settings={@theme_settings} mode={:shop} /> + <.shop_footer theme_settings={@theme_settings} mode={@mode} /> - <.cart_drawer cart_items={[]} subtotal="£0.00" mode={:shop} /> + <.cart_drawer cart_items={@cart_items} subtotal={@cart_subtotal} mode={@mode} /> <.search_modal hint_text={~s(Try searching for "mountain", "forest", or "ocean")} /> diff --git a/lib/simpleshop_theme_web/live/shop_live/about.ex b/lib/simpleshop_theme_web/live/shop_live/about.ex index 43402fe..66678ce 100644 --- a/lib/simpleshop_theme_web/live/shop_live/about.ex +++ b/lib/simpleshop_theme_web/live/shop_live/about.ex @@ -3,7 +3,7 @@ defmodule SimpleshopThemeWeb.ShopLive.About do alias SimpleshopTheme.Settings alias SimpleshopTheme.Media - alias SimpleshopTheme.Theme.{CSSCache, CSSGenerator, PreviewData} + alias SimpleshopTheme.Theme.{CSSCache, CSSGenerator} @impl true def mount(_params, _session, socket) do @@ -28,7 +28,26 @@ defmodule SimpleshopThemeWeb.ShopLive.About do |> assign(:generated_css, generated_css) |> assign(:logo_image, logo_image) |> assign(:header_image, header_image) + |> assign(:mode, :shop) + |> assign(:cart_items, []) + |> assign(:cart_count, 0) + |> assign(:cart_subtotal, "£0.00") {:ok, socket} end + + @impl true + def render(assigns) do + ~H""" + + """ + end end diff --git a/lib/simpleshop_theme_web/live/shop_live/contact.ex b/lib/simpleshop_theme_web/live/shop_live/contact.ex index 14b93ea..af37f1e 100644 --- a/lib/simpleshop_theme_web/live/shop_live/contact.ex +++ b/lib/simpleshop_theme_web/live/shop_live/contact.ex @@ -28,7 +28,26 @@ defmodule SimpleshopThemeWeb.ShopLive.Contact do |> assign(:generated_css, generated_css) |> assign(:logo_image, logo_image) |> assign(:header_image, header_image) + |> assign(:mode, :shop) + |> assign(:cart_items, []) + |> assign(:cart_count, 0) + |> assign(:cart_subtotal, "£0.00") {:ok, socket} end + + @impl true + def render(assigns) do + ~H""" + + """ + end end diff --git a/lib/simpleshop_theme_web/live/shop_live/home.ex b/lib/simpleshop_theme_web/live/shop_live/home.ex index 3ca9f80..948d4f1 100644 --- a/lib/simpleshop_theme_web/live/shop_live/home.ex +++ b/lib/simpleshop_theme_web/live/shop_live/home.ex @@ -7,7 +7,6 @@ defmodule SimpleshopThemeWeb.ShopLive.Home do @impl true def mount(_params, _session, socket) do - # Load theme settings (cached CSS for performance) theme_settings = Settings.get_theme_settings() generated_css = @@ -35,7 +34,27 @@ defmodule SimpleshopThemeWeb.ShopLive.Home do |> assign(:logo_image, logo_image) |> assign(:header_image, header_image) |> assign(:preview_data, preview_data) + |> assign(:mode, :shop) + |> assign(:cart_items, []) + |> assign(:cart_count, 0) + |> assign(:cart_subtotal, "£0.00") {:ok, socket} end + + @impl true + def render(assigns) do + ~H""" + + """ + end end diff --git a/lib/simpleshop_theme_web/live/shop_live/product_show.ex b/lib/simpleshop_theme_web/live/shop_live/product_show.ex index 4046279..f90b9cd 100644 --- a/lib/simpleshop_theme_web/live/shop_live/product_show.ex +++ b/lib/simpleshop_theme_web/live/shop_live/product_show.ex @@ -52,7 +52,30 @@ defmodule SimpleshopThemeWeb.ShopLive.ProductShow do |> assign(:gallery_images, gallery_images) |> assign(:related_products, related_products) |> assign(:quantity, 1) + |> assign(:mode, :shop) + |> assign(:cart_items, []) + |> assign(:cart_count, 0) + |> assign(:cart_subtotal, "£0.00") {:ok, socket} end + + @impl true + def render(assigns) do + ~H""" + + """ + end end diff --git a/lib/simpleshop_theme_web/live/shop_live/products.ex b/lib/simpleshop_theme_web/live/shop_live/products.ex index 6e5927d..34e5eee 100644 --- a/lib/simpleshop_theme_web/live/shop_live/products.ex +++ b/lib/simpleshop_theme_web/live/shop_live/products.ex @@ -34,7 +34,27 @@ defmodule SimpleshopThemeWeb.ShopLive.Products do |> assign(:logo_image, logo_image) |> assign(:header_image, header_image) |> assign(:preview_data, preview_data) + |> assign(:mode, :shop) + |> assign(:cart_items, []) + |> assign(:cart_count, 0) + |> assign(:cart_subtotal, "£0.00") {:ok, socket} end + + @impl true + def render(assigns) do + ~H""" + + """ + end end diff --git a/lib/simpleshop_theme_web/live/theme_live/index.ex b/lib/simpleshop_theme_web/live/theme_live/index.ex index 79ac447..1fe2301 100644 --- a/lib/simpleshop_theme_web/live/theme_live/index.ex +++ b/lib/simpleshop_theme_web/live/theme_live/index.ex @@ -289,4 +289,141 @@ defmodule SimpleshopThemeWeb.ThemeLive.Index do def error_to_string(:too_many_files), do: "Too many files" def error_to_string(:not_accepted), do: "File type not accepted" def error_to_string(err), do: inspect(err) + + # Preview page component - delegates to shared PageTemplates with preview-specific assigns + attr :page, :atom, required: true + attr :preview_data, :map, required: true + attr :theme_settings, :map, required: true + attr :logo_image, :any, required: true + attr :header_image, :any, required: true + + defp preview_page(%{page: :home} = assigns) do + ~H""" + + """ + end + + defp preview_page(%{page: :collection} = assigns) do + ~H""" + + """ + end + + defp preview_page(%{page: :pdp} = assigns) do + product = List.first(assigns.preview_data.products) + + assigns = + assigns + |> assign(:product, product) + |> assign(:gallery_images, build_gallery_images(product)) + |> assign(:related_products, Enum.slice(assigns.preview_data.products, 1, 4)) + + ~H""" + + """ + end + + defp preview_page(%{page: :cart} = assigns) do + cart_items = assigns.preview_data.cart_items + subtotal = Enum.reduce(cart_items, 0, fn item, acc -> acc + item.product.price * item.quantity end) + + assigns = + assigns + |> assign(:cart_page_items, cart_items) + |> assign(:cart_page_subtotal, subtotal) + + ~H""" + + """ + end + + defp preview_page(%{page: :about} = assigns) do + ~H""" + + """ + end + + defp preview_page(%{page: :contact} = assigns) do + ~H""" + + """ + end + + defp preview_page(%{page: :error} = assigns) do + ~H""" + + """ + end + + defp build_gallery_images(product) do + [product.image_url, product.hover_image_url, product.image_url, product.hover_image_url] + end end diff --git a/lib/simpleshop_theme_web/live/theme_live/index.html.heex b/lib/simpleshop_theme_web/live/theme_live/index.html.heex index fc80a31..bfe621c 100644 --- a/lib/simpleshop_theme_web/live/theme_live/index.html.heex +++ b/lib/simpleshop_theme_web/live/theme_live/index.html.heex @@ -903,22 +903,13 @@ <%= Phoenix.HTML.raw(@generated_css) %> - <%= case @preview_page do %> - <% :home -> %> - - <% :collection -> %> - - <% :pdp -> %> - - <% :cart -> %> - - <% :about -> %> - - <% :contact -> %> - - <% :error -> %> - - <% end %> + <.preview_page + page={@preview_page} + preview_data={@preview_data} + theme_settings={@theme_settings} + logo_image={@logo_image} + header_image={@header_image} + /> diff --git a/lib/simpleshop_theme_web/live/theme_live/preview_pages.ex b/lib/simpleshop_theme_web/live/theme_live/preview_pages.ex index 700624c..e69de29 100644 --- a/lib/simpleshop_theme_web/live/theme_live/preview_pages.ex +++ b/lib/simpleshop_theme_web/live/theme_live/preview_pages.ex @@ -1,6 +0,0 @@ -defmodule SimpleshopThemeWeb.ThemeLive.PreviewPages do - use Phoenix.Component - import SimpleshopThemeWeb.ShopComponents - - embed_templates "preview_pages/*" -end diff --git a/lib/simpleshop_theme_web/live/theme_live/preview_pages/about.html.heex b/lib/simpleshop_theme_web/live/theme_live/preview_pages/about.html.heex deleted file mode 100644 index a4e5cd0..0000000 --- a/lib/simpleshop_theme_web/live/theme_live/preview_pages/about.html.heex +++ /dev/null @@ -1,26 +0,0 @@ -
- <.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={:preview} cart_count={2} /> - -
- <.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={:preview} /> - - <.cart_drawer cart_items={SimpleshopTheme.Theme.PreviewData.cart_drawer_items()} subtotal="£72.00" mode={:preview} /> - <.search_modal hint_text={~s(Try searching for "mountain", "forest", or "ocean")} /> -
diff --git a/lib/simpleshop_theme_web/live/theme_live/preview_pages/cart.html.heex b/lib/simpleshop_theme_web/live/theme_live/preview_pages/cart.html.heex deleted file mode 100644 index d4d2d6a..0000000 --- a/lib/simpleshop_theme_web/live/theme_live/preview_pages/cart.html.heex +++ /dev/null @@ -1,22 +0,0 @@ -<% - subtotal = Enum.reduce(@preview_data.cart_items, 0, fn item, acc -> acc + item.product.price * item.quantity end) -%> -
- <.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="cart" mode={:preview} cart_count={2} /> - -
- <.page_title text="Your basket" /> - <.cart_layout items={@preview_data.cart_items} subtotal={subtotal} mode={:preview} /> -
- - <.shop_footer theme_settings={@theme_settings} mode={:preview} /> - - <.cart_drawer cart_items={SimpleshopTheme.Theme.PreviewData.cart_drawer_items()} subtotal="£72.00" mode={:preview} /> - <.search_modal hint_text={~s(Try searching for "mountain", "forest", or "ocean")} /> -
diff --git a/lib/simpleshop_theme_web/live/theme_live/preview_pages/collection.html.heex b/lib/simpleshop_theme_web/live/theme_live/preview_pages/collection.html.heex deleted file mode 100644 index b088194..0000000 --- a/lib/simpleshop_theme_web/live/theme_live/preview_pages/collection.html.heex +++ /dev/null @@ -1,44 +0,0 @@ -
- - <.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="collection" mode={:preview} cart_count={2} /> - - -
- <.collection_header title="All Products" product_count={length(@preview_data.products)} /> - -
- - <.filter_bar categories={@preview_data.categories} /> - - - <.product_grid theme_settings={@theme_settings}> - <%= for product <- @preview_data.products do %> - <.product_card - product={product} - theme_settings={@theme_settings} - mode={:preview} - variant={:default} - show_category={true} - /> - <% end %> - -
-
- - - <.shop_footer theme_settings={@theme_settings} mode={:preview} /> - - - - <.cart_drawer cart_items={SimpleshopTheme.Theme.PreviewData.cart_drawer_items()} subtotal="£72.00" mode={:preview} /> - - <.search_modal hint_text={~s(Try searching for "mountain", "forest", or "ocean")} /> -
diff --git a/lib/simpleshop_theme_web/live/theme_live/preview_pages/contact.html.heex b/lib/simpleshop_theme_web/live/theme_live/preview_pages/contact.html.heex deleted file mode 100644 index b123f76..0000000 --- a/lib/simpleshop_theme_web/live/theme_live/preview_pages/contact.html.heex +++ /dev/null @@ -1,53 +0,0 @@ -
- - <.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="contact" mode={:preview} cart_count={2} /> - -
- <.hero_section - variant={:page} - title="Contact Us" - description="Questions about your order or just want to say hello? Drop us a message and we'll get back to you as soon as we can." - /> - -
- - <.contact_form /> - - -
- - <.order_tracking_card /> - - - <.info_card title="Handy to know" items={[ - %{label: "Printing", value: "2-5 business days"}, - %{label: "Delivery", value: "3-7 business days after printing"}, - %{label: "Returns", value: "Happy to help with faulty or damaged items"} - ]} /> - - - <.contact_info_card email="hello@example.com" /> - - - <.social_links /> -
-
-
- - - <.shop_footer theme_settings={@theme_settings} mode={:preview} /> - - - - <.cart_drawer cart_items={SimpleshopTheme.Theme.PreviewData.cart_drawer_items()} subtotal="£72.00" mode={:preview} /> - - <.search_modal hint_text={~s(Try searching for "mountain", "forest", or "ocean")} /> -
diff --git a/lib/simpleshop_theme_web/live/theme_live/preview_pages/error.html.heex b/lib/simpleshop_theme_web/live/theme_live/preview_pages/error.html.heex deleted file mode 100644 index e31d5af..0000000 --- a/lib/simpleshop_theme_web/live/theme_live/preview_pages/error.html.heex +++ /dev/null @@ -1,48 +0,0 @@ -
- - <.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="error" mode={:preview} cart_count={2} /> - -
-
- <.hero_section - variant={:error} - pre_title="404" - title="Page Not Found" - description="Sorry, we couldn't find the page you're looking for. Perhaps you've mistyped the URL or the page has been moved." - cta_text="Go to Homepage" - cta_page="home" - secondary_cta_text="Browse Products" - secondary_cta_page="collection" - mode={:preview} - /> - - <.product_grid columns={:fixed_4} gap="gap-4" class="mt-12 max-w-xl mx-auto"> - <%= for product <- Enum.take(@preview_data.products, 4) do %> - <.product_card - product={product} - theme_settings={@theme_settings} - mode={:preview} - variant={:minimal} - /> - <% end %> - -
-
- - - <.shop_footer theme_settings={@theme_settings} mode={:preview} /> - - - - <.cart_drawer cart_items={SimpleshopTheme.Theme.PreviewData.cart_drawer_items()} subtotal="£72.00" mode={:preview} /> - - <.search_modal hint_text={~s(Try searching for "mountain", "forest", or "ocean")} /> -
diff --git a/lib/simpleshop_theme_web/live/theme_live/preview_pages/home.html.heex b/lib/simpleshop_theme_web/live/theme_live/preview_pages/home.html.heex deleted file mode 100644 index ad6127e..0000000 --- a/lib/simpleshop_theme_web/live/theme_live/preview_pages/home.html.heex +++ /dev/null @@ -1,53 +0,0 @@ -
- - <.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="home" mode={:preview} cart_count={2} /> - - -
- <.hero_section - title="Original designs, printed on demand" - description="From art prints to apparel – unique products created by independent artists and delivered straight to your door." - cta_text="Shop the collection" - cta_page="collection" - mode={:preview} - /> - - - <.category_nav categories={@preview_data.categories} mode={:preview} /> - - - <.featured_products_section - title="Featured products" - products={@preview_data.products} - theme_settings={@theme_settings} - mode={:preview} - /> - - - <.image_text_section - title="Made with passion, printed with care" - description="Every design starts with an idea. We work with quality print partners to bring those ideas to life on premium products – from gallery-quality art prints to everyday essentials." - image_url="/mockups/mountain-sunrise-print-3.jpg" - link_text="Learn more about the studio →" - link_page="about" - mode={:preview} - /> -
- - - <.shop_footer theme_settings={@theme_settings} mode={:preview} /> - - - <.cart_drawer cart_items={SimpleshopTheme.Theme.PreviewData.cart_drawer_items()} subtotal="£72.00" mode={:preview} /> - - - <.search_modal hint_text={~s(Try searching for "mountain", "forest", or "ocean")} /> -
diff --git a/lib/simpleshop_theme_web/live/theme_live/preview_pages/pdp.html.heex b/lib/simpleshop_theme_web/live/theme_live/preview_pages/pdp.html.heex deleted file mode 100644 index 344a0f5..0000000 --- a/lib/simpleshop_theme_web/live/theme_live/preview_pages/pdp.html.heex +++ /dev/null @@ -1,48 +0,0 @@ -<% - product = List.first(@preview_data.products) - gallery_images = [product.image_url, product.hover_image_url, product.image_url, product.hover_image_url] -%> -
- <.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="pdp" mode={:preview} cart_count={2} /> - -
- <.breadcrumb items={[ - %{label: "Home", page: "home", href: "/"}, - %{label: product.category, page: "collection", href: "/products"}, - %{label: product.name, current: true} - ]} mode={:preview} /> - -
- <.product_gallery images={gallery_images} product_name={product.name} /> - -
- <.product_info product={product} /> - <.variant_selector label="Size" options={["S", "M", "L", "XL"]} /> - <.quantity_selector quantity={1} in_stock={product.in_stock} /> - <.add_to_cart_button /> - <.trust_badges :if={@theme_settings.pdp_trust_badges} /> - <.product_details product={product} /> -
-
- - <.reviews_section :if={@theme_settings.pdp_reviews} reviews={SimpleshopTheme.Theme.PreviewData.reviews()} average_rating={5} total_count={24} /> - - <.related_products_section - :if={@theme_settings.pdp_related_products} - products={Enum.slice(@preview_data.products, 1, 4)} - theme_settings={@theme_settings} - mode={:preview} - /> -
- - <.shop_footer theme_settings={@theme_settings} mode={:preview} /> - - <.cart_drawer cart_items={SimpleshopTheme.Theme.PreviewData.cart_drawer_items()} subtotal="£72.00" mode={:preview} /> - <.search_modal hint_text={~s(Try searching for "mountain", "forest", or "ocean")} /> -