Fix: TopNav when in mobile view (size < md) (#128)

* Update drawer_dropdown.ex

* Update top_nav.ex

* Update top_nav.ex

* Fix typo

* Fix missing argument
This commit is contained in:
Nduati Kuria 2024-04-29 22:58:39 +03:00 committed by GitHub
parent 00a8e64d12
commit fe789b159b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 3 deletions

View file

@ -103,12 +103,12 @@ defmodule AshAdmin.Components.TopNav do
<div :if={@open} class="md:hidden" x-cloak>
<div class="relative px-2 pt-2 pb-3 sm:px-3">
<div class="block px-4 py-2 text-sm">
<.live_component
<ActorSelect.actor_select
:if={@actor_resources != []}
module={ActorSelect}
actor_resources={@actor_resources}
authorizing={@authorizing}
actor_paused={@actor_paused}
actor_tenant={@actor_tenant}
actor={@actor}
toggle_authorizing={@toggle_authorizing}
toggle_actor_paused={@toggle_actor_paused}

View file

@ -46,7 +46,7 @@ defmodule AshAdmin.Components.TopNav.DrawerDropdown do
class="block px-4 py-2 text-sm hover:bg-gray-200 hover:text-gray-900"
role="menuitem"
>
{link.text}
<%= link.text %>
</.link>
</div>
</div>
@ -54,6 +54,10 @@ defmodule AshAdmin.Components.TopNav.DrawerDropdown do
"""
end
def mount(socket) do
{:ok, assign(socket, :open, false)}
end
def handle_event("toggle", _, socket) do
{:noreply, assign(socket, :open, !socket.assigns.open)}
end