diff --git a/lib/simpleshop_theme_web/live/shop_live/contact.ex b/lib/simpleshop_theme_web/live/shop_live/contact.ex new file mode 100644 index 0000000..14b93ea --- /dev/null +++ b/lib/simpleshop_theme_web/live/shop_live/contact.ex @@ -0,0 +1,34 @@ +defmodule SimpleshopThemeWeb.ShopLive.Contact do + use SimpleshopThemeWeb, :live_view + + alias SimpleshopTheme.Settings + alias SimpleshopTheme.Media + alias SimpleshopTheme.Theme.{CSSCache, CSSGenerator} + + @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, "Contact") + |> 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/contact.html.heex b/lib/simpleshop_theme_web/live/shop_live/contact.html.heex new file mode 100644 index 0000000..aac2474 --- /dev/null +++ b/lib/simpleshop_theme_web/live/shop_live/contact.html.heex @@ -0,0 +1,41 @@ +
+ <.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={:shop} cart_count={0} /> + +
+ <.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={: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 fea438c..1b773ab 100644 --- a/lib/simpleshop_theme_web/router.ex +++ b/lib/simpleshop_theme_web/router.ex @@ -28,6 +28,7 @@ defmodule SimpleshopThemeWeb.Router do live_session :public_shop, layout: {SimpleshopThemeWeb.Layouts, :shop} do live "/", ShopLive.Home, :index live "/about", ShopLive.About, :index + live "/contact", ShopLive.Contact, :index end end