Skip to content

Commit

Permalink
fix: log out functionality (#506)
Browse files Browse the repository at this point in the history
  • Loading branch information
Afonso-santos authored Jun 25, 2024
1 parent 61ea005 commit 9aea5da
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/atomic_web/components/dropdown.ex
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ defmodule AtomicWeb.Components.Dropdown do
<div id={@id} class={"#{if @orientation == :down, do: "origin-top-right top-full", else: "origin-bottom-right bottom-full"} absolute right-0 z-10 mt-2 hidden w-56 rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5"}>
<div class="py-1" role="menu" aria-orientation="vertical" aria-labelledby="options-menu">
<%= for item <- @items do %>
<a href={item.link} class="block flex items-center gap-x-2 px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 hover:text-gray-900" role="menuitem">
<.link href={item.link} class="block flex items-center gap-x-2 px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 hover:text-gray-900" role="menuitem" method={Map.get(item, :method, "get")}>
<%= if item[:icon] do %>
<.icon solid={@icon_variant == :solid} mini={@icon_variant == :mini} name={item.icon} class="ml-2 inline-block h-5 w-5" />
<% end %>
<%= item.name %>
</a>
</.link>
<% end %>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion lib/atomic_web/templates/layout/_live_navbar.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
orientation={:top}
items={[
%{name: "Your profile", link: Routes.profile_show_path(@socket, :show, @current_user)},
%{name: "Sign out", link: Routes.user_session_path(@socket, :delete)}
%{name: "Sign out", link: Routes.user_session_path(@socket, :delete), method: "delete"}
]}
id="user-menu-button"
>
Expand Down

0 comments on commit 9aea5da

Please sign in to comment.