mirror of
https://github.com/luxfi/app.git
synced 2026-10-30 17:02:19 +00:00
Phase 1: rebranded @hanzogui/expo-router-starter as @luxfi/app. Targets iOS/Android/web (Expo) + desktop (Tauri). Drives luxfi/node + luxfi/ai. See README. Co-authored-by: Hanzo Dev <[email protected]>
34 lines
962 B
TypeScript
34 lines
962 B
TypeScript
import { useColorScheme } from 'react-native'
|
|
import { GuiProvider, type GuiProviderProps } from 'hanzogui'
|
|
import { ToastProvider, ToastViewport } from '@hanzogui/toast'
|
|
import { CurrentToast } from './CurrentToast'
|
|
import { config } from '../gui.config'
|
|
|
|
export function Provider({
|
|
children,
|
|
...rest
|
|
}: Omit<GuiProviderProps, 'config' | 'defaultTheme'>) {
|
|
const colorScheme = useColorScheme()
|
|
|
|
return (
|
|
<GuiProvider
|
|
config={config}
|
|
defaultTheme={colorScheme === 'dark' ? 'dark' : 'light'}
|
|
{...rest}
|
|
>
|
|
<ToastProvider
|
|
swipeDirection="horizontal"
|
|
duration={6000}
|
|
native={[
|
|
// uncomment the next line to do native toasts on mobile. NOTE: it'll require you making a dev build and won't work with Expo Go
|
|
// 'mobile'
|
|
]}
|
|
>
|
|
{children}
|
|
<CurrentToast />
|
|
<ToastViewport top="$8" left={0} right={0} />
|
|
</ToastProvider>
|
|
</GuiProvider>
|
|
)
|
|
}
|