@@ -2,7 +2,7 @@ import { Trans } from '@lingui/macro'
22import { NetworkIcon , TokenIcon } from '@masknet/shared'
33import { NetworkPluginID } from '@masknet/shared-base'
44import { makeStyles } from '@masknet/theme'
5- import { formatBalance , type FungibleToken } from '@masknet/web3-shared-base'
5+ import { formatBalance , isZero , type FungibleToken } from '@masknet/web3-shared-base'
66import { type ChainId , type SchemaType } from '@masknet/web3-shared-evm'
77import { Typography } from '@mui/material'
88import type { HTMLProps } from 'react'
@@ -160,6 +160,7 @@ export function RedPacketEnvelope({
160160 ...props
161161} : Props ) {
162162 const { classes, cx } = useStyles ( )
163+ const claimedZero = isZero ( claimedAmount )
163164 return (
164165 < div { ...props } className = { cx ( classes . container , props . className ) } >
165166 < img src = { cover } className = { classes . cover } />
@@ -181,18 +182,25 @@ export function RedPacketEnvelope({
181182 chainId = { token . chainId }
182183 />
183184 </ div >
184- < Typography className = { classes . amount } >
185- { isClaimed ?
186- formatBalance ( claimedAmount , token . decimals )
187- : `${ formatBalance ( totalClaimed , token . decimals ) } / ${ formatBalance ( total , token . decimals ) } `
188- } { ' ' }
189- { token . symbol }
190- </ Typography >
185+ { isClaimed ?
186+ < Typography className = { classes . amount } >
187+ { claimedZero ?
188+ < Trans > You have already claimed this lucky drop.</ Trans >
189+ : `${ formatBalance ( claimedAmount , token . decimals ) } ${ token . symbol } ` }
190+ </ Typography >
191+ : < Typography className = { classes . amount } >
192+ { `${ formatBalance ( totalClaimed , token . decimals ) } / ${ formatBalance ( total , token . decimals ) } ` }
193+ { token . symbol }
194+ </ Typography >
195+ }
191196 < div className = { classes . status } >
192197 { isClaimed ?
193- < Typography className = { classes . statusText } >
194- < Trans > Congratulations!</ Trans >
195- </ Typography >
198+ claimedZero ?
199+ null
200+ : < Typography className = { classes . statusText } >
201+ < Trans > Congratulations!</ Trans >
202+ </ Typography >
203+
196204 : isEmpty ?
197205 < >
198206 < div className = { classes . bar } >
0 commit comments