Skip to content

Commit

Permalink
refactor: theme provider hydration issue on builder app
Browse files Browse the repository at this point in the history
  • Loading branch information
enesozturk committed Dec 15, 2024
1 parent 444d1dd commit 9e11655
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 17 deletions.
17 changes: 8 additions & 9 deletions apps/builder/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,14 @@ export default async function RootLayout({ children }: Readonly<{ children: Reac
const cookies = headers().get('cookie')

return (
<html lang="en">
<ThemeProvider attribute="class" defaultTheme="dark" enableSystem>
<Toaster />
<AppKitProvider cookies={cookies}>
<ContextProvider>
<body className={cn(khTeka.className)}>{children}</body>
</ContextProvider>
</AppKitProvider>
</ThemeProvider>
<html lang="en" suppressHydrationWarning>
<body className={cn(khTeka.className)}>
<ThemeProvider attribute="class" defaultTheme="dark" enableSystem={false}>
<AppKitProvider cookies={cookies}>
<ContextProvider>{children}</ContextProvider>
</AppKitProvider>
</ThemeProvider>
</body>
</html>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,8 @@ import { UniqueIdentifier } from '@dnd-kit/core'
import { useAppKitContext } from '@/hooks/use-appkit'
import { WalletFeatureName } from '@/lib/types'
import { ConstantsUtil, WalletFeature } from '@reown/appkit-core'
import dynamic from 'next/dynamic'
import { urlStateUtils } from '@/lib/url-state'

const SortableWalletFeatureList = dynamic(
() =>
import('@/components/sortable-list-wallet-features').then(mod => mod.SortableWalletFeatureList),
{ ssr: false }
)
import { SortableWalletFeatureList } from '@/components/sortable-list-wallet-features'

const defaultWalletFeaturesOrder = ['onramp', 'swaps', 'receive', 'send']

Expand Down
1 change: 0 additions & 1 deletion apps/builder/components/preview-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import { Button } from '@/components/ui/button'
import { toast } from 'sonner'
import Image from 'next/image'
import { Link1Icon, ResetIcon } from '@radix-ui/react-icons'
import { useAppKitContext } from '@/hooks/use-appkit'

Expand Down

0 comments on commit 9e11655

Please sign in to comment.