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 4249806
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 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
4 changes: 2 additions & 2 deletions app/components/ui/carousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ const CarouselPrevious = React.forwardRef<
className={cn(
'absolute h-8 w-8 rounded-full hover:bg-white',
orientation === 'horizontal'
? 'left-0 top-1/3 -translate-y-1/2'
? 'left-2 top-1/3 -translate-y-1/2'
: '-top-12 left-1/2 -translate-x-1/2 rotate-90',
className
)}
Expand Down Expand Up @@ -239,7 +239,7 @@ const CarouselNext = React.forwardRef<
className={cn(
'absolute h-8 w-8 rounded-full hover:bg-white',
orientation === 'horizontal'
? 'right-0 top-1/3 -translate-y-1/2'
? 'right-2 top-1/3 -translate-y-1/2'
: '-bottom-12 left-1/2 -translate-x-1/2 rotate-90',
className
)}
Expand Down

0 comments on commit 4249806

Please sign in to comment.