feat: nhấn nút toggle status để chuyển đến bản đồ di chuyển

This commit is contained in:
2026-06-17 21:30:41 +07:00
parent ffe3cb6ecd
commit 55de887f87
2 changed files with 20 additions and 4 deletions
+13
View File
@@ -748,6 +748,18 @@ export const TourDetailPage = ({
};
}, [routes, selectedRouteIndex]);
const handleNavigateToLocation = (location: any) => {
setViewMode('map');
setMapCenter([location.latitude, location.longitude]);
setLocateTrigger(prev => prev + 1);
notify({
title: 'Bắt đầu chỉ đường',
message: `Đang hiển thị lộ trình từ vị trí của bạn đến ${location.name}`,
type: 'info'
});
};
useEffect(() => {
if (initialViewState) {
setMapCenter(initialViewState.center);
@@ -1378,6 +1390,7 @@ export const TourDetailPage = ({
onQuickNote={(locName: string) => handleQuickNote(locName)}
onSuccess={() => fetchTour(tourId)}
isPublicView={isPublicView}
onNavigate={handleNavigateToLocation}
/>
) : (
<div className="h-[60vh] w-full rounded-3xl overflow-hidden shadow-xl border-4 border-white relative">