fix(mobile): respecte les safe areas (Dynamic Island + indicateur home)

- AppBar : marge haute = inset top (plus de chevauchement avec l'heure/Dynamic Island)
- barre d'onglets : hauteur/marge basse = inset bottom (plus collée au bord)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Azmog
2026-06-19 15:38:16 +02:00
parent 91ceca2be5
commit 925f56a649
2 changed files with 7 additions and 3 deletions
+4 -2
View File
@@ -1,9 +1,11 @@
import { Tabs } from 'expo-router'; import { Tabs } from 'expo-router';
import { Ionicons } from '@expo/vector-icons'; import { Ionicons } from '@expo/vector-icons';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import { Colors } from '@/lib/colors'; import { Colors } from '@/lib/colors';
import { FontWeight, Spacing } from '@/lib/theme'; import { FontWeight, Spacing } from '@/lib/theme';
export default function TabLayout() { export default function TabLayout() {
const insets = useSafeAreaInsets();
return ( return (
<Tabs <Tabs
screenOptions={{ screenOptions={{
@@ -12,9 +14,9 @@ export default function TabLayout() {
tabBarStyle: { tabBarStyle: {
backgroundColor: Colors.white, backgroundColor: Colors.white,
borderTopColor: Colors.gray[200], borderTopColor: Colors.gray[200],
paddingBottom: Spacing.sm, paddingBottom: insets.bottom,
paddingTop: Spacing.sm, paddingTop: Spacing.sm,
height: Spacing.xxxl + Spacing.xl + 1, height: Spacing.xxxl + Spacing.xl + 1 + insets.bottom,
}, },
tabBarLabelStyle: { fontWeight: FontWeight.medium }, tabBarLabelStyle: { fontWeight: FontWeight.medium },
headerStyle: { backgroundColor: Colors.white }, headerStyle: { backgroundColor: Colors.white },
+3 -1
View File
@@ -1,4 +1,5 @@
import { StyleSheet, Text, View } from 'react-native'; import { StyleSheet, Text, View } from 'react-native';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import { Colors } from '@/lib/colors'; import { Colors } from '@/lib/colors';
import { FontSize, FontWeight, LetterSpacing, LineHeight, Spacing } from '@/lib/theme'; import { FontSize, FontWeight, LetterSpacing, LineHeight, Spacing } from '@/lib/theme';
@@ -16,8 +17,9 @@ interface AppBarProps {
* du service, avec un titre/sous-titre de page optionnel. * du service, avec un titre/sous-titre de page optionnel.
*/ */
export default function AppBar({ title, subtitle, right }: AppBarProps) { export default function AppBar({ title, subtitle, right }: AppBarProps) {
const insets = useSafeAreaInsets();
return ( return (
<View style={styles.wrapper} accessibilityRole="header"> <View style={[styles.wrapper, { paddingTop: insets.top }]} accessibilityRole="header">
<View style={styles.brandRow}> <View style={styles.brandRow}>
<View style={styles.marianne}> <View style={styles.marianne}>
<Text style={styles.republique}>RÉPUBLIQUE</Text> <Text style={styles.republique}>RÉPUBLIQUE</Text>