Add header

This commit is contained in:
Ondřej 2024-08-10 12:33:48 +02:00
parent 3097b0f997
commit 9d95c74aab

View file

@ -7,25 +7,30 @@ defmodule ChoreTrackerWeb.Layouts do
def page_header(assigns) do def page_header(assigns) do
~H""" ~H"""
<header class="border-b col-span-12"> <header class="border-b col-span-12">
<nav class="flex items-center gap-4 px-6 justify-end"> <nav class="flex items-center gap-4 px-6 justify-between">
<%= if @current_user do %> <.link href={~p"/overview"}>
<p class="text-sm font-medium mr-2"> <strong>Chore tracker</strong>
<%= Accounts.display_user(@current_user) %> </.link>
</p> <div class="flex items-center gap-4">
<.header_link href={~p"/users/settings"}> <%= if @current_user do %>
Settings <p class="text-sm font-medium mr-2">
</.header_link> <%= Accounts.display_user(@current_user) %>
<.header_link href={~p"/users/log_out"} method="delete"> </p>
Log out <.header_link href={~p"/users/settings"}>
</.header_link> Settings
<% else %> </.header_link>
<.header_link href={~p"/users/register"}> <.header_link href={~p"/users/log_out"} method="delete">
Register Log out
</.header_link> </.header_link>
<.header_link href={~p"/users/log_in"}> <% else %>
Log in <.header_link href={~p"/users/register"}>
</.header_link> Register
<% end %> </.header_link>
<.header_link href={~p"/users/log_in"}>
Log in
</.header_link>
<% end %>
</div>
</nav> </nav>
</header> </header>
""" """