u
This commit is contained in:
1 parent
2347d55823
commit
c0ff3ce883
6 files changed
+29
-6
No files matched your search
@@ -56,7 +56,7 @@ export default function RootLayout() {
|
|||||||
|
|
||||||
// 如果没有 token,则跳转登录页
|
// 如果没有 token,则跳转登录页
|
||||||
if (token === null) {
|
if (token === null) {
|
||||||
router.replace('/auth/login')
|
// router.replace('/auth/login')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, [fontsLoaded, storeLoaded, token])
|
}, [fontsLoaded, storeLoaded, token])
|
||||||
@@ -83,8 +83,7 @@ export default function RootLayout() {
|
|||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="auth/login"
|
name="auth/login"
|
||||||
options={{
|
options={{
|
||||||
title: '登录',
|
headerShown: false,
|
||||||
headerShown: true,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen name="+not-found" />
|
<Stack.Screen name="+not-found" />
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
import { Text, View } from 'react-native'
|
import { Text, View } from 'react-native'
|
||||||
|
import CustomLayout from '@/components/custom/layout'
|
||||||
|
|
||||||
export default function AuthLogin() {
|
export default function AuthLogin() {
|
||||||
return (
|
return (
|
||||||
<View>
|
<CustomLayout>
|
||||||
<Text>Login</Text>
|
<View>
|
||||||
</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>
|
||||||
|
)
|
||||||
|
}
|
||||||
File renamed without changes.
Binary file not shown.
|
After Width: | Height: | Size: 81 KiB |
Reference in new issue
Block a user