Files
zeekay c183da5389 Drop webpack from the stack
The loader and the Next plugin only existed to drive webpack; Next runs
on Turbopack and Vite has its own plugin. kitchen-sink and the
integration app serve through vite, the optimizer suite drops the
webpack name, and its fixture packages join the workspace so a fresh
checkout links @my/ui.
2026-09-06 08:17:57 -07:00

34 lines
792 B
TypeScript

import { useColorScheme } from 'react-native'
import {
CustomToast,
GuiProvider,
type GuiProviderProps,
ToastProvider,
config,
isWeb,
} from '@my/ui'
import { ToastViewport } from './ToastViewport'
export function Provider({
children,
defaultTheme = 'light',
...rest
}: Omit<GuiProviderProps, 'config'> & { defaultTheme?: string }) {
const colorScheme = useColorScheme()
const theme = defaultTheme || (colorScheme === 'dark' ? 'dark' : 'light')
return (
<GuiProvider config={config} defaultTheme={theme} {...rest}>
<ToastProvider
swipeDirection="horizontal"
duration={6000}
native={isWeb ? [] : ['mobile']}
>
{children}
<CustomToast />
<ToastViewport />
</ToastProvider>
</GuiProvider>
)
}