Skip to content

Colota - Android GPS Location tracker

fix: remove duplicate bottom safe-area inset above tab bar Closes #283

Max Dietrich2cc32889f032
diff --git a/apps/mobile/App.tsx b/apps/mobile/App.tsx
index b8e7b02b..bf2b5808 100644
--- a/apps/mobile/App.tsx
+++ b/apps/mobile/App.tsx
@@ -5,8 +5,8 @@
import React, { useMemo, useState, useCallback } from "react"
import { NavigationContainer, NavigationContainerRef } from "@react-navigation/native"
import { createNativeStackNavigator } from "@react-navigation/native-stack"
-import { SafeAreaProvider } from "react-native-safe-area-context"
-import { View, StatusBar, Platform, StyleSheet } from "react-native"
+import { SafeAreaProvider, SafeAreaView } from "react-native-safe-area-context"
+import { StatusBar, Platform, StyleSheet } from "react-native"
import MapLibreGL from "@maplibre/maplibre-react-native"
import { ThemeProvider, useTheme } from "./src/hooks/useTheme"
import { fonts } from "./src/styles/typography"
@@ -198,7 +198,7 @@ function AppNavigator() {
<SafeAreaProvider>
<StatusBar {...statusBarConfig} />
<NavigationContainer linking={linking} ref={navigationRef} onStateChange={handleStateChange}>
- <View style={styles.flex}>
+ <SafeAreaView style={styles.flex} edges={["left", "right", "bottom"]}>
<Stack.Navigator initialRouteName="Dashboard" screenOptions={screenOptions}>
{SCREEN_CONFIG.map((screen) => (
<Stack.Screen
@@ -210,7 +210,7 @@ function AppNavigator() {
))}
</Stack.Navigator>
<BottomTabBar currentRoute={currentRoute} onNavigate={handleTabNavigate} />
- </View>
+ </SafeAreaView>
</NavigationContainer>
</SafeAreaProvider>
)
diff --git a/apps/mobile/src/components/ui/BottomTabBar.tsx b/apps/mobile/src/components/ui/BottomTabBar.tsx
index d66fa04e..691d123b 100644
--- a/apps/mobile/src/components/ui/BottomTabBar.tsx
+++ b/apps/mobile/src/components/ui/BottomTabBar.tsx
@@ -4,7 +4,6 @@
*/
import React from "react"
import { View, Pressable, Text, StyleSheet } from "react-native"
-import { useSafeAreaInsets } from "react-native-safe-area-context"
import { Map, Clock, Fence, Settings, LucideIcon } from "lucide-react-native"
import { useTheme } from "../../hooks/useTheme"
import { fonts } from "../../styles/typography"
@@ -33,7 +32,6 @@ interface BottomTabBarProps {
export function BottomTabBar({ currentRoute, onNavigate }: BottomTabBarProps) {
const { colors } = useTheme()
- const insets = useSafeAreaInsets()
if (!currentRoute || !TAB_ROUTES.has(currentRoute)) return null
@@ -43,8 +41,7 @@ export function BottomTabBar({ currentRoute, onNavigate }: BottomTabBarProps) {
styles.container,
{
backgroundColor: colors.card,
- borderTopColor: colors.border,
- paddingBottom: Math.max(insets.bottom, 6)
+ borderTopColor: colors.border
}
]}
>
@@ -72,7 +69,8 @@ const styles = StyleSheet.create({
container: {
flexDirection: "row",
borderTopWidth: 1,
- paddingTop: 8
+ paddingTop: 8,
+ paddingBottom: 6
},
tab: {
flex: 1,