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:
@@ -8,7 +8,7 @@ import { useRouter } from 'expo-router'
|
||||
import { ChevronRight, BookOpen, Folder } from 'lucide-react-native'
|
||||
import { apiFetch } from '@/lib/api'
|
||||
import { ENDPOINTS } from '@/lib/config'
|
||||
import { C } from '../_layout'
|
||||
import { C } from '@/lib/theme'
|
||||
|
||||
interface Notebook {
|
||||
id: string
|
||||
@@ -72,7 +72,7 @@ export default function NotebooksScreen() {
|
||||
contentContainerStyle={s.list}
|
||||
refreshControl={<RefreshControl refreshing={refreshing} onRefresh={() => { setRefreshing(true); load() }} tintColor={C.brand} />}
|
||||
renderItem={({ item }) => (
|
||||
<TouchableOpacity onPress={() => router.push(`/notebook/${item.id}`)} style={s.card} activeOpacity={0.7}>
|
||||
<TouchableOpacity onPress={() => router.push({ pathname: '/notebook/[id]', params: { id: item.id } })} style={s.card} activeOpacity={0.7}>
|
||||
<View style={[s.iconWrap, { backgroundColor: (item.color || C.brand) + '18' }]}>
|
||||
<NotebookIcon icon={item.icon} color={item.color} />
|
||||
</View>
|
||||
|
||||
Reference in New Issue
Block a user