mirror of
https://gitee.com/wanwujie/sub2api-mobile
synced 2026-04-03 06:52:14 +08:00
feat: refine admin UI and add EAS release workflow
This commit is contained in:
@@ -7,19 +7,20 @@ import { ActivityIndicator, View } from 'react-native';
|
||||
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
||||
|
||||
import { queryClient } from '@/src/lib/query-client';
|
||||
import { markPerformance } from '@/src/lib/performance';
|
||||
import { adminConfigState, hydrateAdminConfig } from '@/src/store/admin-config';
|
||||
|
||||
const { useSnapshot } = require('valtio/react');
|
||||
|
||||
export default function RootLayout() {
|
||||
const config = useSnapshot(adminConfigState);
|
||||
|
||||
useEffect(() => {
|
||||
hydrateAdminConfig().catch(() => undefined);
|
||||
hydrateAdminConfig()
|
||||
.then(() => markPerformance('config_hydrated'))
|
||||
.catch(() => undefined);
|
||||
}, []);
|
||||
|
||||
const config = useSnapshot(adminConfigState);
|
||||
const isReady = config.hydrated;
|
||||
const isAuthenticated = Boolean(config.baseUrl.trim() && config.adminApiKey.trim());
|
||||
|
||||
return (
|
||||
<GestureHandlerRootView style={{ flex: 1 }}>
|
||||
@@ -30,8 +31,9 @@ export default function RootLayout() {
|
||||
</View>
|
||||
) : (
|
||||
<Stack screenOptions={{ headerShown: false }}>
|
||||
{isAuthenticated ? <Stack.Screen name="(tabs)" /> : <Stack.Screen name="login" />}
|
||||
<Stack.Screen name="users/[id]" />
|
||||
<Stack.Screen name="(tabs)" />
|
||||
<Stack.Screen name="login" />
|
||||
<Stack.Screen name="users/[id]" options={{ animation: 'slide_from_right', presentation: 'card' }} />
|
||||
<Stack.Screen name="accounts/[id]" options={{ presentation: 'card' }} />
|
||||
</Stack>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user