<.flash :if={Flash.get(@flash, :success)} key="success">
<:icon>
<.icon_success />
@@ -69,15 +72,14 @@ defmodule PlausibleWeb.Live.Flash do
<%= Flash.get(@flash, :error) %>
-
- <.flash on_close={JS.hide(to: "#live-view-connection-status")}>
+ <.flash
+ :if={Application.get_env(:plausible, :environment) == "dev"}
+ id="live-view-connection-status"
+ class="hidden"
+ phx-disconnected={JS.show()}
+ phx-connected={JS.hide()}
+ on_close={JS.hide()}
+ >
<:icon>
<.icon_error />
@@ -98,26 +100,32 @@ defmodule PlausibleWeb.Live.Flash do
slot(:message, required: true)
attr(:key, :string, default: nil)
attr(:on_close, :any, default: "lv:clear-flash")
+ attr(:class, :string, default: "")
+ attr(:rest, :global)
def flash(assigns) do
~H"""
-
-
-
-
-
- <%= render_slot(@icon) %>
-
-
- <%= render_slot(@title) %>
-
-
- <%= render_slot(@message) %>
-
-
-
- <.clear_flash_button on_close={@on_close} key={@key} />
-
+
+
+
+
+ <%= render_slot(@icon) %>
+
+
+ <%= render_slot(@title) %>
+
+
+ <%= render_slot(@message) %>
+
+
+
+ <.clear_flash_button on_close={@on_close} key={@key} />