Skip to content

Commit

Permalink
chore: update ui
Browse files Browse the repository at this point in the history
  • Loading branch information
camewell071 committed Jan 17, 2024
1 parent a3c89cb commit 7597c75
Showing 1 changed file with 31 additions and 23 deletions.
54 changes: 31 additions & 23 deletions src/modules/Whitelist/HistoryMessage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,43 @@ import useFormatAllowBTC from '@/modules/Whitelist/HistoryMessage/useFormatAllow
const HistoryMessage = () => {
const { loaded, status, isProcessing, amount } = useFormatAllowBTC()

if (!loaded || !status.length) return <></>;
console.log('SANG TEST: ', { loaded, status, isProcessing, amount });
const renderContent = React.useCallback(() => {
if (!loaded || !status.length) return <></>;
if (isProcessing) {
return (
<Flex className={styles.container}>
<Loading />
<p>Wallet verification in progress!</p>
<p>You're in the queue. Please give us a few minutes to process.</p>
<p>Thanks for your patience!</p>
</Flex>
)
}

if (isProcessing) {
return (
<Flex className={styles.container}>
<Loading />
<p>Wallet verification in progress!</p>
<p>You're in the queue. Please give us a few minutes to process.</p>
<p>Thanks for your patience!</p>
<Flex className={cs(styles.container, {
[styles.container__congrats as string]: !!amount.txsCount
})}>
{amount.txsCount ? (
<Flex flexDirection="column" w="100%" alignItems="center">
<p>You've spent <span>{formatCurrency(amount.fee, 0)} BTC</span> for gas fees across <span>{formatCurrency(amount.txsCount, 0)} transactions</span></p>
<p>Congratulations, you've earned <span>{formatCurrency(amount.point, 0)} points</span></p>
<Button onClick={() => shareTwitterSignature({ fee: amount.fee, point: amount.point, txsCount: amount.txsCount })}>Share now</Button>
</Flex>
) : (
<p>
No transactions found. Please connect another wallet and try again.
</p>
)}
</Flex>
)
}
}, [loaded, status, isProcessing, amount]);

return (
<Flex className={cs(styles.container, {
[styles.container__congrats as string]: !!amount.txsCount
})}>
{amount.txsCount ? (
<Flex flexDirection="column" w="100%" alignItems="center">
<p>You've spent <span>{formatCurrency(amount.fee, 0)} BTC</span> for gas fees across <span>{formatCurrency(amount.txsCount, 0)} transactions</span></p>
<p>Congratulations, you've earned <span>{formatCurrency(amount.point, 0)} points</span></p>
<Button onClick={() => shareTwitterSignature({ fee: amount.fee, point: amount.point, txsCount: amount.txsCount })}>Share now</Button>
</Flex>
) : (
<p>
No transactions found. Please connect another wallet and try again.
</p>
)}
</Flex>
<>
{renderContent()}
</>
)
}

Expand Down

0 comments on commit 7597c75

Please sign in to comment.