Skip to content

Commit

Permalink
Merge pull request #77 from QuickSwap/issue/fix-frontend-3
Browse files Browse the repository at this point in the history
Fix frontend issues
  • Loading branch information
totop716 authored Feb 6, 2022
2 parents 105e0c1 + 8f228eb commit 72397d9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 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
2 changes: 1 addition & 1 deletion src/components/SyrupCard/SyrupCardDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const SyrupCardDetails: React.FC<{ token: Token }> = ({ token }) => {
);

const syrupEarnedUSD =
Number(syrup?.earnedAmount.toSignificant(2)) *
Number(syrup?.earnedAmount.toSignificant()) *
Number(syrup?.rewardTokenPriceinUSD ?? 0);

const exactEnd = syrup ? syrup.periodFinish : 0;
Expand Down

0 comments on commit 72397d9

Please sign in to comment.