mobile: fix navigation (typed routes), extract C tokens to lib/theme.ts
- lib/theme.ts: C design tokens dans fichier dédié (plus d'import circulaire _layout)
- app/_layout.tsx: importe C depuis @/lib/theme, ré-exporte pour compatibilité
- Tous les écrans: import C depuis '@/lib/theme' au lieu de '../_layout'
- Toutes les navigations: router.push({ pathname, params }) au lieu de template strings
-> Fix réel du bug 'impossible d'ouvrir carnet/note' avec Expo Router v6
- package.json: expo-web-browser ajouté (pour Google OAuth étape suivante)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -4,6 +4,10 @@ import { SafeAreaProvider } from 'react-native-safe-area-context'
|
||||
import { StatusBar } from 'expo-status-bar'
|
||||
import { View, ActivityIndicator, StyleSheet } from 'react-native'
|
||||
import { useAuthStore } from '@/lib/store'
|
||||
import { C } from '@/lib/theme'
|
||||
|
||||
// Ré-exporter C pour la compatibilité avec les anciens imports
|
||||
export { C } from '@/lib/theme'
|
||||
|
||||
export default function RootLayout() {
|
||||
const { user, loading, restore } = useAuthStore()
|
||||
@@ -35,18 +39,6 @@ export default function RootLayout() {
|
||||
)
|
||||
}
|
||||
|
||||
export const C = {
|
||||
brand: '#A47148',
|
||||
ink: '#1A1A18',
|
||||
paper: '#FAFAF8',
|
||||
concrete: '#8A8A82',
|
||||
border: '#E8E6E0',
|
||||
white: '#FFFFFF',
|
||||
rose: '#e11d48',
|
||||
roseBg: '#fff1f2',
|
||||
roseBorder: '#fecdd3',
|
||||
}
|
||||
|
||||
const s = StyleSheet.create({
|
||||
loader: { flex: 1, alignItems: 'center', justifyContent: 'center', backgroundColor: C.paper },
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user