1
- import {
2
- Button as ButtonOg ,
3
- Paragraph ,
4
- Spinner ,
5
- type ButtonProps ,
6
- YStack ,
7
- useToastController ,
8
- } from '@my/ui'
1
+ import { Button as ButtonOg , Spinner , type ButtonProps , YStack , useToastController } from '@my/ui'
9
2
import { baseMainnet , type sendMerkleDropAddress } from '@my/wagmi'
10
3
import { useQueryClient } from '@tanstack/react-query'
11
4
import { IconDollar } from 'app/components/icons'
@@ -197,24 +190,21 @@ export const DistributionClaimButton = ({ distribution }: DistributionsClaimButt
197
190
198
191
if ( ! isEligible ) return null
199
192
200
- // If the user is eligible but has already claimed, show the claim button disabled
201
- if ( isClaimed ) {
202
- return (
203
- < Paragraph size = "$3" color = "$color12" mx = "auto" >
204
- Claimed
205
- </ Paragraph >
206
- )
207
- }
208
193
// If the user is eligible and the tranche is active, show the claim button
209
194
return (
210
195
< YStack >
211
196
< Button
212
- theme = { canClaim ? 'green' : error || hasEnoughGas ? 'red_active' : undefined }
197
+ theme = { canClaim || isClaimed ? 'green' : error || ! hasEnoughGas ? 'red_active' : 'alt1' }
213
198
onPress = { onSubmit }
214
199
br = { 12 }
215
200
disabledStyle = { { opacity : 0.7 , cursor : 'not-allowed' , pointerEvents : 'none' } }
216
201
disabled = {
217
- ! canClaim || isClaimPending || ! ! sentTxHash || ! ! feesPerGasError || ! ! usdcFeesError
202
+ ! canClaim ||
203
+ isClaimPending ||
204
+ ! ! sentTxHash ||
205
+ ! ! feesPerGasError ||
206
+ ! ! usdcFeesError ||
207
+ isClaimed
218
208
}
219
209
gap = { 4 }
220
210
maw = { 194 }
@@ -235,27 +225,27 @@ export const DistributionClaimButton = ({ distribution }: DistributionsClaimButt
235
225
< Spinner size = "small" color = "$color12" />
236
226
</ ButtonOg . Icon >
237
227
)
238
- case ! isTrancheActive :
239
- return (
240
- < ButtonOg . Text opacity = { 0.5 } disabled >
241
- Not yet claimable
242
- </ ButtonOg . Text >
243
- )
244
- case ! ! isTrancheActiveError || ! ! isClaimedError || ! ! nonceError :
245
- return (
246
- < >
247
- < ButtonOg . Text opacity = { 0.5 } > Error</ ButtonOg . Text >
248
- </ >
249
- )
250
- case ! ! feesPerGasError || ! ! usdcFeesError :
228
+ case isClaimed :
251
229
return (
252
230
< >
253
231
< ButtonOg . Icon >
254
- < IconDollar size = { '$2 .5' } />
232
+ < IconDollar color = "$black" size = { '$1 .5' } />
255
233
</ ButtonOg . Icon >
256
- < ButtonOg . Text > Claim Reward </ ButtonOg . Text >
234
+ < ButtonOg . Text > Claimed </ ButtonOg . Text >
257
235
</ >
258
236
)
237
+ case ! isTrancheActive :
238
+ return (
239
+ < ButtonOg . Text opacity = { 0.5 } disabled >
240
+ Not yet claimable
241
+ </ ButtonOg . Text >
242
+ )
243
+ case ! ! isTrancheActiveError ||
244
+ ! ! isClaimedError ||
245
+ ! ! nonceError ||
246
+ ! ! feesPerGasError ||
247
+ ! ! usdcFeesError :
248
+ return < ButtonOg . Text opacity = { 0.5 } > Error</ ButtonOg . Text >
259
249
case isClaimPending && ! isClaimError :
260
250
return (
261
251
< >
0 commit comments