diff --git a/apps/duskmoon_storybook_web/lib/duskmoon_storybook_web/components/layouts/app.html.heex b/apps/duskmoon_storybook_web/lib/duskmoon_storybook_web/components/layouts/app.html.heex index 39ed35f..1041fd7 100644 --- a/apps/duskmoon_storybook_web/lib/duskmoon_storybook_web/components/layouts/app.html.heex +++ b/apps/duskmoon_storybook_web/lib/duskmoon_storybook_web/components/layouts/app.html.heex @@ -54,6 +54,15 @@ <:menu> <.dm_left_menu_group active={assigns[:active_menu]}> + + <:title>Page <:menu id="page" to={~p"/"}> <.dm_mdi name={"page-layout-header"} class="w-4 h-4" /> @@ -121,8 +130,9 @@ +
- <%= @inner_content %> + <%= @inner_content %>
diff --git a/apps/phoenix_duskmoon/lib/phoenix_duskmoon/component/left_menu.ex b/apps/phoenix_duskmoon/lib/phoenix_duskmoon/component/left_menu.ex index aaf8f88..3d96cde 100644 --- a/apps/phoenix_duskmoon/lib/phoenix_duskmoon/component/left_menu.ex +++ b/apps/phoenix_duskmoon/lib/phoenix_duskmoon/component/left_menu.ex @@ -119,13 +119,6 @@ defmodule PhoenixDuskmoon.Component.LeftMenu do """ ) - attr(:active_class, :any, - default: "bg-blue-100 text-blue-500 dark:bg-blue-900 dark:text-blue-100", - doc: """ - active menu html attribute class - """ - ) - slot(:title, required: true, doc: """ @@ -152,42 +145,24 @@ defmodule PhoenixDuskmoon.Component.LeftMenu do |> assign_new(:title, fn -> nil end) ~H""" -
-
+ +
-
<.link - :for={{m, _i} <- Enum.with_index(@menu)} - class={[ - "flex flex-row justify-start items-center", - "px-6 py-4 rounded-lg w-full cursor-pointer", - if Map.get(m, :id, "") == @active do - @active_class - end, - Map.get(m, :class, "") - ]} - navigate={Map.get(m, :to, "")} + class={if(Map.get(m, :id, false) == assigns[:active], do: "active")} + navigate={Map.get(m, :to, "#")} > - - <%= render_slot(m) %> - + <%= render_slot(m) %> -
-
+ + """ end end