Skip to content

Commit

Permalink
Fix max button on stake modal for dragons syrup
Browse files Browse the repository at this point in the history
  • Loading branch information
totop716 committed Feb 6, 2022
1 parent 105e0c1 commit 684a152
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/components/StakeSyrupModal/StakeSyrupModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,7 @@ const StakeSyrupModal: React.FC<StakeSyrupModalProps> = ({
cursor: 'pointer',
}}
onClick={() => {
setTypedValue(
maxAmountInput ? maxAmountInput.toSignificant() : '0',
);
setTypedValue(maxAmountInput ? maxAmountInput.toExact() : '0');
setStakePercent(100);
}}
>
Expand All @@ -232,11 +230,12 @@ const StakeSyrupModal: React.FC<StakeSyrupModalProps> = ({
setStakePercent(value as number);
setTypedValue(
maxAmountInput
? (
(Number(maxAmountInput.toSignificant()) *
stakePercent) /
100
).toFixed(8)
? stakePercent < 100
? (
(Number(maxAmountInput.toExact()) * stakePercent) /
100
).toString()
: maxAmountInput.toExact()
: '0',
);
}}
Expand Down

0 comments on commit 684a152

Please sign in to comment.