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", @actions != [] && "sm:flex sm:items-center sm:justify-between sm:gap-6 mb-2",
@class @class
]}> ]}>
<div> <div class="font-semibold">
<h1 class="text-lg font-semibold leading-8 text-zinc-800"> <h1 class="text-sm md:text-base lg:text-2xl text-gray-900">
<%= render_slot(@inner_block) %> <%= render_slot(@inner_block) %>
</h1> </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) %> <%= render_slot(@subtitle) %>
</p> </h2>
</div> </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> </header>
""" """
end end
@@ -1,6 +1,8 @@
<.header> <.header>
<%= format_artist_names(@record.artists) %>
<:subtitle>
<%= @record.title %> <%= @record.title %>
<:subtitle><%= format_artist_names(@record.artists) %></:subtitle> </:subtitle>
<:actions> <:actions>
<.link patch={~p"/records/#{@record}/show/edit"} phx-click={JS.push_focus()}> <.link patch={~p"/records/#{@record}/show/edit"} phx-click={JS.push_focus()}>
<.button>Edit Metadata</.button> <.button>Edit Metadata</.button>
@@ -11,17 +13,17 @@
</:actions> </:actions>
</.header> </.header>
<div class="md:columns-2"> <div class="md:columns-2 mt-4">
<span class="relative block md:inline-block drop-shadow"> <div class="relative block md:inline-block drop-shadow">
<img <img
class="w-full" class="w-full rounded-lg shadow"
src={~p"/covers/#{@record.id}?vsn=#{@record.cover_hash || ""}"} src={~p"/covers/#{@record.id}?vsn=#{@record.cover_hash || ""}"}
alt={@record.title} alt={@record.title}
/> />
<span class="absolute right-2 bottom-1 block text-white drop-shadow-md"> <span class="absolute right-2 bottom-1 block text-white drop-shadow-md">
<%= Records.Record.format_short_label(@record.format) %> <%= Records.Record.format_short_label(@record.format) %>
</span> </span>
</span> </div>
<.list> <.list>
<:item title="Type"> <:item title="Type">
@@ -50,7 +52,9 @@
</.list> </.list>
</div> </div>
<div class="mt-8">
<.back navigate={@back_url}>Back to records</.back> <.back navigate={@back_url}>Back to records</.back>
</div>
<.modal <.modal
:if={@live_action == :edit} :if={@live_action == :edit}