„lib/chiya_web/components/public_components.ex“ ändern

This commit is contained in:
inhji 2023-07-05 16:49:55 +02:00
parent e7c2a05472
commit 4351e40fad

View file

@ -69,6 +69,8 @@ defmodule ChiyaWeb.PublicComponents do
Renders a note-header with title. Renders a note-header with title.
""" """
attr :class, :string, default: nil attr :class, :string, default: nil
attr :titleclass, :string, default: nil
attr :subtitleclass, :string, default: nil
slot :title, required: true slot :title, required: true
slot :subtitle slot :subtitle
@ -76,10 +78,10 @@ defmodule ChiyaWeb.PublicComponents do
def header(assigns) do def header(assigns) do
~H""" ~H"""
<header class={["p-8 rounded", @class]}> <header class={["p-8 rounded", @class]}>
<h1 class="text-3xl font-extrabold leading-10 tracking-tight text-theme-primary"> <h1 class={["text-3xl font-extrabold leading-10 tracking-tight text-theme-primary", @titleclass]}>
<%= render_slot(@title) %> <%= render_slot(@title) %>
</h1> </h1>
<p :if={@subtitle != []} class="mt-4 leading-7 text-theme-base/75 uppercase font-semibold"> <p :if={@subtitle != []} class={["mt-4 leading-7 text-theme-base/75 uppercase font-semibold", @subtitleclass]}>
<%= render_slot(@subtitle) %> <%= render_slot(@subtitle) %>
</p> </p>
</header> </header>