Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 5 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/ash_admin/components/top_nav.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ActorSelect is a function component not a live component

: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}
Expand Down
6 changes: 5 additions & 1 deletion lib/ash_admin/components/top_nav/drawer_dropdown.ex
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,18 @@ 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 %>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is the surface format

</.link>
</div>
</div>
</div>
"""
end

def mount(socket) do
{:ok, assign(socket, :open, false)}
end

Comment on lines +57 to +60
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@open requires a default value

def handle_event("toggle", _, socket) do
{:noreply, assign(socket, :open, !socket.assigns.open)}
end
Expand Down
Loading