From bd7a8c9016322c42c094ac06f9fb975f69281c3a Mon Sep 17 00:00:00 2001 From: Rob Marscher Date: Sat, 6 Jan 2024 15:25:08 -0500 Subject: [PATCH] Add jotai provider for nextjs https://jotai.org/docs/guides/nextjs#provider --- apps/next/app/ssr/screen.tsx | 4 +--- packages/api/src/auth/index.ts | 2 +- packages/app/provider/index.tsx | 37 ++++++++++++++++++--------------- 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/apps/next/app/ssr/screen.tsx b/apps/next/app/ssr/screen.tsx index 14800c462..6f69d17ab 100644 --- a/apps/next/app/ssr/screen.tsx +++ b/apps/next/app/ssr/screen.tsx @@ -5,9 +5,7 @@ import { Paragraph, YStack } from '@t4/ui' export function SSRTestScreen(props: { content: string }) { return ( - - {props.content} - + {props.content} ) } diff --git a/packages/api/src/auth/index.ts b/packages/api/src/auth/index.ts index 22e35b3a0..8e960c66f 100644 --- a/packages/api/src/auth/index.ts +++ b/packages/api/src/auth/index.ts @@ -69,7 +69,7 @@ export const getAuthOptions = (appUrl: string, apiUrl: string) => { // experimental: { // debugMode: true, // }, - }) + } } declare module 'lucia' { diff --git a/packages/app/provider/index.tsx b/packages/app/provider/index.tsx index 2ad501761..d683b935c 100644 --- a/packages/app/provider/index.tsx +++ b/packages/app/provider/index.tsx @@ -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, @@ -18,22 +19,24 @@ export function Provider({ initialSession: Session | null }) { return ( - - - - - - - - {children} - - - - - - - - - + + + + + + + + + {children} + + + + + + + + + + ) }