From 5399fc818cf821c75f9f19fd00bf7905ba7fe7e3 Mon Sep 17 00:00:00 2001 From: href Date: Fri, 3 Sep 2021 04:04:21 +0200 Subject: various fixes, web client wip, pubsub events --- lib/lsg_web/components/event_component.ex | 36 +++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 lib/lsg_web/components/event_component.ex (limited to 'lib/lsg_web/components/event_component.ex') diff --git a/lib/lsg_web/components/event_component.ex b/lib/lsg_web/components/event_component.ex new file mode 100644 index 0000000..3b9cd3b --- /dev/null +++ b/lib/lsg_web/components/event_component.ex @@ -0,0 +1,36 @@ +defmodule LSGWeb.EventComponent do + use Phoenix.Component + + def content(assigns = %{event: %{type: :quit}}) do + ~H""" + + has quit: + <%= @reason %> + """ + end + + def content(assigns = %{event: %{type: :part}}) do + ~H""" + + has left: + <%= @reason %> + """ + end + + def content(assigns = %{event: %{type: :nick}}) do + ~H""" + <%= @old_nick %> + is now known as + + """ + end + + def content(assigns = %{event: %{type: :join}}) do + ~H""" + + joined + """ + end + + +end -- cgit v1.2.3