From 54d48c8ce3162a4bb43b7b82621ffc8ba35b9650 Mon Sep 17 00:00:00 2001 From: C4rnivore Date: Fri, 25 Jul 2025 11:58:30 +0500 Subject: [PATCH] Mobile map modal and more POIs --- src/components/MarasiDriveMapMobile.tsx | 68 ++++++----- src/components/ui/MapMarker.tsx | 5 +- src/data/marasiDriveMapData.tsx | 144 +++++++++++++++++++----- 3 files changed, 160 insertions(+), 57 deletions(-) diff --git a/src/components/MarasiDriveMapMobile.tsx b/src/components/MarasiDriveMapMobile.tsx index 59debfd..48b761b 100644 --- a/src/components/MarasiDriveMapMobile.tsx +++ b/src/components/MarasiDriveMapMobile.tsx @@ -5,52 +5,60 @@ import { MarasiDriveMapData } from "../data/marasiDriveMapData"; import GoogleMap from "./GoogleMap"; import Button from "./ui/Button"; import FullScreenIcon from "./icons/FullScreenIcon"; -import CloseIcon from "./icons/CloseIcon"; +import useModalStore from "../stores/useModalStore"; function MarasiDriveMapMobile() { const containerRef = useRef(null); - const mapRef = useRef(null); const [mapActive, setMapActive] = useState(false); + const { modal, setModal } = useModalStore(); useEffect(() => { - if (mapActive) { - mapRef.current?.scrollIntoView(); - window.scrollBy({ - top: -40, - left: 0, - behavior: "smooth", - }); - document.body.style.overflowY = "hidden"; - } else { - document.body.style.overflowY = "scroll"; - } + if (mapActive) setModal(); + else setModal(null); }, [mapActive]); - return ( -
+ useEffect(() => { + setMapActive(!!modal); + }, [modal]); + + const MapModal = () => { + return (
-
+ ); + }; + + return ( +
+ { +
+ + +
+ } +
- {children} + <> + {children} + + ); diff --git a/src/data/marasiDriveMapData.tsx b/src/data/marasiDriveMapData.tsx index 92d9cf6..2b15d00 100644 --- a/src/data/marasiDriveMapData.tsx +++ b/src/data/marasiDriveMapData.tsx @@ -1,8 +1,12 @@ /* eslint-disable no-loss-of-precision */ +import IGMapPoi from "../types/IGMapPoi"; + import MarasiMarker from "../../public/images/map/markers/marasi-drive.png"; import MarinaMarker from "../../public/images/map/markers/dubai-marina.png"; -import ShopIcon from "../../public/images/map/markers/points/shop-point.svg"; -import IGMapPoi from "../types/IGMapPoi"; +import MallsIcon from "../components/icons/map/MallsIcon"; +import HotelIcon from "../components/icons/map/HotelIcon"; +import EntertainmentIcon from "../components/icons/map/EntertainmentIcon"; +import OtherIcon from "../components/icons/map/OtherIcon"; const marasiDriveMarker = (
@@ -16,11 +20,20 @@ const DubaiMarinaMarker = (
); -const shopMarker = ( -
- -
-); +function Marker(type: "Hotels" | "Malls" | "Entertainment" | "Other") { + const SvgByType = { + Hotels: , + Malls: , + Entertainment: , + Other: , + }; + + return ( +
+ {SvgByType[type]} +
+ ); +} export const MarasiDriveMapData: { defaultCenter: { lat: number; lng: number }; @@ -28,26 +41,112 @@ export const MarasiDriveMapData: { } = { defaultCenter: { lat: 25.183476007744233, lng: 55.274782084720286 }, markers: [ + // HOTELS { - location: { lat: 25.223476007744233, lng: 55.274782084720286 }, - type: "Malls", - customMarker: shopMarker, + //Atlantis the Palm + location: { lat: 25.13046499761402, lng: 55.11718843636159 }, + type: "Hotels", + customMarker: Marker("Hotels"), }, { - location: { lat: 25.123476007744233, lng: 55.258782084720286 }, - type: "Malls", - customMarker: shopMarker, + //Atlantis the Royal + location: { lat: 25.138673890838593, lng: 55.12795877692962 }, + type: "Hotels", + customMarker: Marker("Hotels"), }, { - location: { lat: 25.143476007744233, lng: 55.224782084720286 }, - type: "Malls", - customMarker: shopMarker, + //Rove JBR + location: { lat: 25.083013494794002, lng: 55.13925845861501 }, + type: "Hotels", + customMarker: Marker("Hotels"), }, { - location: { lat: 25.223476007744233, lng: 55.278782084720286 }, - type: "Malls", - customMarker: shopMarker, + //Rove Dubai Marina Hotel + location: { lat: 25.069466431595334, lng: 55.128736429300375 }, + type: "Hotels", + ignoreClusterization: true, + customMarker: DubaiMarinaMarker, + clickableAreaScale: 3, }, + { + //Jumeirah Burj Al Arab + location: { lat: 25.14125865549382, lng: 55.18534065404832 }, + type: "Hotels", + customMarker: Marker("Hotels"), + }, + + // MALLS + { + //Dubai Marina Mall + location: { lat: 25.076382747164647, lng: 55.14196528147056 }, + type: "Malls", + customMarker: Marker("Malls"), + }, + + // ENTERTAINMENT + { + // Skydive Dubai + location: { lat: 25.090979874826218, lng: 55.13798324927472 }, + type: "Entertainment", + customMarker: Marker("Entertainment"), + }, + { + // JBR Beach + location: { lat: 25.077626143690992, lng: 55.131404670555284 }, + type: "Entertainment", + customMarker: Marker("Entertainment"), + }, + { + // Emirates Golf Club + location: { lat: 25.08540156566801, lng: 55.16017556009668 }, + type: "Entertainment", + customMarker: Marker("Entertainment"), + }, + + // OTHER + { + // Palm Jumeirah + location: { lat: 25.116513748878386, lng: 55.13630547853065 }, + type: "Other", + customMarker: Marker("Other"), + }, + { + // Dubai Harbour + location: { lat: 25.093312800021923, lng: 55.14276330405519 }, + type: "Other", + customMarker: Marker("Other"), + }, + { + // Emirates Hills + location: { lat: 25.06922740304993, lng: 55.171394810795576 }, + type: "Other", + customMarker: Marker("Other"), + }, + { + // Internet City + location: { lat: 25.09899279065803, lng: 55.16505834170482 }, + type: "Other", + customMarker: Marker("Other"), + }, + { + // JLT + location: { lat: 25.078250849819398, lng: 55.1499560328892 }, + type: "Other", + customMarker: Marker("Other"), + }, + { + // Jumeirah Islands + location: { lat: 25.05800902880235, lng: 55.15510123900208 }, + type: "Other", + customMarker: Marker("Other"), + }, + { + // Bluewaters Island + location: { lat: 25.080169343022643, lng: 55.121785121589454 }, + type: "Other", + customMarker: Marker("Other"), + }, + { location: { lat: 25.181371868546396, lng: 55.27515332907251 }, type: "Hotels", @@ -55,12 +154,5 @@ export const MarasiDriveMapData: { customMarker: marasiDriveMarker, clickableAreaScale: 3, }, - { - location: { lat: 25.069466431595334, lng: 55.128736429300375 }, - type: "Hotels", - ignoreClusterization: true, - customMarker: DubaiMarinaMarker, - clickableAreaScale: 3, - }, ], };