fix(location): correct directions deep links
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
}}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user