feat: updates

This commit is contained in:
qier222 2022-04-02 18:46:08 +08:00
parent 3ef7675696
commit 744247143b
No known key found for this signature in database
GPG key ID: 9C85007ED905F14D
11 changed files with 195 additions and 68 deletions

View file

@ -49,19 +49,22 @@ const Track = memo(
isLiked = false,
isSkeleton = false,
isHighlight = false,
subtitle = undefined,
onClick,
}: {
track: Track
isLiked?: boolean
isSkeleton?: boolean
isHighlight?: boolean
subtitle?: string
onClick: (e: React.MouseEvent<HTMLElement>, trackID: number) => void
}) => {
if (enableRenderLog)
console.debug(`Rendering TracksAlbum.tsx Track ${track.name}`)
const subtitle = useMemo(
() => track.tns?.at(0) ?? track.alia?.at(0),
[track.alia, track.tns]
)
return (
<div
onClick={e => onClick(e, track.id)}
@ -125,7 +128,6 @@ const Track = memo(
)}
{subtitle && (
<span
title={subtitle}
className={classNames(
'ml-1',
isHighlight ? 'text-brand-500/[.8]' : 'text-gray-400'
@ -259,7 +261,6 @@ const TracksAlbum = ({
isLiked={userLikedSongs?.ids?.includes(track.id) ?? false}
isSkeleton={false}
isHighlight={track.id === playingTrack?.id}
subtitle={track.tns?.at(0) ?? track.alia?.at(0)}
/>
))}
</div>