nicer header
This commit is contained in:
parent
0f4f4940d0
commit
f710452f2f
2 changed files with 8 additions and 8 deletions
|
@ -69,19 +69,19 @@ 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 :class_title, :string, default: nil
|
||||||
attr :subtitleclass, :string, default: nil
|
attr :class_subtitle, :string, default: nil
|
||||||
|
|
||||||
slot :title, required: true
|
slot :title, required: true
|
||||||
slot :subtitle
|
slot :subtitle, required: false
|
||||||
|
|
||||||
def header(assigns) do
|
def header(assigns) do
|
||||||
~H"""
|
~H"""
|
||||||
<header class={["p-8 rounded", @class]}>
|
<header class={["p-8 rounded bg-theme-background1", @class]}>
|
||||||
<h1 class={["text-3xl font-extrabold leading-10 tracking-tight text-theme-primary", @titleclass]}>
|
<h1 class={["text-3xl leading-10 text-theme-base", @class_title]}>
|
||||||
<%= render_slot(@title) %>
|
<%= render_slot(@title) %>
|
||||||
</h1>
|
</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) %>
|
<%= render_slot(@subtitle) %>
|
||||||
</p>
|
</p>
|
||||||
</header>
|
</header>
|
||||||
|
|
|
@ -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>
|
<:title><%= @settings.title %></:title>
|
||||||
<:subtitle><%= @settings.subtitle %></:subtitle>
|
<:subtitle><%= @settings.subtitle %></:subtitle>
|
||||||
</.header>
|
</.header>
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<%= if @channel do %>
|
<%= if @channel do %>
|
||||||
<section class="mt-8 border-t border-theme-background1">
|
<section class="mt-8">
|
||||||
<.note_list notes={@channel.notes} layout={@channel.layout} />
|
<.note_list notes={@channel.notes} layout={@channel.layout} />
|
||||||
</section>
|
</section>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
Loading…
Reference in a new issue