fix: improved card view
This commit is contained in:
1 parent
dae856be78
commit
c42d5a5298
6 files changed
+55
-47
No files matched your search
@@ -5,9 +5,10 @@ import useFavorites, { useFavoritesMutation } from '@/app/(site)/favorites/useFa
|
||||
|
||||
interface Props {
|
||||
movie: Movie;
|
||||
iconsFillColor?: string;
|
||||
}
|
||||
|
||||
const Rating: FC<Props> = ({ movie }) => {
|
||||
const Rating: FC<Props> = ({ movie, iconsFillColor = 'fill-accent-foreground' }) => {
|
||||
const { map } = useFavorites();
|
||||
const { add, remove } = useFavoritesMutation();
|
||||
|
||||
@@ -24,10 +25,10 @@ const Rating: FC<Props> = ({ movie }) => {
|
||||
className='z-[2] cursor-pointer'
|
||||
title={isFavorite ? 'Remove from favorites' : 'Add to favorite'}
|
||||
>
|
||||
<Heart className={isFavorite ? 'fill-accent-foreground' : ''} size={18} />
|
||||
<Heart className={isFavorite ? iconsFillColor : ''} size={20} />
|
||||
</span>
|
||||
<span className='flex items-center'>
|
||||
<Star size={18} className='fill-accent-foreground mr-1' />
|
||||
<Star size={18} className={`mr-1 ${iconsFillColor}`} />
|
||||
<span className='font-semibold'>{movie.vote_average?.toFixed(1)}</span>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
@@ -5,18 +5,20 @@ import { useTheme } from '@/hooks/useTheme';
|
||||
|
||||
interface Props {
|
||||
title: string;
|
||||
hideGradient?: boolean;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
const Title: FC<Props> = ({ title }) => {
|
||||
const Title: FC<Props> = ({ title, hideGradient, className }) => {
|
||||
const [isScrollableTitle, setIsScrollableTitle] = useState(false);
|
||||
const [theme] = useTheme();
|
||||
return (
|
||||
<Marquee
|
||||
play={isScrollableTitle}
|
||||
gradient={isScrollableTitle}
|
||||
gradient={!hideGradient && isScrollableTitle}
|
||||
gradientWidth={10}
|
||||
gradientColor={theme === 'light' ? [255, 255, 255] : [2, 8, 23]}
|
||||
className='movie-title overflow-hidden h-[30px] text-lg font-semibold'
|
||||
className={`movie-title overflow-hidden h-[30px] text-lg font-semibold ${className}`}
|
||||
>
|
||||
<div
|
||||
ref={(element) => {
|
||||
|
||||
Reference in new issue
Block a user