get typescript working, alpinejs working, add flowbite ui framework, update dockerfile to install npm dependencies

This commit is contained in:
2024-09-02 21:46:40 -04:00
parent f5c2b7d67e
commit 13c9ada901
16 changed files with 670 additions and 260 deletions

View File

@@ -0,0 +1,21 @@
defmodule QuipWeb.DemoController do
use QuipWeb, :live_view
def handle_event("click", _, socket) do
{:noreply,
socket
|> push_event("demo-event", %{name: "World"})}
end
def render(assigns) do
~H"""
<button
type="button"
class="rounded-md bg-black px-3.5 py-2.5 text-sm font-semibold text-white shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2"
phx-click="click"
>
Click me
</button>
"""
end
end

View File

@@ -46,8 +46,16 @@
fill="#FD4F00"
/>
</svg>
<h1 class="text-brand mt-10 flex items-center text-sm font-semibold leading-6">
Phoenix Framework
<h1
phx-hook="HomeHeader"
id="header"
class="text-brand mt-10 flex items-center text-sm font-semibold leading-6"
>
<span
x-data="{ message: 'I ❤️ Phoenix Framework with Alpine and TypeScript' }"
x-text="message"
>
</span>
<small class="bg-brand/5 text-[0.8125rem] ml-3 rounded-full px-2 font-medium leading-6">
v<%= Application.spec(:phoenix, :vsn) %>
</small>

View File

@@ -18,6 +18,7 @@ defmodule QuipWeb.Router do
pipe_through :browser
get "/", PageController, :home
live "/demo", DemoController
end
# Other scopes may use custom stacks.