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:
@@ -9,7 +9,7 @@ import { CalendarDays, Search, BookOpen, Clock, ChevronRight } from 'lucide-reac
|
||||
import { apiFetch } from '@/lib/api'
|
||||
import { ENDPOINTS } from '@/lib/config'
|
||||
import { useAuthStore } from '@/lib/store'
|
||||
import { C } from '../_layout'
|
||||
import { C } from '@/lib/theme'
|
||||
|
||||
interface Note {
|
||||
id: string
|
||||
@@ -45,7 +45,7 @@ export default function HomeScreen() {
|
||||
const res = await apiFetch(ENDPOINTS.dailyNote)
|
||||
if (res.ok) {
|
||||
const data = await res.json()
|
||||
router.push(`/note/${data.id}`)
|
||||
router.push({ pathname: '/note/[id]', params: { id: data.id } })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ export default function HomeScreen() {
|
||||
: recentNotes.map((note, i) => (
|
||||
<TouchableOpacity
|
||||
key={note.id}
|
||||
onPress={() => router.push(`/note/${note.id}`)}
|
||||
onPress={() => router.push({ pathname: '/note/[id]', params: { id: note.id } })}
|
||||
style={[s.noteRow, i === recentNotes.length - 1 && { borderBottomWidth: 0 }]}
|
||||
activeOpacity={0.6}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user