Handle safe areas with tabs

This commit is contained in:
2024-01-06 16:44:04 +01:00
committed by Clément Le Bihan
parent f77874bec4
commit e81f2c1f75
2 changed files with 31 additions and 7 deletions
+5 -4
View File
@@ -1,5 +1,5 @@
/* eslint-disable no-mixed-spaces-and-tabs */
import { View, Image, Pressable, useColorScheme } from 'react-native';
import { View, Image, Pressable, useColorScheme, ViewStyle } from 'react-native';
import { Divider, Text, ScrollView, Row, useMediaQuery, useTheme } from 'native-base';
import { useAssets } from 'expo-asset';
import { useQuery } from '../../Queries';
@@ -123,7 +123,8 @@ const ScaffoldDesktopCC = ({
descriptors,
navigation,
children,
}: Omit<BottomTabBarProps, 'insets'> & { children: ReactElement }) => {
style,
}: Omit<BottomTabBarProps, 'insets'> & { children: ReactElement; style?: ViewStyle }) => {
const user = useQuery(API.getUserInfo);
const [isSmallScreen] = useMediaQuery({ maxWidth: 1100 });
const { colors } = useTheme();
@@ -135,7 +136,7 @@ const ScaffoldDesktopCC = ({
);
return (
<View style={{ height: '100%', flexDirection: 'row', overflow: 'hidden' }}>
<View style={[{ height: '100%', flexDirection: 'row', overflow: 'hidden' }, style]}>
<View
style={{
display: 'flex',
@@ -241,7 +242,7 @@ const ScaffoldDesktopCC = ({
borderRadius: 12,
// Become the same height as the child so if the child has overflow: auto, the child's scrollbar
// is hidden and we use this component's scrollbar.
minHeight: "auto"
minHeight: 'auto',
}}
>
{children}