get typescript working, alpinejs working, add flowbite ui framework, update dockerfile to install npm dependencies
This commit is contained in:
21
lib/quip_web/controllers/demo_controller.ex
Normal file
21
lib/quip_web/controllers/demo_controller.ex
Normal 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
|
@@ -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>
|
||||
|
@@ -18,6 +18,7 @@ defmodule QuipWeb.Router do
|
||||
pipe_through :browser
|
||||
|
||||
get "/", PageController, :home
|
||||
live "/demo", DemoController
|
||||
end
|
||||
|
||||
# Other scopes may use custom stacks.
|
||||
|
Reference in New Issue
Block a user