feat(chat): extract room forms to SlaxWeb.RoomComponents
This commit is contained in:
@@ -2,6 +2,8 @@ defmodule SlaxWeb.ChatRoomLive.Edit do
|
||||
@moduledoc false
|
||||
use SlaxWeb, :live_view
|
||||
|
||||
import SlaxWeb.RoomComponents
|
||||
|
||||
alias Slax.Chat
|
||||
|
||||
@impl Phoenix.LiveView
|
||||
@@ -19,13 +21,7 @@ defmodule SlaxWeb.ChatRoomLive.Edit do
|
||||
</.link>
|
||||
</:actions>
|
||||
</.header>
|
||||
<.simple_form for={@form} id="room-form" phx-change="validate-room" phx-submit="save-room">
|
||||
<.input field={@form[:name]} type="text" label="Name" phx-debounce />
|
||||
<.input field={@form[:topic]} type="text" label="Topic" phx-debounce />
|
||||
<:actions>
|
||||
<.button phx-disable-with="Saving..." class="w-full">Save</.button>
|
||||
</:actions>
|
||||
</.simple_form>
|
||||
<.room_form form={@form} />
|
||||
</div>
|
||||
"""
|
||||
end
|
||||
|
Reference in New Issue
Block a user