Display artist image in full when clicking on it
This commit is contained in:
@@ -7,6 +7,7 @@ defmodule MusicLibraryWeb.ArtistComponents do
|
|||||||
attr :image_hash, :string, required: true
|
attr :image_hash, :string, required: true
|
||||||
attr :class, :string, required: false, default: nil
|
attr :class, :string, required: false, default: nil
|
||||||
attr :width, :integer, default: nil
|
attr :width, :integer, default: nil
|
||||||
|
attr :rest, :global
|
||||||
|
|
||||||
def artist_image(assigns) do
|
def artist_image(assigns) do
|
||||||
payload =
|
payload =
|
||||||
@@ -21,6 +22,7 @@ defmodule MusicLibraryWeb.ArtistComponents do
|
|||||||
src={~p"/assets/#{@payload}"}
|
src={~p"/assets/#{@payload}"}
|
||||||
alt={@artist.name}
|
alt={@artist.name}
|
||||||
onerror={"this.src = '" <> ~p"/images/cover-not-found.png" <> "';"}
|
onerror={"this.src = '" <> ~p"/images/cover-not-found.png" <> "';"}
|
||||||
|
{@rest}
|
||||||
/>
|
/>
|
||||||
"""
|
"""
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -112,10 +112,23 @@
|
|||||||
{gettext("Meta")}
|
{gettext("Meta")}
|
||||||
</h2>
|
</h2>
|
||||||
<.artist_image
|
<.artist_image
|
||||||
class="w-full rounded-md shadow-sm mt-4"
|
class="w-full rounded-md shadow-sm mt-4 cursor-pointer"
|
||||||
artist={@artist}
|
artist={@artist}
|
||||||
image_hash={@artist_info.image_data_hash}
|
image_hash={@artist_info.image_data_hash}
|
||||||
|
phx-click={Fluxon.open_dialog("artist-image-modal")}
|
||||||
/>
|
/>
|
||||||
|
<.modal
|
||||||
|
id="artist-image-modal"
|
||||||
|
class="mx-auto sm:min-w-2xl max-w-sm md:max-w-3xl lg:max-w-5xl mt-8"
|
||||||
|
placement="center"
|
||||||
|
open={false}
|
||||||
|
>
|
||||||
|
<.artist_image
|
||||||
|
class="w-full rounded-md shadow-sm mt-8"
|
||||||
|
artist={@artist}
|
||||||
|
image_hash={@artist_info.image_data_hash}
|
||||||
|
/>
|
||||||
|
</.modal>
|
||||||
<dl>
|
<dl>
|
||||||
<dt class="mt-4 text-sm font-medium leading-6 text-zinc-900 dark:text-zinc-400">
|
<dt class="mt-4 text-sm font-medium leading-6 text-zinc-900 dark:text-zinc-400">
|
||||||
{gettext("MusicBrainz ID")}
|
{gettext("MusicBrainz ID")}
|
||||||
|
|||||||
Reference in New Issue
Block a user