Skip to content

Commit

Permalink
fix(components/items/card/top-item): item name and progress bar width
Browse files Browse the repository at this point in the history
  • Loading branch information
Mnigos committed Dec 5, 2024
1 parent 2bd3c61 commit cb7c034
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion app/components/common/progress-with-value-label.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace ProgressWithValueLabel {
max: number
label: string
animate?: boolean
className?: string
}>
}

Expand All @@ -19,6 +20,7 @@ function ProgressWithValueLabel({
max,
label,
animate = false,
className,
}: ProgressWithValueLabel.Props) {
const defaultProgressValue = (value / max) * 100

Expand All @@ -34,7 +36,7 @@ function ProgressWithValueLabel({
}, [value, max, animate, defaultProgressValue])

return (
<div className="relative w-full">
<div className={cn('relative w-full', className)}>
<Progress
value={progressValue}
className={cn(
Expand Down
5 changes: 3 additions & 2 deletions app/components/items/cards/item-top-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function ItemTopCard({
? `/album/${album.id}?highlighted-track-id=${id}`
: `/${artists ? 'album' : 'artist'}/${id}`
}
className="text-2xl"
className="max-w-[90vw] text-2xl"
/>

{artists && <ItemArtists artists={artists} className="text-xl" />}
Expand All @@ -91,7 +91,7 @@ function ItemTopCard({
{position && <ItemPosition position={position} size="xl" />}

{genres && genres.length > 0 && (
<div className="flex h-full flex-col flex-wrap justify-center gap-2 md:flex-row">
<div className="flex h-full flex-row flex-wrap justify-center gap-2">
{genres.slice(0, 3).map((genre, index) => (
<GenreBadge key={index} genre={genre} />
))}
Expand All @@ -108,6 +108,7 @@ function ItemTopCard({
value={plays}
max={maxPlays}
label={`${plays} ${plays > 1 ? 'plays' : 'play'}`}
className="max-w-[350px]"
animate
/>
)}
Expand Down

0 comments on commit cb7c034

Please sign in to comment.