nicer header

This commit is contained in:
Inhji 2023-07-06 21:28:56 +02:00
parent 0f4f4940d0
commit f710452f2f
2 changed files with 8 additions and 8 deletions

View file

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

View file

@ -1,4 +1,4 @@
<.header titleclass="p-name" subtitleclass="p-summary">
<.header class_title="text-theme-primary p-name" class_subtitle="p-summary">
<:title><%= @settings.title %></:title>
<:subtitle><%= @settings.subtitle %></:subtitle>
</.header>
@ -27,7 +27,7 @@
</section>
<%= if @channel do %>
<section class="mt-8 border-t border-theme-background1">
<section class="mt-8">
<.note_list notes={@channel.notes} layout={@channel.layout} />
</section>
<% end %>