Skip to content

Commit

Permalink
Merge pull request #309 from nimit9/fix/history-carousel
Browse files Browse the repository at this point in the history
fixed: left arrow not visible on watch history carousel
  • Loading branch information
hkirat authored Apr 11, 2024
2 parents 612fa7f + a9e2ecb commit 099a601
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/components/WatchHistoryClient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
CarouselContent,
CarouselItem,
CarouselNext,
CarouselPrevious,
} from '@/components/ui/carousel';

const WatchHistoryClient = ({ history }: { history: TWatchHistory[] }) => (
Expand All @@ -23,6 +24,7 @@ const WatchHistoryClient = ({ history }: { history: TWatchHistory[] }) => (
))}
</CarouselContent>
<CarouselNext />
<CarouselPrevious />
</Carousel>
);

Expand Down
6 changes: 4 additions & 2 deletions src/components/ui/carousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,10 @@ const CarouselPrevious = React.forwardRef<
variant={variant}
size={size}
className={cn(
!canScrollPrev ? 'md:hidden' : '',
'absolute h-8 w-8 rounded-full',
orientation === 'horizontal'
? '-left-12 top-1/2 -translate-y-1/2'
? '-top-12 right-10 md:-left-12 md:top-1/2 md:-translate-y-1/2'
: '-top-12 left-1/2 -translate-x-1/2 rotate-90',
className,
)}
Expand All @@ -235,9 +236,10 @@ const CarouselNext = React.forwardRef<
variant={variant}
size={size}
className={cn(
!canScrollNext ? 'md:hidden' : '',
'absolute h-8 w-8 rounded-full',
orientation === 'horizontal'
? '-top-12 right-0 sm:-right-12 sm:top-1/2 sm:-translate-y-1/2'
? '-top-12 right-0 md:-right-12 md:top-1/2 md:-translate-y-1/2'
: '-bottom-12 left-1/2 -translate-x-1/2 rotate-90',
className,
)}
Expand Down

0 comments on commit 099a601

Please sign in to comment.