2026-05-24 19:51:29 +00:00
|
|
|
'use client';
|
|
|
|
|
|
2026-05-24 23:33:54 +00:00
|
|
|
import { useEffect, useMemo, useState, useCallback, useRef } from 'react';
|
|
|
|
|
import { MapContainer, TileLayer, Marker, Popup, Polyline, useMap } from 'react-leaflet';
|
|
|
|
|
import { OrderItem, Supplier, DriverLocation } from '@/lib/types';
|
2026-05-24 20:31:35 +00:00
|
|
|
import { formatCurrency, calculateDistance, parseCoordinates } from '@/lib/utils';
|
2026-05-24 23:33:54 +00:00
|
|
|
import { getDriverTrail, isAuthenticated, getCurrentUser } from '@/lib/pocketbase';
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
import { Navigation, AlertTriangle, Route, Crosshair, Layers } from 'lucide-react';
|
2026-05-24 19:51:29 +00:00
|
|
|
import L from 'leaflet';
|
|
|
|
|
import 'leaflet/dist/leaflet.css';
|
|
|
|
|
|
|
|
|
|
const defaultIcon = L.icon({
|
|
|
|
|
iconUrl: 'https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/images/marker-icon.png',
|
|
|
|
|
iconRetinaUrl: 'https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/images/marker-icon-2x.png',
|
|
|
|
|
shadowUrl: 'https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/images/marker-shadow.png',
|
|
|
|
|
iconSize: [25, 41],
|
|
|
|
|
iconAnchor: [12, 41],
|
|
|
|
|
popupAnchor: [1, -34],
|
|
|
|
|
shadowSize: [41, 41],
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const currentLocationIcon = L.divIcon({
|
|
|
|
|
className: 'custom-div-icon',
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
html: `<div style="position:relative;">
|
|
|
|
|
<div style="width:22px;height:22px;background:#ea580c;border:3px solid white;border-radius:50%;box-shadow:0 2px 8px rgba(0,0,0,0.3);position:relative;z-index:2;"></div>
|
|
|
|
|
<div style="width:40px;height:40px;background:rgba(234,88,12,0.15);border-radius:50%;position:absolute;top:-9px;left:-9px;z-index:1;animation:pulse 2s infinite;"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<style>@keyframes pulse{0%,100%{transform:scale(1);opacity:1}50%{transform:scale(1.5);opacity:0}}</style>`,
|
|
|
|
|
iconSize: [22, 22],
|
|
|
|
|
iconAnchor: [11, 11],
|
2026-05-24 19:51:29 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
interface MapViewProps {
|
2026-05-24 22:47:47 +00:00
|
|
|
items: OrderItem[];
|
2026-05-24 19:51:29 +00:00
|
|
|
onNavigate: (lat: number, lng: number, name: string) => void;
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-24 22:47:47 +00:00
|
|
|
function MapBounds({ items }: { items: OrderItem[] }) {
|
2026-05-24 19:51:29 +00:00
|
|
|
const map = useMap();
|
|
|
|
|
useEffect(() => {
|
2026-05-24 22:47:47 +00:00
|
|
|
const validPoints = items
|
|
|
|
|
.map((i) => {
|
|
|
|
|
const coords = parseCoordinates(i.expand?.supplier?.coordinates);
|
2026-05-24 20:31:35 +00:00
|
|
|
return coords ? [coords.latitude, coords.longitude] as [number, number] : null;
|
|
|
|
|
})
|
|
|
|
|
.filter((point): point is [number, number] => point !== null);
|
2026-05-24 19:51:29 +00:00
|
|
|
if (validPoints.length > 0) {
|
|
|
|
|
const bounds = L.latLngBounds(validPoints);
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
map.fitBounds(bounds, { padding: [60, 60], maxZoom: 15 });
|
2026-05-24 19:51:29 +00:00
|
|
|
}
|
2026-05-24 22:47:47 +00:00
|
|
|
}, [map, items]);
|
2026-05-24 23:33:54 +00:00
|
|
|
return null;
|
|
|
|
|
}
|
2026-05-24 19:51:29 +00:00
|
|
|
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
function RecenterButton({ center }: { center: [number, number] }) {
|
2026-05-24 23:33:54 +00:00
|
|
|
const map = useMap();
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
return (
|
|
|
|
|
<button
|
|
|
|
|
onClick={() => map.setView(center, map.getZoom(), { animate: true })}
|
|
|
|
|
className="flex items-center justify-center w-10 h-10 bg-white/90 backdrop-blur-sm rounded-xl shadow-lg active:bg-gray-100 transition-all touch-manipulation press-feedback-sm"
|
|
|
|
|
>
|
|
|
|
|
<Crosshair size={18} className="text-gray-700" />
|
|
|
|
|
</button>
|
|
|
|
|
);
|
2026-05-24 19:51:29 +00:00
|
|
|
}
|
|
|
|
|
|
2026-05-24 22:47:47 +00:00
|
|
|
export default function CollectionMap({ items, onNavigate }: MapViewProps) {
|
2026-05-24 19:51:29 +00:00
|
|
|
const [userLocation, setUserLocation] = useState<[number, number] | null>(null);
|
2026-05-24 23:33:54 +00:00
|
|
|
const [trail, setTrail] = useState<[number, number][]>([]);
|
|
|
|
|
const [showTrail, setShowTrail] = useState(true);
|
|
|
|
|
const intervalRef = useRef<ReturnType<typeof setInterval> | null>(null);
|
2026-05-24 19:51:29 +00:00
|
|
|
|
2026-05-24 23:33:54 +00:00
|
|
|
// Get current position
|
2026-05-24 19:51:29 +00:00
|
|
|
useEffect(() => {
|
|
|
|
|
if ('geolocation' in navigator) {
|
|
|
|
|
navigator.geolocation.getCurrentPosition(
|
2026-05-24 22:47:47 +00:00
|
|
|
(pos) => setUserLocation([pos.coords.latitude, pos.coords.longitude]),
|
|
|
|
|
() => {},
|
2026-05-24 20:31:35 +00:00
|
|
|
{ enableHighAccuracy: false, timeout: 30000 }
|
2026-05-24 19:51:29 +00:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}, []);
|
|
|
|
|
|
2026-05-24 23:33:54 +00:00
|
|
|
// Fetch trail data periodically
|
|
|
|
|
const fetchTrail = useCallback(async () => {
|
|
|
|
|
if (!isAuthenticated()) return;
|
|
|
|
|
const user = getCurrentUser();
|
|
|
|
|
if (!user) return;
|
|
|
|
|
const data = await getDriverTrail(user.id);
|
|
|
|
|
const points = data
|
|
|
|
|
.filter((loc) => loc.latitude && loc.longitude)
|
|
|
|
|
.map((loc) => [loc.latitude, loc.longitude] as [number, number]);
|
|
|
|
|
if (points.length > 0) {
|
|
|
|
|
setTrail(points);
|
|
|
|
|
}
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
fetchTrail();
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
intervalRef.current = setInterval(fetchTrail, 60000);
|
2026-05-24 23:33:54 +00:00
|
|
|
return () => {
|
|
|
|
|
if (intervalRef.current) clearInterval(intervalRef.current);
|
|
|
|
|
};
|
|
|
|
|
}, [fetchTrail]);
|
|
|
|
|
|
|
|
|
|
// Group by supplier
|
2026-05-24 19:51:29 +00:00
|
|
|
const suppliers = useMemo(() => {
|
2026-05-24 22:47:47 +00:00
|
|
|
const map = new Map<string, { supplier: Supplier; items: OrderItem[]; coords: { latitude: number; longitude: number } }>();
|
|
|
|
|
items.forEach((item) => {
|
|
|
|
|
if (!item.expand?.supplier) return;
|
|
|
|
|
const supplier = item.expand.supplier;
|
2026-05-24 20:31:35 +00:00
|
|
|
const coords = parseCoordinates(supplier.coordinates);
|
|
|
|
|
if (!coords) return;
|
2026-05-24 19:51:29 +00:00
|
|
|
const key = supplier.id;
|
|
|
|
|
if (!map.has(key)) {
|
2026-05-24 22:47:47 +00:00
|
|
|
map.set(key, { supplier, items: [], coords });
|
2026-05-24 19:51:29 +00:00
|
|
|
}
|
2026-05-24 22:47:47 +00:00
|
|
|
map.get(key)!.items.push(item);
|
2026-05-24 19:51:29 +00:00
|
|
|
});
|
|
|
|
|
return Array.from(map.values());
|
2026-05-24 22:47:47 +00:00
|
|
|
}, [items]);
|
2026-05-24 19:51:29 +00:00
|
|
|
|
2026-05-24 22:47:47 +00:00
|
|
|
const defaultCenter: [number, number] = [-33.9249, 18.4241];
|
2026-05-24 19:51:29 +00:00
|
|
|
const center = userLocation || defaultCenter;
|
|
|
|
|
|
2026-05-24 22:47:47 +00:00
|
|
|
const getDistance = (coords: { latitude: number; longitude: number }) => {
|
2026-05-24 20:31:35 +00:00
|
|
|
if (!userLocation) return null;
|
2026-05-24 22:47:47 +00:00
|
|
|
return calculateDistance(userLocation[0], userLocation[1], coords.latitude, coords.longitude);
|
2026-05-24 19:51:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return (
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
<div className="h-full w-full relative">
|
2026-05-24 22:47:47 +00:00
|
|
|
<MapContainer center={center} zoom={12} className="h-full w-full" zoomControl={false}>
|
2026-05-24 23:33:54 +00:00
|
|
|
<TileLayer
|
|
|
|
|
attribution='© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>'
|
|
|
|
|
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
|
|
|
|
|
/>
|
|
|
|
|
|
2026-05-24 22:47:47 +00:00
|
|
|
<MapBounds items={items} />
|
2026-05-24 19:51:29 +00:00
|
|
|
|
|
|
|
|
{userLocation && (
|
|
|
|
|
<Marker position={userLocation} icon={currentLocationIcon}>
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
<Popup>
|
|
|
|
|
<div className="text-sm font-medium">Your Location</div>
|
|
|
|
|
</Popup>
|
2026-05-24 19:51:29 +00:00
|
|
|
</Marker>
|
|
|
|
|
)}
|
|
|
|
|
|
2026-05-24 23:33:54 +00:00
|
|
|
{/* Trail polyline */}
|
|
|
|
|
{showTrail && trail.length > 1 && (
|
|
|
|
|
<>
|
|
|
|
|
<Polyline
|
|
|
|
|
positions={trail}
|
|
|
|
|
pathOptions={{
|
|
|
|
|
color: '#2563eb',
|
|
|
|
|
weight: 4,
|
|
|
|
|
opacity: 0.7,
|
|
|
|
|
dashArray: '10, 8',
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
<Marker
|
|
|
|
|
position={trail[0]}
|
|
|
|
|
icon={L.divIcon({
|
|
|
|
|
className: '',
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
html: '<div style="width:14px;height:14px;background:#22c55e;border:3px solid white;border-radius:50%;box-shadow:0 1px 4px rgba(0,0,0,0.3);"></div>',
|
2026-05-24 23:33:54 +00:00
|
|
|
iconSize: [14, 14],
|
|
|
|
|
iconAnchor: [7, 7],
|
|
|
|
|
})}
|
|
|
|
|
>
|
|
|
|
|
<Popup><div className="text-xs font-medium">Trip Start</div></Popup>
|
|
|
|
|
</Marker>
|
|
|
|
|
</>
|
|
|
|
|
)}
|
|
|
|
|
|
2026-05-24 22:47:47 +00:00
|
|
|
{suppliers.map(({ supplier, items: supplierItems, coords }) => {
|
|
|
|
|
const distance = getDistance(coords);
|
2026-05-24 19:51:29 +00:00
|
|
|
return (
|
2026-05-24 22:47:47 +00:00
|
|
|
<Marker key={supplier.id} position={[coords.latitude, coords.longitude]} icon={defaultIcon}>
|
2026-05-24 19:51:29 +00:00
|
|
|
<Popup>
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
<div className="min-w-[200px] max-w-[260px]">
|
2026-05-24 19:51:29 +00:00
|
|
|
<h3 className="font-bold text-sm mb-1">{supplier.suppliername}</h3>
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
{supplier.supplieraddress && (
|
|
|
|
|
<p className="text-xs text-gray-500 mb-2">{supplier.supplieraddress}</p>
|
|
|
|
|
)}
|
|
|
|
|
{distance && (
|
|
|
|
|
<p className="text-xs text-orange-600 mb-2 font-semibold">
|
|
|
|
|
{distance < 1 ? `${Math.round(distance * 1000)}m` : `${distance.toFixed(1)} km`} away
|
|
|
|
|
</p>
|
|
|
|
|
)}
|
2026-05-24 19:51:29 +00:00
|
|
|
<div className="space-y-1.5 mb-3">
|
2026-05-24 22:47:47 +00:00
|
|
|
{supplierItems.map((i) => (
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
<div key={i.id} className="text-xs p-2 bg-gray-50 rounded-lg">
|
|
|
|
|
<div className="flex items-center gap-1.5">
|
|
|
|
|
{(i.item_status === 'problem' || i.problem_flag) && <AlertTriangle size={12} className="text-red-500 flex-shrink-0" />}
|
2026-05-24 22:47:47 +00:00
|
|
|
<span className="font-medium truncate">{i.description}</span>
|
2026-05-24 19:51:29 +00:00
|
|
|
</div>
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
<span className="text-gray-400 text-[11px]">Qty: {i.order_qty || i.quantity || 0}</span>
|
2026-05-24 19:51:29 +00:00
|
|
|
</div>
|
|
|
|
|
))}
|
|
|
|
|
</div>
|
|
|
|
|
<button
|
2026-05-24 22:47:47 +00:00
|
|
|
onClick={() => onNavigate(coords.latitude, coords.longitude, supplier.suppliername)}
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
className="w-full flex items-center justify-center gap-1.5 py-2 px-3 bg-orange-500 text-white rounded-lg text-sm font-semibold active:bg-orange-600 transition-colors"
|
2026-05-24 19:51:29 +00:00
|
|
|
>
|
2026-05-24 22:47:47 +00:00
|
|
|
<Navigation size={14} /> Navigate
|
2026-05-24 19:51:29 +00:00
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</Popup>
|
|
|
|
|
</Marker>
|
|
|
|
|
);
|
|
|
|
|
})}
|
|
|
|
|
</MapContainer>
|
|
|
|
|
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
{/* Floating controls */}
|
|
|
|
|
<div className="absolute top-3 right-3 space-y-2 z-[400]">
|
|
|
|
|
{/* Recenter */}
|
|
|
|
|
{userLocation && (
|
|
|
|
|
<RecenterButton center={userLocation} />
|
|
|
|
|
)}
|
|
|
|
|
|
2026-05-24 23:33:54 +00:00
|
|
|
{/* Trail toggle */}
|
|
|
|
|
{trail.length > 1 && (
|
|
|
|
|
<button
|
|
|
|
|
onClick={() => setShowTrail(!showTrail)}
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
className={`flex items-center gap-1.5 px-3 py-2 rounded-xl text-xs font-semibold shadow-lg transition-colors press-feedback-sm ${
|
|
|
|
|
showTrail ? 'bg-blue-500 text-white' : 'bg-white/90 backdrop-blur-sm text-gray-700'
|
2026-05-24 23:33:54 +00:00
|
|
|
}`}
|
|
|
|
|
>
|
|
|
|
|
<Route size={14} />
|
|
|
|
|
Trail
|
|
|
|
|
</button>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{/* Legend */}
|
|
|
|
|
<div className="bg-white/90 backdrop-blur-sm rounded-xl p-3 shadow-lg">
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
<p className="text-[10px] font-bold text-gray-500 uppercase tracking-wider mb-2">Legend</p>
|
2026-05-24 23:33:54 +00:00
|
|
|
<div className="space-y-1.5">
|
|
|
|
|
<div className="flex items-center gap-2">
|
|
|
|
|
<div className="w-3 h-3 rounded-full bg-orange-500 border-2 border-white shadow-sm" />
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
<span className="text-[11px] text-gray-600">You</span>
|
2026-05-24 23:33:54 +00:00
|
|
|
</div>
|
|
|
|
|
<div className="flex items-center gap-2">
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
<div className="w-3 h-3.5 bg-blue-900/70 rounded-sm" />
|
|
|
|
|
<span className="text-[11px] text-gray-600">Stop</span>
|
2026-05-24 19:51:29 +00:00
|
|
|
</div>
|
2026-05-24 23:33:54 +00:00
|
|
|
{trail.length > 1 && (
|
|
|
|
|
<div className="flex items-center gap-2">
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
<div className="w-5 h-0" style={{ borderTop: '2px dashed #2563eb' }} />
|
|
|
|
|
<span className="text-[11px] text-gray-600">Route</span>
|
2026-05-24 23:33:54 +00:00
|
|
|
</div>
|
|
|
|
|
)}
|
2026-05-24 19:51:29 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
}
|