Skip to content

Commit 97b068d

Browse files
committed
empty UI
1 parent 3c3927d commit 97b068d

File tree

6 files changed

+3672
-56
lines changed

6 files changed

+3672
-56
lines changed

entropy/mint-nft/ui/app/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/com
1010
import { Badge } from "@/components/ui/badge"
1111
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"
1212
import { Alert, AlertDescription } from "@/components/ui/alert"
13-
import { ConnectButton } from "@/components/mock-connect-button"
13+
import { WalletConnectButton } from "@/components/wallet-connect-button"
1414
import { InteractiveFlowDiagram } from "@/components/interactive-flow-diagram"
1515
import { ThemeToggle } from "@/components/theme-toggle"
1616

@@ -208,7 +208,7 @@ export default function PythentropyNFTDemo() {
208208

209209
{/* Wallet Connection */}
210210
<div className="flex justify-center mb-6">
211-
<ConnectButton />
211+
<WalletConnectButton />
212212
</div>
213213

214214
{/* Disclaimer */}

entropy/mint-nft/ui/app/providers.tsx

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,72 @@
11
"use client"
22

3+
import { getDefaultConfig, RainbowKitProvider } from '@rainbow-me/rainbowkit'
4+
import { WagmiProvider } from 'wagmi'
5+
import { base } from 'wagmi/chains'
6+
import { QueryClientProvider, QueryClient } from '@tanstack/react-query'
7+
import '@rainbow-me/rainbowkit/styles.css'
8+
import { useEffect, useState } from 'react'
39
import type { ReactNode } from "react"
410

11+
// Create a fallback config for SSR
12+
const createConfig = () => {
13+
if (typeof window === 'undefined') {
14+
// Return a minimal config for SSR
15+
return null
16+
}
17+
18+
return getDefaultConfig({
19+
appName: 'Pyth Entropy NFT Demo',
20+
projectId: process.env.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID || 'demo-project-id',
21+
chains: [base],
22+
ssr: false,
23+
})
24+
}
25+
26+
const createQueryClient = () => {
27+
return new QueryClient({
28+
defaultOptions: {
29+
queries: {
30+
refetchOnWindowFocus: false,
31+
retry: false,
32+
staleTime: 1000 * 60 * 5, // 5 minutes
33+
},
34+
},
35+
})
36+
}
37+
538
export function Providers({ children }: { children: ReactNode }) {
6-
return <>{children}</>
39+
const [mounted, setMounted] = useState(false)
40+
const [config, setConfig] = useState<ReturnType<typeof getDefaultConfig> | null>(null)
41+
const [queryClient] = useState(() => createQueryClient())
42+
43+
useEffect(() => {
44+
// Only initialize on client side
45+
if (typeof window !== 'undefined') {
46+
setConfig(createConfig())
47+
setMounted(true)
48+
}
49+
}, [])
50+
51+
// Show loading state during hydration
52+
if (!mounted || !config) {
53+
return (
54+
<div className="min-h-screen flex items-center justify-center">
55+
<div className="animate-spin rounded-full h-8 w-8 border-b-2 border-gray-900"></div>
56+
</div>
57+
)
58+
}
59+
60+
return (
61+
<WagmiProvider config={config}>
62+
<QueryClientProvider client={queryClient}>
63+
<RainbowKitProvider
64+
initialChain={base}
65+
showRecentTransactions={true}
66+
>
67+
{children}
68+
</RainbowKitProvider>
69+
</QueryClientProvider>
70+
</WagmiProvider>
71+
)
772
}

entropy/mint-nft/ui/components/mock-connect-button.tsx

Lines changed: 0 additions & 30 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
"use client"
2+
3+
import { ConnectButton } from '@rainbow-me/rainbowkit'
4+
5+
export function WalletConnectButton() {
6+
return <ConnectButton />
7+
}

entropy/mint-nft/ui/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
"@radix-ui/react-toggle": "1.1.1",
3939
"@radix-ui/react-toggle-group": "1.1.1",
4040
"@radix-ui/react-tooltip": "1.1.6",
41+
"@rainbow-me/rainbowkit": "^2.2.8",
42+
"@tanstack/react-query": "^5.84.2",
4143
"autoprefixer": "^10.4.20",
4244
"class-variance-authority": "^0.7.1",
4345
"clsx": "^2.1.1",
@@ -60,6 +62,8 @@
6062
"tailwind-merge": "^2.5.5",
6163
"tailwindcss-animate": "^1.0.7",
6264
"vaul": "^0.9.9",
65+
"viem": "^2.33.3",
66+
"wagmi": "^2.16.2",
6367
"zod": "3.25.67"
6468
},
6569
"devDependencies": {

0 commit comments

Comments
 (0)