Skip to content

Commit

Permalink
Merge pull request #43 from Dium-dev/brands-carousel
Browse files Browse the repository at this point in the history
Fix brands number in mobile devices and reduce the gradient width
  • Loading branch information
JohanMejia77 authored Mar 21, 2024
2 parents 909012d + 96e6e59 commit 5398b81
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/components/BrandsCarousel/BrandCard.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import { Brand } from "@/types";
import Image from "next/image";
import Link from "next/link";
import useMobile from "@/hooks/useMobile";

interface BrandCardProps {
brand: Brand;
}

export const BrandCard = ({ brand }: BrandCardProps) => {
const { isMobile } = useMobile();

return (
<Link
className="flex items-center justify-center cursor-pointer w-max ms:m-6 mx-1 hover:scale-125 transition-all"
Expand All @@ -15,8 +18,8 @@ export const BrandCard = ({ brand }: BrandCardProps) => {
>
<Image
src={brand.image}
width={100}
height={100}
width={isMobile ? 50 : 100}
height={isMobile ? 50 : 100}
alt={brand.name}
className="w-auto h-auto"
/>
Expand Down
2 changes: 1 addition & 1 deletion src/components/BrandsCarousel/Carousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const Carousel = ({ brands }: CarouselProps) => {
pauseOnHover
speed={40}
gradient
gradientWidth={100}
gradientWidth={50}
gradientColor={theme === "dark" ? "black" : "white"}
>
{brands.map((brand, i) => (
Expand Down

0 comments on commit 5398b81

Please sign in to comment.