added pipeline version
This commit is contained in:
parent
99467465c6
commit
3bb87e2806
@ -75,7 +75,7 @@ export function DailyLogMap({
|
||||
'groupid': '25',
|
||||
'orgid': '57',
|
||||
'templateid': '189',
|
||||
'x-pipeline-version': 'draft'
|
||||
'x-pipeline-version': 'latest'
|
||||
}
|
||||
);
|
||||
|
||||
@ -90,13 +90,13 @@ export function DailyLogMap({
|
||||
useEffect(() => {
|
||||
// If coords provided in props, use them
|
||||
if (latitude && longitude && String(latitude).trim() !== '—' && String(longitude).trim() !== '—') {
|
||||
const lat = Number(latitude);
|
||||
const lng = Number(longitude);
|
||||
if (!isNaN(lat) && !isNaN(lng)) {
|
||||
setUserLocation({ lat, lng });
|
||||
fetchNearestStores(lat, lng);
|
||||
return;
|
||||
}
|
||||
const lat = Number(latitude);
|
||||
const lng = Number(longitude);
|
||||
if (!isNaN(lat) && !isNaN(lng)) {
|
||||
setUserLocation({ lat, lng });
|
||||
fetchNearestStores(lat, lng);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Otherwise fallback to whatever tactic used for mobile
|
||||
@ -127,10 +127,10 @@ export function DailyLogMap({
|
||||
map.fitBounds(bounds);
|
||||
|
||||
const listener = window.google.maps.event.addListener(map, 'idle', () => {
|
||||
if (map.getZoom()! > 15) {
|
||||
map.setZoom(15);
|
||||
}
|
||||
window.google.maps.event.removeListener(listener);
|
||||
if (map.getZoom()! > 15) {
|
||||
map.setZoom(15);
|
||||
}
|
||||
window.google.maps.event.removeListener(listener);
|
||||
});
|
||||
}
|
||||
}, [userLocation]);
|
||||
@ -232,24 +232,24 @@ export function DailyLogMap({
|
||||
|
||||
{showStoreList && (
|
||||
<div className="mt-4 p-5 flex flex-col gap-4 bg-[var(--tiles-card-bg)] rounded-xl border border-slate-200">
|
||||
<h3 className="font-bold text-slate-800 text-sm m-0 flex items-center gap-2 uppercase tracking-wider">
|
||||
<MapPin size={16} className="text-slate-500" /> Nearby Stores
|
||||
</h3>
|
||||
<div className="flex flex-col gap-3">
|
||||
{stores.length > 0 ? (
|
||||
stores.map((store) => (
|
||||
<div key={store.store_code} className="flex flex-col p-3 rounded-lg border border-slate-100 bg-slate-50 hover:bg-slate-100 transition-colors cursor-pointer" onClick={() => setSelectedStore(store)}>
|
||||
<span className="font-bold text-slate-800 text-sm">{store.business_name}</span>
|
||||
<span className="text-xs text-slate-500">{store.store_code}</span>
|
||||
{store.distance_km != null && (
|
||||
<span className="text-xs text-[#1b37a5] font-semibold mt-1">{store.distance_km.toFixed(2)} km away</span>
|
||||
)}
|
||||
</div>
|
||||
))
|
||||
) : (
|
||||
<span className="text-sm text-slate-400 italic">No nearby stores found.</span>
|
||||
)}
|
||||
</div>
|
||||
<h3 className="font-bold text-slate-800 text-sm m-0 flex items-center gap-2 uppercase tracking-wider">
|
||||
<MapPin size={16} className="text-slate-500" /> Nearby Stores
|
||||
</h3>
|
||||
<div className="flex flex-col gap-3">
|
||||
{stores.length > 0 ? (
|
||||
stores.map((store) => (
|
||||
<div key={store.store_code} className="flex flex-col p-3 rounded-lg border border-slate-100 bg-slate-50 hover:bg-slate-100 transition-colors cursor-pointer" onClick={() => setSelectedStore(store)}>
|
||||
<span className="font-bold text-slate-800 text-sm">{store.business_name}</span>
|
||||
<span className="text-xs text-slate-500">{store.store_code}</span>
|
||||
{store.distance_km != null && (
|
||||
<span className="text-xs text-[#1b37a5] font-semibold mt-1">{store.distance_km.toFixed(2)} km away</span>
|
||||
)}
|
||||
</div>
|
||||
))
|
||||
) : (
|
||||
<span className="text-sm text-slate-400 italic">No nearby stores found.</span>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user