defmodule MvWeb.Layouts do
@moduledoc """
This module holds different layouts used by your application.
See the `layouts` directory for all templates available.
The "root" layout is a skeleton rendered as part of the
application router. The "app" layout is rendered as component
in regular views and live views.
"""
use MvWeb, :html
embed_templates "layouts/*"
@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>
<:label>
<:sidebar>
<.icon name="hero-users" class="size-5" /> Members
{@inner_content}
"""
end
@doc """
Shows the flash group with standard titles and content.
## Examples
<.flash_group flash={@flash} />
"""
attr :flash, :map, required: true, doc: "the map of flash messages"
attr :id, :string, default: "flash-group", doc: "the optional id of flash container"
def flash_group(assigns) do
~H"""
"""
end
@doc """
Provides dark vs light theme toggle based on themes defined in app.css.
See in root.html.heex which applies the theme before page load.
"""
def theme_toggle(assigns) do
~H"""