diff --git a/PROGRESS.md b/PROGRESS.md index 066e98b..4de8c3f 100644 --- a/PROGRESS.md +++ b/PROGRESS.md @@ -59,16 +59,16 @@ Issues found during hands-on testing of the deployed prod site on mobile and des - [x] Footer social icons should match the "Find me on" icons from the contact page ### Collections / all products -- [ ] Categories on all-products page are too spaced out +- [x] Categories on all-products page are too spaced out ### Content pages -- [ ] Hero title spacing differs between content pages (about, delivery, etc.) — contact is fine +- [x] Hero title spacing differs between content pages (about, delivery, etc.) — contact is fine ### Sale / filtering -- [ ] Should there be a "Sale" section or filter for discounted products? +- [x] Should there be a "Sale" section or filter for discounted products? ### Errors -- [ ] 404 page is broken +- [x] 404 page is broken (CSS path was wrong — `/assets/app.css` instead of `/assets/css/app.css`) ### Search (deferred — after usability fixes) - [ ] Search doesn't work (modal opens but no results/functionality) — see [docs/plans/search.md](docs/plans/search.md) diff --git a/lib/simpleshop_theme_web/components/page_templates/contact.html.heex b/lib/simpleshop_theme_web/components/page_templates/contact.html.heex index 0c65f12..89e8d8c 100644 --- a/lib/simpleshop_theme_web/components/page_templates/contact.html.heex +++ b/lib/simpleshop_theme_web/components/page_templates/contact.html.heex @@ -10,7 +10,7 @@ cart_status={assigns[:cart_status]} active_page="contact" > -
+
<.hero_section variant={:page} title="Get in touch" diff --git a/lib/simpleshop_theme_web/components/shop_components/product.ex b/lib/simpleshop_theme_web/components/shop_components/product.ex index 83e32ac..0f334cb 100644 --- a/lib/simpleshop_theme_web/components/shop_components/product.ex +++ b/lib/simpleshop_theme_web/components/shop_components/product.ex @@ -568,7 +568,7 @@ defmodule SimpleshopThemeWeb.ShopComponents.Product do /> <% :page -> %> -
+

{@error_code} - {@error_title} - + diff --git a/lib/simpleshop_theme_web/live/shop_live/collection.ex b/lib/simpleshop_theme_web/live/shop_live/collection.ex index ba15590..4367404 100644 --- a/lib/simpleshop_theme_web/live/shop_live/collection.ex +++ b/lib/simpleshop_theme_web/live/shop_live/collection.ex @@ -49,6 +49,11 @@ defmodule SimpleshopThemeWeb.ShopLive.Collection do {:ok, "All Products", nil, PreviewData.products()} end + defp load_collection("sale") do + sale_products = Enum.filter(PreviewData.products(), & &1.on_sale) + {:ok, "Sale", :sale, sale_products} + end + defp load_collection(slug) do case PreviewData.category_by_slug(slug) do nil -> :not_found @@ -59,7 +64,11 @@ defmodule SimpleshopThemeWeb.ShopLive.Collection do @impl true def handle_event("sort_changed", %{"sort" => sort}, socket) do slug = - if socket.assigns.current_category, do: socket.assigns.current_category.slug, else: "all" + case socket.assigns.current_category do + nil -> "all" + :sale -> "sale" + category -> category.slug + end {:noreply, push_patch(socket, to: ~p"/collections/#{slug}?sort=#{sort}")} end @@ -99,7 +108,13 @@ defmodule SimpleshopThemeWeb.ShopLive.Collection do
<.collection_filter_bar categories={@categories} - current_slug={@current_category && @current_category.slug} + current_slug={ + case @current_category do + :sale -> "sale" + nil -> nil + cat -> cat.slug + end + } sort_options={@sort_options} current_sort={@current_sort} /> @@ -111,7 +126,7 @@ defmodule SimpleshopThemeWeb.ShopLive.Collection do theme_settings={@theme_settings} mode={@mode} variant={:default} - show_category={@current_category == nil} + show_category={@current_category in [nil, :sale]} /> <% end %> @@ -136,14 +151,14 @@ defmodule SimpleshopThemeWeb.ShopLive.Collection do defp collection_filter_bar(assigns) do ~H""" -
-