From a95a618c6dd12bb7b88afef36e1fd8a0cbdb9d29 Mon Sep 17 00:00:00 2001 From: John Doe Date: Wed, 13 Sep 2023 17:16:35 +0300 Subject: [PATCH] feat: add map to section grid :tada: * add map to section grid component * add ability to show/hide map * add checkbox to search as I move the map --- .../SectionGridHasMap.tsx | 113 ++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 src/app/(experience-listings)/SectionGridHasMap.tsx diff --git a/src/app/(experience-listings)/SectionGridHasMap.tsx b/src/app/(experience-listings)/SectionGridHasMap.tsx new file mode 100644 index 0000000..4024f63 --- /dev/null +++ b/src/app/(experience-listings)/SectionGridHasMap.tsx @@ -0,0 +1,113 @@ +"use client"; + +import React, { FC, useState } from "react"; +import AnyReactComponent from "@/components/AnyReactComponent/AnyReactComponent"; +import GoogleMapReact from "google-map-react"; +import { DEMO_EXPERIENCES_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 ExperiencesCardH from "@/components/ExperiencesCardH"; + +const DEMO_EXPERIENCES = DEMO_EXPERIENCES_LISTINGS.filter((_, i) => i < 12); + +export interface SectionGridHasMapProps {} + +const SectionGridHasMap: FC = () => { + const [currentHoverID, setCurrentHoverID] = useState(-1); + const [showFullMapFixed, setShowFullMapFixed] = useState(false); + + return ( +
+
+ {/* CARDSSSS */} +
+ + 233 experiences + · + Aug 12 - 18 + ·2 Guests + + } + /> +
+ +
+
+ {DEMO_EXPERIENCES.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_EXPERIENCES.map((item) => ( + + ))} + +
+
+
+
+ ); +}; + +export default SectionGridHasMap;