From b31cb78592623f38104b55d5271c58fe3d7142e0 Mon Sep 17 00:00:00 2001 From: Hank Date: Mon, 6 Jul 2026 09:35:46 -0700 Subject: [PATCH] Map: search the viewport, add My Location + status feedback; tab bar icons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - "Search this area" now searches the map's current center (getCenter), so it works with no GPS fix — pan anywhere and search. Fixes "search here does nothing". - "My location" recenters the camera on the GPS fix and searches there. - Status bar shows real feedback (N meters / none found / errors) instead of silent. - Add bottom tab icons via @expo/vector-icons (map/qr/star/time). Co-Authored-By: Claude Fable 5 --- app/src/navigation/RootNavigator.tsx | 17 ++- app/src/screens/MapScreen.tsx | 168 ++++++++++++++++++--------- 2 files changed, 127 insertions(+), 58 deletions(-) diff --git a/app/src/navigation/RootNavigator.tsx b/app/src/navigation/RootNavigator.tsx index e59861f..cc6004f 100644 --- a/app/src/navigation/RootNavigator.tsx +++ b/app/src/navigation/RootNavigator.tsx @@ -1,5 +1,6 @@ import React from 'react'; import { ActivityIndicator, Text, TouchableOpacity, View } from 'react-native'; +import { Ionicons } from '@expo/vector-icons'; import { NavigationContainer, useNavigation } from '@react-navigation/native'; import { createNativeStackNavigator, @@ -41,10 +42,24 @@ function AboutButton() { ); } +const TAB_ICONS: Record = { + Map: 'map', + Scan: 'qr-code', + Favorites: 'star', + Sessions: 'time', +}; + function Tabs() { return ( }} + screenOptions={({ route }) => ({ + headerShown: true, + headerRight: () => , + tabBarActiveTintColor: '#1e6f5c', + tabBarIcon: ({ color, size }) => ( + + ), + })} > diff --git a/app/src/screens/MapScreen.tsx b/app/src/screens/MapScreen.tsx index 2a31414..2eecf3d 100644 --- a/app/src/screens/MapScreen.tsx +++ b/app/src/screens/MapScreen.tsx @@ -1,4 +1,4 @@ -import React, { useCallback, useEffect, useState } from 'react'; +import React, { useCallback, useEffect, useRef, useState } from 'react'; import { ActivityIndicator, StyleSheet, Text, TouchableOpacity, View } from 'react-native'; import Constants from 'expo-constants'; import { @@ -18,54 +18,105 @@ const MAP_STYLE = (Constants.expoConfig?.extra?.mapStyleUrl as string) ?? 'https://tiles.openfreemap.org/styles/liberty'; +// Fallback view when we have no GPS and no cached location (continental US). +const DEFAULT_CENTER: Coords = { latitude: 39.5, longitude: -98.35 }; +const DEFAULT_ZOOM = 4; + type Nav = NativeStackNavigationProp; export function MapScreen() { const navigation = useNavigation