From c2137c8a89c8a47d895bfd0d8f7cc6bc3c772e52 Mon Sep 17 00:00:00 2001 From: John Doe Date: Thu, 14 Sep 2023 17:03:56 +0300 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Added=20initial=20code=20for=20the?= =?UTF-8?q?=20grid=20and=20map=20section.=20=F0=9F=9A=97=20Implemented=20c?= =?UTF-8?q?ar=20card=20rendering.=20=F0=9F=97=BA=EF=B8=8F=20Integrated=20G?= =?UTF-8?q?oogle=20Maps=20API=20for=20location=20display.=20=F0=9F=93=85?= =?UTF-8?q?=20Added=20date=20and=20filter=20components.=20=F0=9F=93=88=20I?= =?UTF-8?q?mplemented=20pagination=20functionality.=20=F0=9F=8C=9F=20Impro?= =?UTF-8?q?ved=20hover=20effect=20for=20car=20cards.=20=F0=9F=AA=99=20Fixe?= =?UTF-8?q?d=20responsive=20design=20issues.=20=F0=9F=93=9D=20Updated=20co?= =?UTF-8?q?mments=20and=20code=20documentation.=20=F0=9F=8E=A8=20Improved?= =?UTF-8?q?=20styling=20for=20a=20better=20user=20experience.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/(car-listings)/SectionGridHasMap.tsx | 112 +++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 src/app/(car-listings)/SectionGridHasMap.tsx diff --git a/src/app/(car-listings)/SectionGridHasMap.tsx b/src/app/(car-listings)/SectionGridHasMap.tsx new file mode 100644 index 0000000..5908844 --- /dev/null +++ b/src/app/(car-listings)/SectionGridHasMap.tsx @@ -0,0 +1,112 @@ +"use client"; + +import React, { FC, useState } from "react"; +import GoogleMapReact from "google-map-react"; +import { DEMO_CAR_LISTINGS } from "@/data/listings"; +import ButtonClose from "@/shared/ButtonClose"; +import Checkbox from "@/shared/Checkbox"; +import Pagination from "@/shared/Pagination"; +import TabFilters from "./TabFilters"; +import Heading2 from "@/shared/Heading2"; +import CarCardH from "@/components/CarCardH"; +import AnyReactComponent from "@/components/AnyReactComponent/AnyReactComponent"; + +const DEMO_CARS = DEMO_CAR_LISTINGS.filter((_, i) => i < 12); + +export interface SectionGridHasMapProps {} + +const SectionGridHasMap: FC = () => { + const [currentHoverID, setCurrentHoverID] = useState(-1); + const [showFullMapFixed, setShowFullMapFixed] = useState(false); + + return ( +
+
+ {/* CARDSSSS */} +
+ + 233 cars + ยท + Aug 12 - 18 + + } + /> +
+ +
+
+ {DEMO_CARS.map((item) => ( +
setCurrentHoverID((_) => item.id)} + onMouseLeave={() => setCurrentHoverID((_) => -1)} + > + +
+ ))} +
+
+ +
+
+ +
setShowFullMapFixed(true)} + > + + Show map +
+ + {/* MAPPPPP */} +
+ {showFullMapFixed && ( + setShowFullMapFixed(false)} + className="bg-white absolute z-50 left-3 top-3 shadow-lg rounded-xl w-10 h-10" + /> + )} + +
+
+ +
+ {/* BELLOW IS MY GOOGLE API KEY -- PLEASE DELETE AND TYPE YOUR API KEY */} + + + {DEMO_CARS.map((item) => ( + + ))} + +
+
+
+
+ ); +}; + +export default SectionGridHasMap;