@@ -15,6 +15,7 @@ import {
15
15
import {
16
16
useActiveClaimCondition ,
17
17
useAddress ,
18
+ useClaimConditions ,
18
19
useClaimIneligibilityReasons ,
19
20
Web3Button ,
20
21
} from "@thirdweb-dev/react" ;
@@ -42,6 +43,7 @@ export const ERC20ClaimButton: React.FC<ClaimButtoProps> = ({
42
43
43
44
const debouncedQuantity = useDebounce ( quantity , 500 ) ;
44
45
46
+ const claimConditions = useClaimConditions ( contract ) ;
45
47
const activeClaimCondition = useActiveClaimCondition ( contract ) ;
46
48
const claimIneligibilityReasons = useClaimIneligibilityReasons ( contract , {
47
49
quantity : debouncedQuantity ,
@@ -198,14 +200,31 @@ export const ERC20ClaimButton: React.FC<ClaimButtoProps> = ({
198
200
const colors = chakraTheme . colors ;
199
201
const accentColor = colors [ primaryColor as keyof typeof colors ] [ 500 ] ;
200
202
201
- if ( activeClaimCondition . isError ) {
203
+ if (
204
+ claimConditions . data ?. length === 0 ||
205
+ claimConditions . data ?. every ( ( cc ) => cc . maxQuantity === "0" )
206
+ ) {
202
207
return (
203
208
< Text size = "label.md" color = "red.500" >
204
209
This drop is not ready to be minted yet. (No claim condition set)
205
210
</ Text >
206
211
) ;
207
212
}
208
213
214
+ if (
215
+ ( claimConditions . data &&
216
+ claimConditions . data . length > 0 &&
217
+ activeClaimCondition . isError ) ||
218
+ ( activeClaimCondition . data &&
219
+ activeClaimCondition . data . startTime > new Date ( ) )
220
+ ) {
221
+ return (
222
+ < Text size = "label.md" color = { `${ primaryColor } .500` } >
223
+ Drop is starting soon. Please check back later.
224
+ </ Text >
225
+ ) ;
226
+ }
227
+
209
228
return (
210
229
< Stack spacing = { 4 } align = "center" w = "100%" >
211
230
< Flex
0 commit comments