From c251e1dba3550544d3e1d15681e0edb3425c664f Mon Sep 17 00:00:00 2001 From: Moritz Date: Thu, 3 Jul 2025 21:29:01 +0200 Subject: [PATCH] fix: adapt layout to phoenix 1.8 --- lib/mv_web/components/layouts.ex | 87 +++++++++------------ lib/mv_web/components/layouts/app.html.heex | 34 -------- 2 files changed, 38 insertions(+), 83 deletions(-) delete mode 100644 lib/mv_web/components/layouts/app.html.heex diff --git a/lib/mv_web/components/layouts.ex b/lib/mv_web/components/layouts.ex index 1ced765..dd70936 100644 --- a/lib/mv_web/components/layouts.ex +++ b/lib/mv_web/components/layouts.ex @@ -11,60 +11,49 @@ defmodule MvWeb.Layouts do embed_templates "layouts/*" - @doc """ - Renders the app layout - - ## Examples - - -

Content

- - - """ - attr :flash, :map, required: true, doc: "the map of flash messages" - - attr :current_scope, :map, - default: nil, - doc: "the current [scope](https://hexdocs.pm/phoenix/scopes.html)" - - slot :inner_block, required: true + @doc "The main app layout (Backpex shell, topbar, sidebar, flash, content)" + attr :flash, :map, required: true + attr :socket, :any, default: nil + attr :current_url, :string, default: nil + attr :fluid?, :boolean, default: false + attr :inner_content, :any, required: true def app(assigns) do ~H""" - + + <:topbar> + -
-
- {render_slot(@inner_block)} -
-
+ - <.flash_group flash={@flash} /> + + <:label> + + +
  • + <.link navigate={~p"/"} class="text-error flex justify-between hover:bg-base-200"> +

    Logout

    + <.icon name="hero-arrow-right-on-rectangle" class="size-5" /> + +
  • +
    + + <:sidebar> + + <.icon name="hero-users" class="size-5" /> Members + + + + <%= @inner_content %> +
    """ end diff --git a/lib/mv_web/components/layouts/app.html.heex b/lib/mv_web/components/layouts/app.html.heex deleted file mode 100644 index 892d4a5..0000000 --- a/lib/mv_web/components/layouts/app.html.heex +++ /dev/null @@ -1,34 +0,0 @@ - - <:topbar> - - - - - - <:label> - - -
  • - <.link navigate={~p"/"} class="text-error flex justify-between hover:bg-base-200"> -

    Logout

    - <.icon name="hero-arrow-right-on-rectangle" class="size-5" /> - -
  • -
    - - <:sidebar> - - <.icon name="hero-users" class="size-5" /> Members - - - - <%= @inner_content %> -
    \ No newline at end of file