mirror of
https://github.com/gabehf/Koito.git
synced 2026-03-07 13:38:15 -08:00
fix: conditional rendering on artist and album pages (#140)
This commit is contained in:
parent
d87ed2eb97
commit
94108953ec
2 changed files with 7 additions and 7 deletions
|
|
@ -45,17 +45,17 @@ export default function Album() {
|
|||
}}
|
||||
subContent={
|
||||
<div className="flex flex-col gap-2 items-start">
|
||||
{album.listen_count && (
|
||||
{album.listen_count !== 0 && (
|
||||
<p>
|
||||
{album.listen_count} play{album.listen_count > 1 ? "s" : ""}
|
||||
</p>
|
||||
)}
|
||||
{album.time_listened && (
|
||||
{album.time_listened !== 0 && (
|
||||
<p title={Math.floor(album.time_listened / 60 / 60) + " hours"}>
|
||||
{timeListenedString(album.time_listened)}
|
||||
</p>
|
||||
)}
|
||||
{album.first_listen && (
|
||||
{album.first_listen > 0 && (
|
||||
<p title={new Date(album.first_listen * 1000).toLocaleString()}>
|
||||
Listening since{" "}
|
||||
{new Date(album.first_listen * 1000).toLocaleDateString()}
|
||||
|
|
|
|||
|
|
@ -56,17 +56,17 @@ export default function Artist() {
|
|||
{artist.listen_count} play{artist.listen_count > 1 ? "s" : ""}
|
||||
</p>
|
||||
)}
|
||||
{
|
||||
{artist.time_listened !== 0 && (
|
||||
<p title={Math.floor(artist.time_listened / 60 / 60) + " hours"}>
|
||||
{timeListenedString(artist.time_listened)}
|
||||
</p>
|
||||
}
|
||||
{
|
||||
)}
|
||||
{artist.first_listen > 0 && (
|
||||
<p title={new Date(artist.first_listen * 1000).toLocaleString()}>
|
||||
Listening since{" "}
|
||||
{new Date(artist.first_listen * 1000).toLocaleDateString()}
|
||||
</p>
|
||||
}
|
||||
)}
|
||||
</div>
|
||||
}
|
||||
>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue