fix(mobile): migrate to Expo SDK 54, replace NativeWind with StyleSheet
- Update package.json to Expo ~54.0.35, expo-router ~6.0.24, RN 0.81.5 - Remove NativeWind/Tailwind dependencies - Fix babel.config.js: presets babel-preset-expo only - Rewrite all screens with StyleSheet.create (no className) - Add lucide-react-native + react-native-svg - Export design tokens C from _layout.tsx for shared usage - Install node_modules (702 packages) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -2,7 +2,7 @@ import { useEffect } from 'react'
|
||||
import { Slot, useRouter, useSegments } from 'expo-router'
|
||||
import { SafeAreaProvider } from 'react-native-safe-area-context'
|
||||
import { StatusBar } from 'expo-status-bar'
|
||||
import { View, ActivityIndicator } from 'react-native'
|
||||
import { View, ActivityIndicator, StyleSheet } from 'react-native'
|
||||
import { useAuthStore } from '@/lib/store'
|
||||
|
||||
export default function RootLayout() {
|
||||
@@ -10,24 +10,19 @@ export default function RootLayout() {
|
||||
const router = useRouter()
|
||||
const segments = useSegments()
|
||||
|
||||
useEffect(() => {
|
||||
restore()
|
||||
}, [])
|
||||
useEffect(() => { restore() }, [])
|
||||
|
||||
useEffect(() => {
|
||||
if (loading) return
|
||||
const inAuth = segments[0] === '(auth)'
|
||||
if (!user && !inAuth) {
|
||||
router.replace('/(auth)/login')
|
||||
} else if (user && inAuth) {
|
||||
router.replace('/(tabs)/home')
|
||||
}
|
||||
if (!user && !inAuth) router.replace('/(auth)/login')
|
||||
else if (user && inAuth) router.replace('/(tabs)/home')
|
||||
}, [user, loading, segments])
|
||||
|
||||
if (loading) {
|
||||
return (
|
||||
<View className="flex-1 items-center justify-center bg-paper">
|
||||
<ActivityIndicator size="large" color="#A47148" />
|
||||
<View style={s.loader}>
|
||||
<ActivityIndicator size="large" color={C.brand} />
|
||||
</View>
|
||||
)
|
||||
}
|
||||
@@ -39,3 +34,19 @@ export default function RootLayout() {
|
||||
</SafeAreaProvider>
|
||||
)
|
||||
}
|
||||
|
||||
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