This commit is contained in:
imeepos
2026-01-28 16:04:14 +08:00
parent efd4aba8c1
commit ffed84a90c
4 changed files with 339 additions and 60 deletions

View File

@@ -13,6 +13,7 @@ configureReanimatedLogger({
strict: false,
})
import { GestureHandlerRootView } from 'react-native-gesture-handler'
import { BottomSheetModalProvider } from '@gorhom/bottom-sheet'
import { View, ActivityIndicator, AppState, LogBox } from 'react-native'
import * as Updates from 'expo-updates'
@@ -168,18 +169,20 @@ function Providers({ children }: { children: React.ReactNode }) {
return (
<SafeAreaProvider>
<GestureHandlerRootView style={{ flex: 1 }}>
<KeyboardProvider>
<ThemeProvider value={colorScheme === 'dark' ? DarkTheme : DefaultTheme}>
{children}
{/* modals */}
<BottomSheetModalProvider>
<KeyboardProvider>
<ThemeProvider value={colorScheme === 'dark' ? DarkTheme : DefaultTheme}>
{children}
{/* modals */}
{/* 挂载全局方法 */}
<ModalPortal ref={(ref) => ((global as any).actionSheet = ref)} />
<ModalPortal ref={(ref) => ((global as any).modal = ref)} />
<ModalPortal ref={(ref) => ((global as any).loading = ref)} />
<ModalPortal ref={(ref) => ((global as any).toast = ref)} />
</ThemeProvider>
</KeyboardProvider>
{/* 挂载全局方法 */}
<ModalPortal ref={(ref) => ((global as any).actionSheet = ref)} />
<ModalPortal ref={(ref) => ((global as any).modal = ref)} />
<ModalPortal ref={(ref) => ((global as any).loading = ref)} />
<ModalPortal ref={(ref) => ((global as any).toast = ref)} />
</ThemeProvider>
</KeyboardProvider>
</BottomSheetModalProvider>
</GestureHandlerRootView>
</SafeAreaProvider>
)