mirror of
https://github.com/gabehf/Koito.git
synced 2026-03-07 21:48:18 -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={
|
subContent={
|
||||||
<div className="flex flex-col gap-2 items-start">
|
<div className="flex flex-col gap-2 items-start">
|
||||||
{album.listen_count && (
|
{album.listen_count !== 0 && (
|
||||||
<p>
|
<p>
|
||||||
{album.listen_count} play{album.listen_count > 1 ? "s" : ""}
|
{album.listen_count} play{album.listen_count > 1 ? "s" : ""}
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
{album.time_listened && (
|
{album.time_listened !== 0 && (
|
||||||
<p title={Math.floor(album.time_listened / 60 / 60) + " hours"}>
|
<p title={Math.floor(album.time_listened / 60 / 60) + " hours"}>
|
||||||
{timeListenedString(album.time_listened)}
|
{timeListenedString(album.time_listened)}
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
{album.first_listen && (
|
{album.first_listen > 0 && (
|
||||||
<p title={new Date(album.first_listen * 1000).toLocaleString()}>
|
<p title={new Date(album.first_listen * 1000).toLocaleString()}>
|
||||||
Listening since{" "}
|
Listening since{" "}
|
||||||
{new Date(album.first_listen * 1000).toLocaleDateString()}
|
{new Date(album.first_listen * 1000).toLocaleDateString()}
|
||||||
|
|
|
||||||
|
|
@ -56,17 +56,17 @@ export default function Artist() {
|
||||||
{artist.listen_count} play{artist.listen_count > 1 ? "s" : ""}
|
{artist.listen_count} play{artist.listen_count > 1 ? "s" : ""}
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
{
|
{artist.time_listened !== 0 && (
|
||||||
<p title={Math.floor(artist.time_listened / 60 / 60) + " hours"}>
|
<p title={Math.floor(artist.time_listened / 60 / 60) + " hours"}>
|
||||||
{timeListenedString(artist.time_listened)}
|
{timeListenedString(artist.time_listened)}
|
||||||
</p>
|
</p>
|
||||||
}
|
)}
|
||||||
{
|
{artist.first_listen > 0 && (
|
||||||
<p title={new Date(artist.first_listen * 1000).toLocaleString()}>
|
<p title={new Date(artist.first_listen * 1000).toLocaleString()}>
|
||||||
Listening since{" "}
|
Listening since{" "}
|
||||||
{new Date(artist.first_listen * 1000).toLocaleDateString()}
|
{new Date(artist.first_listen * 1000).toLocaleDateString()}
|
||||||
</p>
|
</p>
|
||||||
}
|
)}
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue