diff --git a/app/component/openLocation/Content.js b/app/component/openLocation/Content.js index 10cdf8e..a30f793 100644 --- a/app/component/openLocation/Content.js +++ b/app/component/openLocation/Content.js @@ -2,19 +2,9 @@ import CloseModalD from "@/components/icons/CloseModalD"; import Image from "next/image"; function Content({ data, onClose }) { - const { latitude, longitude } = data && data.map; + const { latitude, longitude } = data?.map ?? {}; const maps = [ - { - src: "/assets/images/snapp.png", - name: "snapp", - url: `https://snapp.ir/route?lat=${latitude}&lng=${longitude}`, - }, - { - src: "/assets/images/tapsi.png", - name: "tapsi", - url: `https://tapsi.ir/route?lat=${latitude}&lng=${longitude}`, - }, { src: "/assets/images/maps.png", name: "maps", @@ -23,7 +13,7 @@ function Content({ data, onClose }) { { src: "/assets/images/balad.png", name: "balad", - url: `https://balad.ir/map?lat=${latitude}&lng=${longitude}`, + url: `https://balad.ir/location?latitude=${latitude}&longitude=${longitude}`, }, { src: "/assets/images/waze.png", diff --git a/components/dashboard/userAccount/sidebars/turns/isTurnsDetails/DetailLg.js b/components/dashboard/userAccount/sidebars/turns/isTurnsDetails/DetailLg.js index 1dad4eb..8ea2458 100644 --- a/components/dashboard/userAccount/sidebars/turns/isTurnsDetails/DetailLg.js +++ b/components/dashboard/userAccount/sidebars/turns/isTurnsDetails/DetailLg.js @@ -109,7 +109,7 @@ function DetailLg({ appointmentData, loading }) { onClick={() => { const map = appointmentData?.address?.map; if (map?.latitude && map?.longitude) { - window.open(`https://www.google.com/maps?q=${map.latitude},${map.longitude}`, '_blank'); + window.open(`https://www.google.com/maps/dir/?api=1&destination=${map.latitude},${map.longitude}`, '_blank'); } }} > diff --git a/components/dashboard/userAccount/sidebars/turns/isTurnsDetails/DetailSm.js b/components/dashboard/userAccount/sidebars/turns/isTurnsDetails/DetailSm.js index 48e4c3e..49b0efa 100644 --- a/components/dashboard/userAccount/sidebars/turns/isTurnsDetails/DetailSm.js +++ b/components/dashboard/userAccount/sidebars/turns/isTurnsDetails/DetailSm.js @@ -99,7 +99,7 @@ function DetailSm({ appointmentData, loading }) { onClick={() => { const map = appointmentData?.address?.map; if (map?.latitude && map?.longitude) { - window.open(`https://www.google.com/maps?q=${map.latitude},${map.longitude}`, '_blank'); + window.open(`https://www.google.com/maps/dir/?api=1&destination=${map.latitude},${map.longitude}`, '_blank'); } }} >