From 55841a736e219062885b213ac59eeb30a1fc09bf Mon Sep 17 00:00:00 2001 From: ppc Date: Tue, 13 Aug 2024 22:20:58 +0100 Subject: [PATCH] add safearea to bottom tab bar --- amnet-native/components/AMUITabBar.tsx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/amnet-native/components/AMUITabBar.tsx b/amnet-native/components/AMUITabBar.tsx index ce6ed1e..94909fb 100644 --- a/amnet-native/components/AMUITabBar.tsx +++ b/amnet-native/components/AMUITabBar.tsx @@ -1,22 +1,26 @@ import {useTheme} from 'react-native-paper'; import {TouchableOpacity, View} from "react-native"; +import {useSafeAreaInsets} from "react-native-safe-area-context"; // tab bar inspired by https://stackoverflow.com/a/64028171 export function AMUITabBar({state, descriptors, navigation}) { const theme = useTheme(); + const insets = useSafeAreaInsets(); return ( + {state.routes.map((route, index) => { const {options} = descriptors[route.key]; @@ -37,6 +41,7 @@ export function AMUITabBar({state, descriptors, navigation}) { key={route.key} accessibilityRole="button" accessibilityLabel={options.tabBarAccessibilityLabel} + style={{paddingVertical: 15, paddingHorizontal: 35}} testID={options.tabBarTestID} onPress={onPress}> {options.tabBarIcon({color: isFocused ? theme.colors.primary : theme.colors.outline, size: 24})} @@ -44,5 +49,6 @@ export function AMUITabBar({state, descriptors, navigation}) { ); })} + ); } \ No newline at end of file