|
1 | 1 | <header class="px-4 sm:px-6 lg:px-8">
|
2 |
| - <div class="flex items-center justify-between border-b border-zinc-100 py-3 text-sm"> |
| 2 | + <div class="hidden sm:flex items-center justify-between border-b border-zinc-100 py-3 text-sm"> |
| 3 | + <!-- Navbar (desktop) --> |
3 | 4 | <div class="flex items-center gap-4">
|
4 |
| - <a href="/"> |
| 5 | + <.link navigate="/"> |
5 | 6 | <img src={~p"/images/cesium-link.svg"} width="150" />
|
6 |
| - </a> |
| 7 | + </.link> |
7 | 8 | <ul class="relative z-10 flex items-center gap-2 sm:gap-8 px-4 sm:px-6 lg:px-8 justify-end">
|
8 | 9 | <li>
|
9 |
| - <.link href={~p"/admin/links"} class="text-[0.8125rem] leading-6 text-zinc-900 font-semibold hover:text-zinc-700 flex gap-1"> |
| 10 | + <.link patch={~p"/admin/links"} class="text-[0.8125rem] leading-6 text-zinc-900 font-semibold hover:text-zinc-700 flex gap-1"> |
10 | 11 | <.icon name="hero-link" class="w-4 h-4 self-center" /> Links
|
11 | 12 | </.link>
|
12 | 13 | </li>
|
13 | 14 | <li>
|
14 |
| - <.link href={~p"/admin/redirects"} class="text-[0.8125rem] leading-6 text-zinc-900 font-semibold hover:text-zinc-700 flex gap-1"> |
| 15 | + <.link patch={~p"/admin/redirects"} class="text-[0.8125rem] leading-6 text-zinc-900 font-semibold hover:text-zinc-700 flex gap-1"> |
15 | 16 | <.icon name="hero-arrow-uturn-right" class="w-4 h-4 self-center" /> Redirects
|
16 | 17 | </.link>
|
17 | 18 | </li>
|
18 | 19 | <li>
|
19 |
| - <.link href={~p"/admin/qrcode"} class="text-[0.8125rem] leading-6 text-zinc-900 font-semibold hover:text-zinc-700 flex gap-1"> |
| 20 | + <.link patch={~p"/admin/qrcode"} class="text-[0.8125rem] leading-6 text-zinc-900 font-semibold hover:text-zinc-700 flex gap-1"> |
20 | 21 | <.icon name="hero-qr-code" class="w-4 h-4 self-center" /> QR Generator
|
21 | 22 | </.link>
|
22 | 23 | </li>
|
|
33 | 34 | <% end %>
|
34 | 35 | </div>
|
35 | 36 | </div>
|
| 37 | + <!-- Sidebar (mobile) --> |
| 38 | + <div class="sm:hidden flex flex-row-reverse items-center justify-between border-b border-zinc-100 py-2 text-sm"> |
| 39 | + <button type="button" class="text-zinc-900 hover:text-zinc-700" phx-click={JS.show(to: "#mobile-sidebar-container") |> JS.show(to: "#mobile-sidebar")}> |
| 40 | + <.icon name="hero-bars-3" class="w-7 h-7" /> |
| 41 | + </button> |
| 42 | + </div> |
36 | 43 | </header>
|
37 |
| -<main class="px-4 py-20 sm:px-6 lg:px-8"> |
| 44 | +<div id="mobile-sidebar-container" class="fixed inset-0 flex z-40 lg:hidden" aria-modal="true" style="display: none;"> |
| 45 | + <div class="fixed inset-0 bg-gray-600 bg-opacity-75" phx-click={JS.hide(to: "#mobile-sidebar-container")}></div> |
| 46 | + |
| 47 | + <div id="mobile-sidebar" class="relative flex-1 flex flex-col max-w-xs w-full pt-5 pb-4 bg-white min-h-screen h-full"> |
| 48 | + <div class="flex flex-col h-full py-4 overflow-y-auto scrollbar-hide"> |
| 49 | + <.link navigate="/" class="flex-shrink-0 flex items-center pt-4 px-16"> |
| 50 | + <img src={~p"/images/cesium-link.svg"} /> |
| 51 | + </.link> |
| 52 | + <ul class="flex flex-col gap-4 pl-6 pt-8 h-full"> |
| 53 | + <li> |
| 54 | + <.link patch={~p"/admin/links"} class="text-md leading-6 text-zinc-900 font-semibold hover:text-zinc-700 flex gap-1"> |
| 55 | + <.icon name="hero-link" class="w-4 h-4 self-center" /> Links |
| 56 | + </.link> |
| 57 | + </li> |
| 58 | + <li> |
| 59 | + <.link patch={~p"/admin/redirects"} class="text-md leading-6 text-zinc-900 font-semibold hover:text-zinc-700 flex gap-1"> |
| 60 | + <.icon name="hero-arrow-uturn-right" class="w-4 h-4 self-center" /> Redirects |
| 61 | + </.link> |
| 62 | + </li> |
| 63 | + <li> |
| 64 | + <.link patch={~p"/admin/qrcode"} class="text-md leading-6 text-zinc-900 font-semibold hover:text-zinc-700 flex gap-1"> |
| 65 | + <.icon name="hero-qr-code" class="w-4 h-4 self-center" /> QR Generator |
| 66 | + </.link> |
| 67 | + </li> |
| 68 | + <li :if={@current_user} class="mt-auto"> |
| 69 | + <div class="flex gap-x-4 py-4"> |
| 70 | + <p class="text-md leading-6 text-zinc-900"> |
| 71 | + <%= @current_user.email %> |
| 72 | + </p> |
| 73 | + <.link href={~p"/users/log_out"} method="delete" class="text-md leading-6 text-zinc-900 font-semibold hover:text-zinc-700"> |
| 74 | + <.icon name="hero-arrow-left-start-on-rectangle" /> |
| 75 | + </.link> |
| 76 | + </div> |
| 77 | + </li> |
| 78 | + </ul> |
| 79 | + </div> |
| 80 | + </div> |
| 81 | +</div> |
| 82 | +<main class="px-4 py-4 sm:py-20 sm:px-6 lg:px-8"> |
38 | 83 | <div class="mx-auto">
|
39 | 84 | <.flash_group flash={@flash} />
|
40 | 85 | <%= @inner_content %>
|
|
0 commit comments