diff --git a/lib/simpleshop_theme_web/components/layouts/root.html.heex b/lib/simpleshop_theme_web/components/layouts/root.html.heex index b3c5947..b115b0e 100644 --- a/lib/simpleshop_theme_web/components/layouts/root.html.heex +++ b/lib/simpleshop_theme_web/components/layouts/root.html.heex @@ -34,29 +34,36 @@ - + {@inner_content} diff --git a/lib/simpleshop_theme_web/live/theme_live/index.ex b/lib/simpleshop_theme_web/live/theme_live/index.ex index 1fe2301..8fd3126 100644 --- a/lib/simpleshop_theme_web/live/theme_live/index.ex +++ b/lib/simpleshop_theme_web/live/theme_live/index.ex @@ -31,6 +31,7 @@ defmodule SimpleshopThemeWeb.ThemeLive.Index do |> assign(:logo_image, logo_image) |> assign(:header_image, header_image) |> assign(:customise_open, false) + |> assign(:sidebar_collapsed, false) |> allow_upload(:logo_upload, accept: ~w(.png .jpg .jpeg .webp .svg), max_entries: 1, @@ -280,6 +281,11 @@ defmodule SimpleshopThemeWeb.ThemeLive.Index do {:noreply, assign(socket, :customise_open, !socket.assigns.customise_open)} end + @impl true + def handle_event("toggle_sidebar", _params, socket) do + {:noreply, assign(socket, :sidebar_collapsed, !socket.assigns.sidebar_collapsed)} + end + @impl true def handle_event("noop", _params, socket) do {:noreply, socket} 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 bfe621c..72b0902 100644 --- a/lib/simpleshop_theme_web/live/theme_live/index.html.heex +++ b/lib/simpleshop_theme_web/live/theme_live/index.html.heex @@ -1,11 +1,48 @@
-
+
+ + <%= if @sidebar_collapsed do %> +
+ +
+ <% else %> -
-

Theme Studio

-

One theme, infinite possibilities. Every combination is designed to work beautifully.

+
+
+

Theme Studio

+

One theme, infinite possibilities. Every combination is designed to work beautifully.

+
+
@@ -838,6 +875,7 @@
One of 100,000+ possible combinations
+ <% end %>