Skip to content

Commit

Permalink
Clean up login state on main nav
Browse files Browse the repository at this point in the history
  • Loading branch information
zacksiri committed Feb 23, 2024
1 parent df32a4a commit 67bf389
Showing 1 changed file with 26 additions and 7 deletions.
33 changes: 26 additions & 7 deletions lib/polar_web/components/layouts/app.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,32 @@
</div>
<div class="hidden md:block">
<div class="ml-4 flex items-center md:ml-6">
<.link
href={~p"/users/log_in"}
class="text-slate-300 rounded-md px-3 py-2 text-sm font-medium hover:bg-slate-900 hover:text-white"
aria-current="page"
>
<%= gettext("Sign In") %>
</.link>
<%= if @current_user do %>
<p class="text-slate-300 rounded-md px-3 py-2 text-sm font-medium">
<%= @current_user.email %>
</p>
<.link
href={~p"/users/log_out"}
method="delete"
class="text-slate-300 rounded-md px-3 py-2 text-sm font-medium hover:bg-slate-900 hover:text-white"
>
<%= gettext("Log out") %>
</.link>
<% else %>
<.link
href={~p"/users/log_in"}
class="text-slate-300 rounded-md px-3 py-2 text-sm font-medium hover:bg-slate-900 hover:text-white"
aria-current="page"
>
<%= gettext("Sign In") %>
</.link>
<.link
href={~p"/users/register"}
class="text-slate-300 rounded-md px-3 py-2 text-sm font-medium hover:bg-slate-900 hover:text-white"
>
<%= gettext("Register") %>
</.link>
<% end %>
</div>
</div>
<div class="-mr-2 flex md:hidden">
Expand Down

0 comments on commit 67bf389

Please sign in to comment.