defmodule VikWeb.HomeLive do @moduledoc false use VikWeb, :live_view alias Vik.Repo alias Vik.Shard on_mount VikWeb.Auth on_mount {VikWeb.SystemHandler, :static} @impl true def mount(_params, _session, socket) do socket = assign(socket, has_hello?: Repo.get_by(Shard, slug: "hello") != nil) {:ok, socket, if socket.assigns.authenticated? do [] else [layout: false] end} end @impl true def render(assigns) when assigns.authenticated? do ~H"{live_render @socket, VikWeb.DashboardLive, id: :list}" end @impl true def render(assigns) do ~H""" <.logo width="100px" />
\/||<
attr :width, :string, default: "200px" attr :color, :string, default: "currentColor" defp logo(assigns) do ~H""" """ end end