Skip to content

Commit

Permalink
Add jotai provider for nextjs
Browse files Browse the repository at this point in the history
  • Loading branch information
rmarscher committed May 12, 2024
1 parent e900cf8 commit bd7a8c9
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 21 deletions.
4 changes: 1 addition & 3 deletions apps/next/app/ssr/screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import { Paragraph, YStack } from '@t4/ui'
export function SSRTestScreen(props: { content: string }) {
return (
<YStack flex={1}>
<Paragraph role='heading'>
{props.content}
</Paragraph>
<Paragraph role='heading'>{props.content}</Paragraph>
</YStack>
)
}
2 changes: 1 addition & 1 deletion packages/api/src/auth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const getAuthOptions = (appUrl: string, apiUrl: string) => {
// experimental: {
// debugMode: true,
// },
})
}
}

declare module 'lucia' {
Expand Down
37 changes: 20 additions & 17 deletions packages/app/provider/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { ToastViewport } from './toast-viewport'
import { TRPCProvider } from './trpc'
import { Session } from 'app/utils/auth'
import { LuciaAuthProvider as AuthProvider } from './auth'
import { Provider as JotaiProvider } from 'jotai'

export function Provider({
children,
Expand All @@ -18,22 +19,24 @@ export function Provider({
initialSession: Session | null
}) {
return (
<TamaguiThemeProvider>
<SafeAreaProvider>
<SolitoImageProvider>
<ToastProvider swipeDirection='horizontal' duration={6000} native={['mobile']}>
<TRPCProvider>
<AuthProvider initialSession={initialSession}>
<TamaguiProvider>
{children}
<CustomToast />
<ToastViewport />
</TamaguiProvider>
</AuthProvider>
</TRPCProvider>
</ToastProvider>
</SolitoImageProvider>
</SafeAreaProvider>
</TamaguiThemeProvider>
<JotaiProvider>
<TamaguiThemeProvider>
<SafeAreaProvider>
<SolitoImageProvider>
<ToastProvider swipeDirection='horizontal' duration={6000} native={['mobile']}>
<TRPCProvider>
<AuthProvider initialSession={initialSession}>
<TamaguiProvider>
{children}
<CustomToast />
<ToastViewport />
</TamaguiProvider>
</AuthProvider>
</TRPCProvider>
</ToastProvider>
</SolitoImageProvider>
</SafeAreaProvider>
</TamaguiThemeProvider>
</JotaiProvider>
)
}

0 comments on commit bd7a8c9

Please sign in to comment.