Use round_badge component in artist page

This commit is contained in:
Claudio Ortolina
2025-01-02 20:28:13 +00:00
parent b7d2e39c90
commit f813ea48e2
2 changed files with 14 additions and 41 deletions
@@ -24,20 +24,11 @@
{gettext("Error loading play count")}
</div>
</:failed>
<span :if={artist_info.play_count > 0}>
<span :if={artist_info.play_count > 0} class="ml-2">
<span class="sr-only">
{gettext("Number of scrobbles")}
</span>
<span class={[
"rounded-full ml-2",
"px-2 py-1 text-xs font-medium",
"ring-1 ring-inset",
"bg-gray-50 dark:bg-gray-400/10",
"text-gray-600 dark:text-gray-500",
"ring-gray-500/10 dark:ring-gray-400/20"
]}>
{artist_info.play_count}
</span>
<.round_badge text={artist_info.play_count} />
</span>
</.async_result>
</h1>
@@ -71,20 +62,11 @@
<div :if={@artist_records.collection !== []} class="mt-4">
<h2 class="flex items-end font-semibold text-base sm:text-lg leading-5 text-zinc-700 dark:text-zinc-300">
{gettext("Collection")}
<span>
<span class="ml-2">
<span class="sr-only">
{gettext("Number of albums")}
</span>
<span class={[
"rounded-full ml-2",
"px-2 py-1 text-xs font-medium",
"ring-1 ring-inset",
"bg-gray-50 dark:bg-gray-400/10",
"text-gray-600 dark:text-gray-500",
"ring-gray-500/10 dark:ring-gray-400/20"
]}>
{Enum.count(@artist_records.collection)}
</span>
<.round_badge text={Enum.count(@artist_records.collection)} />
</span>
</h2>
<%!-- TODO: replace with OSS version --%>
@@ -130,16 +112,7 @@
<span class="sr-only">
{gettext("Number of albums")}
</span>
<span class={[
"rounded-full ml-2",
"px-2 py-1 text-xs font-medium",
"ring-1 ring-inset",
"bg-gray-50 dark:bg-gray-400/10",
"text-gray-600 dark:text-gray-500",
"ring-gray-500/10 dark:ring-gray-400/20"
]}>
{Enum.count(@artist_records.wishlist)}
</span>
<.round_badge text={Enum.count(@artist_records.wishlist)} />
</span>
</h2>
<%!-- TODO: replace with OSS version --%>
+9 -9
View File
@@ -30,7 +30,7 @@ msgid "Choose a value"
msgstr ""
#: lib/music_library_web/components/layouts/app.html.heex:14
#: lib/music_library_web/live/artist_live/show.html.heex:73
#: lib/music_library_web/live/artist_live/show.html.heex:64
#: lib/music_library_web/live/collection_live/index.ex:83
#: lib/music_library_web/live/collection_live/show.ex:115
#: lib/music_library_web/live/collection_live/show.ex:132
@@ -306,7 +306,7 @@ msgid "Welcome to your Music Library"
msgstr ""
#: lib/music_library_web/components/layouts/app.html.heex:20
#: lib/music_library_web/live/artist_live/show.html.heex:128
#: lib/music_library_web/live/artist_live/show.html.heex:110
#: lib/music_library_web/live/wishlist_live/index.ex:83
#: lib/music_library_web/live/wishlist_live/show.ex:129
#, elixir-autogen, elixir-format
@@ -433,8 +433,8 @@ msgstr ""
msgid "Dev dashboard"
msgstr ""
#: lib/music_library_web/live/artist_live/show.html.heex:108
#: lib/music_library_web/live/artist_live/show.html.heex:163
#: lib/music_library_web/live/artist_live/show.html.heex:90
#: lib/music_library_web/live/artist_live/show.html.heex:136
#, elixir-autogen, elixir-format
msgid "View details"
msgstr ""
@@ -444,12 +444,12 @@ msgstr ""
msgid "Number of scrobbles"
msgstr ""
#: lib/music_library_web/live/artist_live/show.html.heex:66
#: lib/music_library_web/live/artist_live/show.html.heex:57
#, elixir-autogen, elixir-format
msgid "Biography"
msgstr ""
#: lib/music_library_web/live/artist_live/show.html.heex:48
#: lib/music_library_web/live/artist_live/show.html.heex:39
#, elixir-autogen, elixir-format
msgid "Loading biography"
msgstr ""
@@ -489,8 +489,8 @@ msgstr ""
msgid "Refresh cover"
msgstr ""
#: lib/music_library_web/live/artist_live/show.html.heex:76
#: lib/music_library_web/live/artist_live/show.html.heex:131
#: lib/music_library_web/live/artist_live/show.html.heex:67
#: lib/music_library_web/live/artist_live/show.html.heex:113
#, elixir-autogen, elixir-format
msgid "Number of albums"
msgstr ""
@@ -500,7 +500,7 @@ msgstr ""
msgid "Records"
msgstr ""
#: lib/music_library_web/live/artist_live/show.html.heex:59
#: lib/music_library_web/live/artist_live/show.html.heex:50
#, elixir-autogen, elixir-format
msgid "Error loading biography"
msgstr ""