This commit is contained in:
oneao committed 2025-11-03 21:49:49 +08:00
1 parent 2347d55823
commit c0ff3ce883
6 files changed
+29 -6

No files matched your search

@@ -56,7 +56,7 @@ export default function RootLayout() {
// 如果没有 token,则跳转登录页
if (token === null) {
router.replace('/auth/login')
// router.replace('/auth/login')
}
}
}, [fontsLoaded, storeLoaded, token])
@@ -83,8 +83,7 @@ export default function RootLayout() {
<Stack.Screen
name="auth/login"
options={{
title: '登录',
headerShown: true,
headerShown: false,
}}
/>
<Stack.Screen name="+not-found" />
@@ -1,9 +1,12 @@
import { Text, View } from 'react-native'
import CustomLayout from '@/components/custom/layout'
export default function AuthLogin() {
return (
<View>
<Text>Login</Text>
</View>
<CustomLayout>
<View>
<Text>登录</Text>
</View>
</CustomLayout>
)
}
@@ -0,0 +1,21 @@
import { useRouter } from 'expo-router'
// components/Layout.tsx
import { Pressable, Text, View } from 'react-native'
import { SafeAreaView } from 'react-native-safe-area-context'
interface LayoutProps {
title: string
children: React.ReactNode
showBack?: boolean
right?: React.ReactNode
}
export default function CustomLayout({ title, children, showBack = true, right }: LayoutProps) {
const router = useRouter()
return (
<View className="flex-1">
{children}
</View>
)
}