@@ -77,7 +77,7 @@ export const ERC20ClaimButton: React.FC<ClaimButtoProps> = ({
77
77
parseFloat ( activeClaimCondition . data ?. maxQuantity || "0" ) || 0 ,
78
78
) ;
79
79
} catch ( e ) {
80
- bnMaxClaimable = BigNumber . from ( 1_000_000 ) ;
80
+ bnMaxClaimable = BigNumber . from ( 1_000_000_000_000 ) ;
81
81
}
82
82
83
83
let perTransactionClaimable ;
@@ -86,7 +86,7 @@ export const ERC20ClaimButton: React.FC<ClaimButtoProps> = ({
86
86
activeClaimCondition . data ?. quantityLimitPerTransaction || 0 ,
87
87
) ;
88
88
} catch ( e ) {
89
- perTransactionClaimable = BigNumber . from ( 1_000_000 ) ;
89
+ perTransactionClaimable = BigNumber . from ( 1_000_000_000_000 ) ;
90
90
}
91
91
92
92
if ( perTransactionClaimable . lte ( bnMaxClaimable ) ) {
@@ -100,7 +100,7 @@ export const ERC20ClaimButton: React.FC<ClaimButtoProps> = ({
100
100
if ( snapshotClaimable ) {
101
101
if ( snapshotClaimable === "0" ) {
102
102
// allowed unlimited for the snapshot
103
- bnMaxClaimable = BigNumber . from ( 1_000_000 ) ;
103
+ bnMaxClaimable = BigNumber . from ( 1_000_000_000_000 ) ;
104
104
} else {
105
105
try {
106
106
bnMaxClaimable = BigNumber . from ( snapshotClaimable ) ;
@@ -110,8 +110,8 @@ export const ERC20ClaimButton: React.FC<ClaimButtoProps> = ({
110
110
}
111
111
}
112
112
113
- if ( bnMaxClaimable . gte ( 1_000_000 ) ) {
114
- return 1_000_000 ;
113
+ if ( bnMaxClaimable . gte ( 1_000_000_000_000 ) ) {
114
+ return 1_000_000_000_000 ;
115
115
}
116
116
117
117
return bnMaxClaimable . toNumber ( ) ;
@@ -121,18 +121,24 @@ export const ERC20ClaimButton: React.FC<ClaimButtoProps> = ({
121
121
activeClaimCondition . data ?. snapshot ,
122
122
address ,
123
123
] ) ;
124
+
124
125
const isSoldOut = useMemo ( ( ) => {
125
126
try {
126
127
return (
127
- activeClaimCondition . isSuccess &&
128
- BigNumber . from ( activeClaimCondition . data ?. availableSupply || 0 ) . lte ( 0 )
128
+ ( activeClaimCondition . isSuccess &&
129
+ BigNumber . from ( activeClaimCondition . data ?. availableSupply || 0 ) . lte (
130
+ 0 ,
131
+ ) ) ||
132
+ numberClaimed === numberTotal
129
133
) ;
130
134
} catch ( e ) {
131
135
return false ;
132
136
}
133
137
} , [
134
138
activeClaimCondition . data ?. availableSupply ,
135
139
activeClaimCondition . isSuccess ,
140
+ numberClaimed ,
141
+ numberTotal ,
136
142
] ) ;
137
143
138
144
const canClaim = useMemo ( ( ) => {
@@ -195,7 +201,7 @@ export const ERC20ClaimButton: React.FC<ClaimButtoProps> = ({
195
201
if ( activeClaimCondition . isError ) {
196
202
return (
197
203
< Text size = "label.md" color = "red.500" >
198
- This drop is not ready to be claimed yet. (No claim condition set. )
204
+ This drop is not ready to be minted yet. (No claim condition set)
199
205
</ Text >
200
206
) ;
201
207
}
@@ -209,30 +215,32 @@ export const ERC20ClaimButton: React.FC<ClaimButtoProps> = ({
209
215
justifyContent = "center"
210
216
alignItems = "center"
211
217
>
212
- < Skeleton isLoaded = { ! isLoading } >
213
- < NumberInput
214
- inputMode = "numeric"
215
- value = { quantity }
216
- onChange = { ( stringValue , value ) => {
217
- if ( stringValue === "" ) {
218
- setQuantity ( 1 ) ;
219
- } else {
220
- setQuantity ( value ) ;
221
- }
222
- } }
223
- min = { 1 }
224
- max = { maxClaimable }
225
- maxW = { { base : "100%" , sm : "100px" } }
226
- bgColor = "inputBg"
227
- height = "full"
228
- >
229
- < NumberInputField />
230
- < NumberInputStepper >
231
- < NumberIncrementStepper />
232
- < NumberDecrementStepper />
233
- </ NumberInputStepper >
234
- </ NumberInput >
235
- </ Skeleton >
218
+ { ! isSoldOut && (
219
+ < Skeleton isLoaded = { ! isLoading } >
220
+ < NumberInput
221
+ inputMode = "numeric"
222
+ value = { quantity }
223
+ onChange = { ( stringValue , value ) => {
224
+ if ( stringValue === "" ) {
225
+ setQuantity ( 1 ) ;
226
+ } else {
227
+ setQuantity ( value ) ;
228
+ }
229
+ } }
230
+ min = { 1 }
231
+ max = { maxClaimable }
232
+ maxW = { { base : "100%" , sm : "100px" } }
233
+ bgColor = "inputBg"
234
+ height = "full"
235
+ >
236
+ < NumberInputField />
237
+ < NumberInputStepper >
238
+ < NumberIncrementStepper />
239
+ < NumberDecrementStepper />
240
+ </ NumberInputStepper >
241
+ </ NumberInput >
242
+ </ Skeleton >
243
+ ) }
236
244
< Web3Button
237
245
colorMode = { colorScheme }
238
246
contractAddress = { contract ?. getAddress ( ) || "" }
@@ -242,15 +250,15 @@ export const ERC20ClaimButton: React.FC<ClaimButtoProps> = ({
242
250
onError = { ( err ) => {
243
251
console . error ( err ) ;
244
252
toast ( {
245
- title : "Failed to claim drop." ,
253
+ title : "Failed to mint drop." ,
246
254
status : "error" ,
247
255
duration : 9000 ,
248
256
isClosable : true ,
249
257
} ) ;
250
258
} }
251
259
onSuccess = { ( ) => {
252
260
toast ( {
253
- title : "Successfully claimed ." ,
261
+ title : "Successfully minted ." ,
254
262
status : "success" ,
255
263
duration : 5000 ,
256
264
isClosable : true ,
@@ -269,7 +277,7 @@ export const ERC20ClaimButton: React.FC<ClaimButtoProps> = ({
269
277
< Skeleton as = "span" isLoaded = { ! isLoading } >
270
278
{ isLoading ? "00" : numberTotal }
271
279
</ Skeleton > { " " }
272
- claimed
280
+ minted
273
281
</ Text >
274
282
</ Stack >
275
283
) ;
0 commit comments