diff --git a/lib/lokal_web/component/topbar.ex b/lib/lokal_web/component/topbar.ex index bf10a26..ab00340 100644 --- a/lib/lokal_web/component/topbar.ex +++ b/lib/lokal_web/component/topbar.ex @@ -1,4 +1,4 @@ -defmodule LokalWeb.Component.Topbar do +defmodule LokalWeb.Components.Topbar do @moduledoc """ Phoenix.Component for rendering an interactive topbar Assign diff --git a/lib/lokal_web/templates/layout/app.html.heex b/lib/lokal_web/templates/layout/app.html.heex index 1381559..3c8a34e 100644 --- a/lib/lokal_web/templates/layout/app.html.heex +++ b/lib/lokal_web/templates/layout/app.html.heex @@ -1,16 +1,19 @@ -
-
- <%= render("topbar.html", assigns) %> +
+
+ <.topbar current_user={assigns[:current_user]}> + <%= if get_flash(@conn, :info) do %> <% end %> + <%= if get_flash(@conn, :error) do %> <% end %>
+ <%= @inner_content %>
diff --git a/lib/lokal_web/templates/layout/live.html.heex b/lib/lokal_web/templates/layout/live.html.heex index f011b87..f99debf 100644 --- a/lib/lokal_web/templates/layout/live.html.heex +++ b/lib/lokal_web/templates/layout/live.html.heex @@ -1,15 +1,19 @@
- - - <%= if @flash && @flash |> Map.has_key?(:info) do %> - - <% end %> - <%= if @flash && @flash |> Map.has_key?(:error) do %> - - <% end %> +
+ <.topbar current_user={assigns[:current_user]}> + + <%= if @flash && @flash |> Map.has_key?(:info) do %> + + <% end %> + + <%= if @flash && @flash |> Map.has_key?(:error) do %> + + <% end %> +
+ <%= @inner_content %>
diff --git a/lib/lokal_web/templates/layout/topbar.html.heex b/lib/lokal_web/templates/layout/topbar.html.heex deleted file mode 100644 index f92e4ed..0000000 --- a/lib/lokal_web/templates/layout/topbar.html.heex +++ /dev/null @@ -1,41 +0,0 @@ - diff --git a/lib/lokal_web/views/layout_view.ex b/lib/lokal_web/views/layout_view.ex index ea3ba06..820c730 100644 --- a/lib/lokal_web/views/layout_view.ex +++ b/lib/lokal_web/views/layout_view.ex @@ -1,6 +1,6 @@ defmodule LokalWeb.LayoutView do use LokalWeb, :view - alias LokalWeb.PageLive + import LokalWeb.Components.Topbar # Phoenix LiveDashboard is available only in development by default, # so we instruct Elixir to not warn if the dashboard route is missing.