fix(map): hide the 'You are here' pin on desktop
Location is a mobile-only affordance now (the desktop Near Me button was removed), so stop seeding the cached location on desktop and don't pass userLocation to the map on desktop. Result: no 'You are here' badge and no proximity sort on desktop; mobile is unchanged. Gate: 101 tests, 0 errors/warnings, boot smoke green.
This commit is contained in:
parent
9e8f8b87de
commit
e1deec21bd
1 changed files with 6 additions and 1 deletions
|
|
@ -12,6 +12,7 @@ import { filterByTrustLevel, type TrustFilterLevel } from '@/lib/trustFilter';
|
||||||
import { SortDropdown, type SortOption } from '@/components/SortDropdown';
|
import { SortDropdown, type SortOption } from '@/components/SortDropdown';
|
||||||
import { calculateDistance } from '@/lib/sortOptions';
|
import { calculateDistance } from '@/lib/sortOptions';
|
||||||
import { useZapTotals, zapTargetKey } from '@/hooks/useZapTotals';
|
import { useZapTotals, zapTargetKey } from '@/hooks/useZapTotals';
|
||||||
|
import { useIsMobile } from '@/hooks/useIsMobile';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import { Input } from '@/components/ui/input';
|
import { Input } from '@/components/ui/input';
|
||||||
import { Badge } from '@/components/ui/badge';
|
import { Badge } from '@/components/ui/badge';
|
||||||
|
|
@ -603,7 +604,11 @@ export default function MapPage() {
|
||||||
const [sortBy, setSortBy] = useState<SortOption>('recent');
|
const [sortBy, setSortBy] = useState<SortOption>('recent');
|
||||||
// Seed from the cached last-known location so the "you are here" badge and
|
// Seed from the cached last-known location so the "you are here" badge and
|
||||||
// proximity sorting are available instantly; a fresh fix updates it.
|
// proximity sorting are available instantly; a fresh fix updates it.
|
||||||
|
// Mobile-only: Near Me is a mobile affordance, so desktop shows no location
|
||||||
|
// pin (or proximity sort).
|
||||||
|
const isMobile = useIsMobile();
|
||||||
const [userLocation, setUserLocation] = useState<{lat: number; lon: number} | null>(() => {
|
const [userLocation, setUserLocation] = useState<{lat: number; lon: number} | null>(() => {
|
||||||
|
if (!isMobile) return null;
|
||||||
const cached = getLastLocation();
|
const cached = getLastLocation();
|
||||||
return cached ? { lat: cached.lat, lon: cached.lng } : null;
|
return cached ? { lat: cached.lat, lon: cached.lng } : null;
|
||||||
});
|
});
|
||||||
|
|
@ -1635,7 +1640,7 @@ export default function MapPage() {
|
||||||
showCrews={showCrews}
|
showCrews={showCrews}
|
||||||
showBtcMap={showBtcMap}
|
showBtcMap={showBtcMap}
|
||||||
flyTo={flyTo}
|
flyTo={flyTo}
|
||||||
userLocation={userLocation ? { lat: userLocation.lat, lng: userLocation.lon } : null}
|
userLocation={isMobile && userLocation ? { lat: userLocation.lat, lng: userLocation.lon } : null}
|
||||||
/>
|
/>
|
||||||
</Suspense>
|
</Suspense>
|
||||||
{/* Loading indicator — a slim, honest top bar. The map stays
|
{/* Loading indicator — a slim, honest top bar. The map stays
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue