Skip to content

Commit

Permalink
GSM-471 add enter all amount avalidate for withdraw modal
Browse files Browse the repository at this point in the history
  • Loading branch information
lephuochoai committed Dec 19, 2023
1 parent d566b8e commit 644708e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,10 @@ export const WithdrawContent = styled.div`
${fonts.p2}
}
}
.balance-text {
cursor: pointer;
}
`;

export const BoxFromTo = styled.div`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ const WithDrawModal: React.FC<Props> = ({
const currentAvailableBalance =
displayBalanceMap?.[withdrawInfo?.path ?? ""] ?? null;

const handleEnterAllBalanceAvailable = () => {
if (currentAvailableBalance) {
setAmount(currentAvailableBalance);
}
};

if (isConfirm) {
return <WithdrawStatus withdrawResult={result} close={onCancelConfirm} />;
}
Expand Down Expand Up @@ -179,7 +185,10 @@ const WithDrawModal: React.FC<Props> = ({
<span className="price-text">
{!Number(amount) ? "-" : `$${amount}`}
</span>
<span className="balance-text">{`Available: ${
<span
className="balance-text"
onClick={handleEnterAllBalanceAvailable}
>{`Available: ${
currentAvailableBalance
? BigNumber(currentAvailableBalance).toFormat()
: "-"
Expand Down

0 comments on commit 644708e

Please sign in to comment.