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