sloanelybutsurely.com/lib/cms_web/components/layouts/app.html.heex
2025-02-22 13:59:24 -05:00

42 lines
1.1 KiB
Text

<div
:if={@admin?}
class="sticky top-0 bg-white z-50 flex flex-row justify-between py-1 px-3 md:mb-2 border-b border-slate-100"
>
<section class="flex flex-row gap-x-2">
<div class="pr-2 border-r border-slate-100">
<.a navigate={~p"/admin"} class="font-bold">admin mode</.a>
</div>
<nav>
<ul class="flex flex-row">
<.a href={~p"/admin/posts/new"}>new post</.a>
</ul>
</nav>
</section>
<section class="flex flex-row">
<.a href={~p"/admin/session/destroy?return_to=#{@current_path}"}>
sign out
</.a>
</section>
</div>
<div class="flex flex-col md:flex-row mx-auto max-w-4xl">
<section class="flex flex-col p-2 gap-y-1 border-slate-100 border-b md:border-b-0">
<.a href={~p"/"} class="font-bold">sloanelybutsurely.com</.a>
<nav>
<ul>
<li>
<.a href={~p"/posts"}>writing</.a>
</li>
</ul>
</nav>
</section>
<main class="p-2 w-full">
{@inner_content}
</main>
</div>
<div
:if={not @admin?}
class="fixed right-0 bottom-0 p-2 text-transparent underline hover:text-current"
>
<.a href={~p"/sign-in?return_to=#{@current_path}"}>sign in</.a>
</div>