From e13d1c2eeb11f5574b0a87796d27c2f8a02d5c1f Mon Sep 17 00:00:00 2001 From: hamed <15238-genius.ha@users.noreply.drupalcode.org> Date: Mon, 15 Jun 2026 15:26:10 +0330 Subject: [PATCH] fix(location): correct directions deep links MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The routing modal shipped broken deep links: snapp.ir/route and tapsi.ir/route paths don't exist (404), and balad used the wrong path and params. Keep only apps with verified destination deep links and fix their formats: - Remove Snapp and Tapsi (no valid web destination route). - Balad: balad.ir/location?latitude=&longitude= (was /map?lat=&lng=). - Google Maps and Waze kept (already correct). - Guard data.map destructuring against null. - Dashboard turn detail: use maps/dir directions URL instead of a plain q= pin to match the مسیریابی label. Co-Authored-By: Claude Opus 4.8 --- app/component/openLocation/Content.js | 14 ++------------ .../sidebars/turns/isTurnsDetails/DetailLg.js | 2 +- .../sidebars/turns/isTurnsDetails/DetailSm.js | 2 +- 3 files changed, 4 insertions(+), 14 deletions(-) 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'); } }} >