diff --git a/package-lock.json b/package-lock.json index db132f0..5e236f1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,6 +11,7 @@ "next": "14.1.0", "react": "^18", "react-dom": "^18", + "react-fast-marquee": "^1.6.4", "react-icons": "^5.0.1", "react-image-gallery": "^1.3.0" }, @@ -3743,6 +3744,15 @@ "react": "^18.2.0" } }, + "node_modules/react-fast-marquee": { + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/react-fast-marquee/-/react-fast-marquee-1.6.4.tgz", + "integrity": "sha512-LAgvhRmHdqaUQ8R5jCUwzEGFUIjnCCt3T3W8X7j7wF6DWe0SATlpP0JX1V0pp2qX3DYUezmn1Iz5AtRFdL2EWQ==", + "peerDependencies": { + "react": ">= 16.8.0 || 18.0.0", + "react-dom": ">= 16.8.0 || 18.0.0" + } + }, "node_modules/react-icons": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-5.0.1.tgz", diff --git a/package.json b/package.json index a7f49b7..3e0aac0 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "next": "14.1.0", "react": "^18", "react-dom": "^18", + "react-fast-marquee": "^1.6.4", "react-icons": "^5.0.1", "react-image-gallery": "^1.3.0" }, diff --git a/src/app/page.tsx b/src/app/page.tsx index 02ffc1a..e9b206a 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,12 +1,14 @@ import Banner from "@/components/Banner"; import Categories from "@/components/Categories"; import Blog from "@/components/Blog"; +import BrandsCarousel from "@/components/BrandsCarousel"; export default function Home() { return (
+
); diff --git a/src/components/BrandsCarousel/BrandCard.tsx b/src/components/BrandsCarousel/BrandCard.tsx new file mode 100644 index 0000000..ab7e01a --- /dev/null +++ b/src/components/BrandsCarousel/BrandCard.tsx @@ -0,0 +1,25 @@ +import { Brand } from "@/types"; +import Image from "next/image"; +import Link from "next/link"; + +interface BrandCardProps { + brand: Brand; +} + +export const BrandCard = ({ brand }: BrandCardProps) => { + return ( + + {brand.name} + + ); +}; diff --git a/src/components/BrandsCarousel/Carousel.tsx b/src/components/BrandsCarousel/Carousel.tsx new file mode 100644 index 0000000..54db738 --- /dev/null +++ b/src/components/BrandsCarousel/Carousel.tsx @@ -0,0 +1,23 @@ +"use client"; +import Marquee from "react-fast-marquee"; + +import { BrandCard } from "./BrandCard"; + +import { Brand } from "@/types"; + +interface CarouselProps { + brands: Brand[]; +} + +export const Carousel = ({ brands }: CarouselProps) => { + + return ( +
+ + {brands.map((brand, i) => ( + + ))} + +
+ ); +}; diff --git a/src/components/BrandsCarousel/index.tsx b/src/components/BrandsCarousel/index.tsx new file mode 100644 index 0000000..f88e88d --- /dev/null +++ b/src/components/BrandsCarousel/index.tsx @@ -0,0 +1,14 @@ +import { FC } from "react"; + +import { Carousel } from "./Carousel"; +import { BRANDS } from "@/utils/constants"; + +const BrandsCarousel: FC = () => { + + return ( +
+ +
+ ); +}; +export default BrandsCarousel; \ No newline at end of file diff --git a/src/types.d.ts b/src/types.d.ts new file mode 100644 index 0000000..460936b --- /dev/null +++ b/src/types.d.ts @@ -0,0 +1,4 @@ +export interface Brand { + image: string; + name: string; +} \ No newline at end of file diff --git a/src/utils/constants.ts b/src/utils/constants.ts index 3bcff67..dc19de2 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -40,3 +40,105 @@ export const CATEGORIES = [ name: "Stops", }, ]; +export const BRANDS = [ + { + name: "Audi", + image: "/images/brands/audi-logo.webp" + }, + { + name: "BMW", + image: "/images/brands/bmw-logo.webp" + }, + { + name: "Chevrolet", + image: "/images/brands/chevrolet-logo.webp" + }, + { + name: "Dodge", + image: "/images/brands/dodge-logo.webp" + }, + { + name: "Ferrari", + image: "/images/brands/ferrari-logo.webp" + }, + { + name: "Ford", + image: "/images/brands/ford-logo.webp" + }, + { + name: "Honda", + image: "/images/brands/honda-logo.webp" + }, + { + name: "Hyundai", + image: "/images/brands/hyundai-logo.webp" + }, + { + name: "Jeep", + image: "/images/brands/jeep-logo.webp" + }, + { + name: "Kia", + image: "/images/brands/kia-logo.webp" + }, + { + name: "Lamborghini", + image: "/images/brands/lamborghini-logo.webp" + }, + { + name: "Land Rover", + image: "/images/brands/land-rover-logo.webp" + }, + { + name: "Lexus", + image: "/images/brands/lexus-logo.webp" + }, + { + name: "Mazda", + image: "/images/brands/mazda-logo.webp" + }, + { + name: "Mercedes Benz", + image: "/images/brands/mercedes-benz-logo.webp" + }, + { + name: "Mini", + image: "/images/brands/mini-logo.webp" + }, + { + name: "Mitsubishi", + image: "/images/brands/mitsubishi-logo.webp" + }, + { + name: "Nissan", + image: "/images/brands/nissan-logo.webp" + }, + { + name: "Porsche", + image: "/images/brands/porsche-logo.webp" + }, + { + name: "RAM", + image: "/images/brands/ram-logo.webp" + }, + { + name: "Subaru", + image: "/images/brands/subaru-logo.webp" + }, + { + name: "Tesla", + image: "/images/brands/tesla-logo.webp" + }, + { + name: "Toyota", + image: "/images/brands/toyota-logo.webp" + }, + { + name: "Volkswagen", + image: "/images/brands/volkswagen-logo.webp" + }, + { + name: "Volvo", + image: "/images/brands/volvo-logo.webp" + }, +] \ No newline at end of file