diff --git a/lib/curious_messenger_web/live/conversation_live.ex b/lib/curious_messenger_web/live/conversation_live.ex
index 4882aaf..b462d20 100644
--- a/lib/curious_messenger_web/live/conversation_live.ex
+++ b/lib/curious_messenger_web/live/conversation_live.ex
@@ -5,31 +5,10 @@ defmodule CuriousMessengerWeb.ConversationLive do
use Phoenix.HTML
alias CuriousMessenger.{Auth, Chat, Repo}
+ alias CuriousMessengerWeb.ConversationView
def render(assigns) do
- ~L"""
-
- User name: <%= @user.nickname %>
-
-
- Conversation title: <%= @conversation.title %>
-
-
- <%= f = form_for :message, "#", [phx_submit: "send_message"] %>
- <%= label f, :content %>
- <%= text_input f, :content %>
- <%= submit "Send" %>
-
-
-
-
Messages:
- <%= for message <- @messages do %>
-
- <%= message.user.nickname %>: <%= message.content %>
-
- <% end %>
-
- """
+ ConversationView.render("show.html", assigns)
end
def mount(assigns, socket) do
diff --git a/lib/curious_messenger_web/templates/conversation/show.html.leex b/lib/curious_messenger_web/templates/conversation/show.html.leex
new file mode 100644
index 0000000..85ce9d2
--- /dev/null
+++ b/lib/curious_messenger_web/templates/conversation/show.html.leex
@@ -0,0 +1,21 @@
+
+ User name: <%= @user.nickname %>
+
+
+ Conversation title: <%= @conversation.title %>
+
+
+ <%= f = form_for :message, "#", [phx_submit: "send_message"] %>
+ <%= label f, :content %>
+ <%= text_input f, :content %>
+ <%= submit "Send" %>
+
+
+
+
Messages:
+ <%= for message <- @messages do %>
+
+ <%= message.user.nickname %>: <%= message.content %>
+
+ <% end %>
+
\ No newline at end of file
diff --git a/lib/curious_messenger_web/views/conversation_view.ex b/lib/curious_messenger_web/views/conversation_view.ex
new file mode 100644
index 0000000..5565c6e
--- /dev/null
+++ b/lib/curious_messenger_web/views/conversation_view.ex
@@ -0,0 +1,3 @@
+defmodule CuriousMessengerWeb.ConversationView do
+ use CuriousMessengerWeb, :view
+end