-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update UI with some css #4
Comments
@SimonLab want to try and add UI with Tailwind? dwyl/technology-stack#94 |
@SimonLab thoughts? We could add the date/time. as an enhancement later. 💭 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="csrf-token" content={csrf_token_value()}>
<%= live_title_tag assigns[:page_title] || "LiveviewChat", suffix: " · Phoenix Framework" %>
<!-- <link phx-track-static rel="stylesheet" href={Routes.static_path(@conn, "/assets/app.css")}/> -->
<script defer phx-track-static type="text/javascript" src={Routes.static_path(@conn, "/assets/app.js")}></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/alpinejs/3.10.2/cdn.js" defer></script>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body class="mx-5 mt-5">
<header>
<section class="container">
<nav>
<ul class="float-right">
<%= if @loggedin do %>
<li>
<img width="42px" src={@person.picture}/>
</li>
<li class="text-blue">
<%= link "logout", to: "/logout" %>
</li>
<% else %>
<li class="bg-green-600 text-white p-2 w-full mb-2 font-bold">
<%= link "Login", to: "/login" %>
</li>
<% end %>
</ul>
</nav>
<h1 class="text-5xl mb-4 text-center font-mono">LiveView Chat Example</h1>
</section>
</header>
<%= @inner_content %>
</body>
</html>
<ul id='msg-list' phx-update="append">
<%= for message <- @messages do %>
<li id={"msg-#{message.id}"}>
<b><%= message.name %>:</b>
<%= message.message %>
</li>
<% end %>
</ul>
<.form let={f} for={@changeset} id="form" phx-submit="new_message" phx-hook="Form">
<%= if @loggedin do %>
<%= text_input f, :name, id: "name", value: @person.givenName,
class: "hidden" %>
<% else %>
<%= text_input f, :name, id: "name", placeholder: "Your name", autofocus: "true",
class: "border p-2 w-full mb-2 mt-2" %>
<%= error_tag f, :name %>
<% end %>
<%= text_input f, :message, id: "msg", placeholder: "Your message",
class: "border p-2 w-full mb-2 mt-2" %>
<p class=" text-amber-600">
<%= error_tag f, :message %>
</p>
<%= submit "Send", class: "bg-green-600 text-white px-4 py-2 rounded-xl float-right" %>
</.form> not adding it to my current PR cause I don't want to change everything in one go.
|
@SimonLab thoughts? |
@nelsonic adding the updated UI to the PR sounds good 👍 |
Included in PR: #46 |
At the moment the application is pretty simple:
The text was updated successfully, but these errors were encountered: