@@ -30,12 +30,12 @@ import {
30
30
useContractMetadata ,
31
31
useTokenDrop ,
32
32
} from "@thirdweb-dev/react" ;
33
- import { IpfsStorage , TokenDrop } from "@thirdweb-dev/sdk" ;
33
+ import { TokenDrop } from "@thirdweb-dev/sdk" ;
34
+ import { IpfsStorage } from "@thirdweb-dev/storage" ;
34
35
import { formatUnits , parseUnits } from "ethers/lib/utils" ;
35
36
import React , { useEffect , useMemo , useRef , useState } from "react" ;
36
37
import { createRoot } from "react-dom/client" ;
37
38
import { IoDiamondOutline } from "react-icons/io5" ;
38
- import { QueryClient , QueryClientProvider } from "react-query" ;
39
39
import { Header } from "src/shared/header" ;
40
40
import { ConnectWalletButton } from "../shared/connect-wallet-button" ;
41
41
import { Footer } from "../shared/footer" ;
@@ -73,7 +73,7 @@ const ClaimButton: React.FC<ClaimPageProps> = ({
73
73
74
74
const claimIneligibilityReasons = useClaimIneligibilityReasons ( contract , {
75
75
quantity,
76
- walletAddress : address ,
76
+ walletAddress : address || "" ,
77
77
} ) ;
78
78
79
79
const isEnabled = ! ! contract && ! ! address && chainId === expectedChainId ;
@@ -287,8 +287,6 @@ const TokenDropEmbed: React.FC<TokenDropEmbedProps> = ({
287
287
} ) => {
288
288
const { setColorMode } = useColorMode ( ) ;
289
289
const tokenDrop = useTokenDrop ( contractAddress ) ;
290
- const activeClaimCondition = useActiveClaimCondition ( tokenDrop ) ;
291
- const tokenAddress = activeClaimCondition ?. data ?. currencyAddress ;
292
290
293
291
useEffect ( ( ) => {
294
292
setColorMode ( colorScheme ) ;
@@ -309,7 +307,7 @@ const TokenDropEmbed: React.FC<TokenDropEmbedProps> = ({
309
307
borderColor = "borderColor"
310
308
bgColor = "backgroundHighlight"
311
309
>
312
- < Header tokenAddress = { tokenAddress } />
310
+ < Header primaryColor = { primaryColor } colorScheme = { colorScheme } />
313
311
< Body >
314
312
< ClaimPage
315
313
contract = { tokenDrop }
@@ -323,7 +321,6 @@ const TokenDropEmbed: React.FC<TokenDropEmbedProps> = ({
323
321
) ;
324
322
} ;
325
323
326
- const queryClient = new QueryClient ( ) ;
327
324
const urlParams = new URL ( window . location . toString ( ) ) . searchParams ;
328
325
329
326
const App : React . FC = ( ) => {
@@ -359,26 +356,24 @@ const App: React.FC = () => {
359
356
}
360
357
` }
361
358
/>
362
- < QueryClientProvider client = { queryClient } >
363
- < ChakraProvider theme = { chakraTheme } >
364
- < ThirdwebProvider
365
- desiredChainId = { expectedChainId }
366
- sdkOptions = { sdkOptions }
367
- storageInterface = {
368
- ipfsGateway ? new IpfsStorage ( ipfsGateway ) : undefined
369
- }
370
- chainRpc = { { [ expectedChainId ] : rpcUrl } }
371
- >
372
- < TokenDropEmbed
373
- contractAddress = { contractAddress }
374
- expectedChainId = { expectedChainId }
375
- colorScheme = { colorScheme }
376
- primaryColor = { primaryColor }
377
- secondaryColor = { secondaryColor }
378
- />
379
- </ ThirdwebProvider >
380
- </ ChakraProvider >
381
- </ QueryClientProvider >
359
+ < ChakraProvider theme = { chakraTheme } >
360
+ < ThirdwebProvider
361
+ desiredChainId = { expectedChainId }
362
+ sdkOptions = { sdkOptions }
363
+ storageInterface = {
364
+ ipfsGateway ? new IpfsStorage ( ipfsGateway ) : undefined
365
+ }
366
+ chainRpc = { { [ expectedChainId ] : rpcUrl } }
367
+ >
368
+ < TokenDropEmbed
369
+ contractAddress = { contractAddress }
370
+ expectedChainId = { expectedChainId }
371
+ colorScheme = { colorScheme }
372
+ primaryColor = { primaryColor }
373
+ secondaryColor = { secondaryColor }
374
+ />
375
+ </ ThirdwebProvider >
376
+ </ ChakraProvider >
382
377
</ >
383
378
) ;
384
379
} ;
0 commit comments