forked from shibao/cannery
		
	style registration pages
This commit is contained in:
		| @@ -1,20 +1,37 @@ | ||||
| defmodule LokalWeb.Live.Component.Topbar do | ||||
|   use LokalWeb, :live_component | ||||
|    | ||||
|   def mount(socket), do: {:ok, socket |> assign(results: [])} | ||||
|   alias LokalWeb.{PageLive} | ||||
|    | ||||
|   def mount(socket) do | ||||
|     {:ok, socket |> assign(results: [], title_content: nil)} | ||||
|   end | ||||
|    | ||||
|   def update(assigns, socket) do | ||||
|     {:ok, socket |> assign(assigns)} | ||||
|   end | ||||
|  | ||||
|   def render(assigns) do | ||||
|     ~L""" | ||||
|     <header class="mb-4 px-8 py-4 w-full bg-primary-400"> | ||||
|     <header class="mb-8 px-8 py-4 w-full bg-primary-400"> | ||||
|       <nav role="navigation"> | ||||
|         <div class="flex flex-row justify-between items-center space-x-4"> | ||||
|           <h1 class="leading-5 text-xl text-white">Lokal</h1> | ||||
|           <div class="flex flex-row justify-start items-center space-x-2"> | ||||
|             <%= link to: Routes.page_path(LokalWeb.Endpoint, :index) do %> | ||||
|               <h1 class="leading-5 text-xl text-white hover:underline">Lokal</h1> | ||||
|             <% end %> | ||||
|              | ||||
|             <%= if @title_content do %> | ||||
|               <span>|</span> | ||||
|               <%= @title_content %> | ||||
|             <% end %> | ||||
|           </div> | ||||
|          | ||||
|           <ul class="flex flex-row flex-wrap justify-center items-center | ||||
|             text-lg space-x-4 text-lg text-white"> | ||||
|             <%# search %> | ||||
|             <form phx-change="suggest" phx-submit="search"> | ||||
|               <input type="text" name="q" class="input" | ||||
|               <input type="text" name="q" class="input input-primary" | ||||
|                 placeholder="Search" list="results" autocomplete="off"/> | ||||
|               <datalist id="results"> | ||||
|                 <%= for {app, _vsn} <- @results do %> | ||||
| @@ -22,7 +39,7 @@ defmodule LokalWeb.Live.Component.Topbar do | ||||
|                 <% end %> | ||||
|               </datalist> | ||||
|             </form> | ||||
|            | ||||
|  | ||||
|             <%# user settings %> | ||||
|             <%= if assigns |> Map.has_key?(:current_user) do %> | ||||
|               <li> | ||||
| @@ -35,7 +52,7 @@ defmodule LokalWeb.Live.Component.Topbar do | ||||
|                 <%= link "Log out", class: "hover:underline", | ||||
|                   to: Routes.user_session_path(LokalWeb.Endpoint, :delete), method: :delete %> | ||||
|               </li> | ||||
|                | ||||
|  | ||||
|               <%= if function_exported?(Routes, :live_dashboard_path, 2) do %> | ||||
|                 <li> | ||||
|                   <%= link "LiveDashboard", class: "hover:underline", | ||||
| @@ -55,7 +72,7 @@ defmodule LokalWeb.Live.Component.Topbar do | ||||
|           </ul> | ||||
|         </div> | ||||
|       </nav> | ||||
|        | ||||
|  | ||||
|       <%= if live_flash(@flash, :info) do %> | ||||
|         <p class="alert alert-info" role="alert" | ||||
|           phx-click="lv:clear-flash" phx-value-key="info"> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user