Improve record details styling

This commit is contained in:
Claudio Ortolina
2024-10-15 15:19:40 +01:00
parent dafcd0ed6f
commit 18937865bf
2 changed files with 16 additions and 12 deletions
@@ -431,15 +431,15 @@ defmodule MusicLibraryWeb.CoreComponents do
@actions != [] && "sm:flex sm:items-center sm:justify-between sm:gap-6 mb-2",
@class
]}>
<div>
<h1 class="text-lg font-semibold leading-8 text-zinc-800">
<div class="font-semibold">
<h1 class="text-sm md:text-base lg:text-2xl text-gray-900">
<%= render_slot(@inner_block) %>
</h1>
<p :if={@subtitle != []} class="mt-2 text-base leading-6 text-zinc-600">
<h2 :if={@subtitle != []} class="mt-2 text-sm md:text-base text-gray-600">
<%= render_slot(@subtitle) %>
</p>
</h2>
</div>
<div class="flex justify-center gap-2 sm:flex-none mt-2 mb-2"><%= render_slot(@actions) %></div>
<div class="flex justify-center gap-2 sm:flex-none mt-4 mb-4"><%= render_slot(@actions) %></div>
</header>
"""
end
@@ -1,6 +1,8 @@
<.header>
<%= @record.title %>
<:subtitle><%= format_artist_names(@record.artists) %></:subtitle>
<%= format_artist_names(@record.artists) %>
<:subtitle>
<%= @record.title %>
</:subtitle>
<:actions>
<.link patch={~p"/records/#{@record}/show/edit"} phx-click={JS.push_focus()}>
<.button>Edit Metadata</.button>
@@ -11,17 +13,17 @@
</:actions>
</.header>
<div class="md:columns-2">
<span class="relative block md:inline-block drop-shadow">
<div class="md:columns-2 mt-4">
<div class="relative block md:inline-block drop-shadow">
<img
class="w-full"
class="w-full rounded-lg shadow"
src={~p"/covers/#{@record.id}?vsn=#{@record.cover_hash || ""}"}
alt={@record.title}
/>
<span class="absolute right-2 bottom-1 block text-white drop-shadow-md">
<%= Records.Record.format_short_label(@record.format) %>
</span>
</span>
</div>
<.list>
<:item title="Type">
@@ -50,7 +52,9 @@
</.list>
</div>
<.back navigate={@back_url}>Back to records</.back>
<div class="mt-8">
<.back navigate={@back_url}>Back to records</.back>
</div>
<.modal
:if={@live_action == :edit}