Render a minimal artist page
This commit is contained in:
@@ -10,12 +10,14 @@ defmodule MusicLibraryWeb.ArtistLive.Show do
|
||||
|
||||
@impl true
|
||||
def handle_params(%{"musicbrainz_id" => musicbrainz_id}, _, socket) do
|
||||
{:ok, artist} = Records.get_artist(musicbrainz_id)
|
||||
artist = Records.get_artist!(musicbrainz_id)
|
||||
{:ok, artist_info} = Records.get_artist_info(musicbrainz_id)
|
||||
|
||||
{:noreply,
|
||||
socket
|
||||
|> assign(:nav_section, :artists)
|
||||
|> assign(:artist, artist)
|
||||
|> assign(:artist_info, artist_info)
|
||||
|> assign(:page_title, page_title(socket.assigns.live_action, artist))}
|
||||
end
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<h1 class="mt-1 flex font-semibold text-base sm:text-lg leading-5 text-zinc-700 dark:text-zinc-300 text-wrap">
|
||||
<%= @artist.name %>
|
||||
</h1>
|
||||
<p class="mt-2 text-sm leading-5 text-zinc-500 dark:text-zinc-400">
|
||||
<%= raw(@artist.bio) || gettext("Biography not available") %>
|
||||
<p class="bio mt-2 text-sm leading-5 text-zinc-500 dark:text-zinc-400">
|
||||
<%= (@artist_info.bio || gettext("Biography not available")) |> raw() %>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user