From b73878ead0794c444e041c83c0321582a56c243b Mon Sep 17 00:00:00 2001 From: Samus <26967164+SamusElderg@users.noreply.github.com> Date: Mon, 23 Nov 2020 15:01:25 +0800 Subject: [PATCH] #298 show swap ui zero balance closes #298 --- src/components/Sections/TradePaneBuy.js | 98 +++++++++++++------------ 1 file changed, 51 insertions(+), 47 deletions(-) diff --git a/src/components/Sections/TradePaneBuy.js b/src/components/Sections/TradePaneBuy.js index a56f611..f7276b9 100644 --- a/src/components/Sections/TradePaneBuy.js +++ b/src/components/Sections/TradePaneBuy.js @@ -55,53 +55,57 @@ export const TradePaneBuy = (props) => { // OUTPUT | {output} // INPUT | {input} */} - {props.tradeData.balance > 0 && - - -
{props.t("Rate")}
- Estimated output rate (after fees and slippage) - -
{props.tradeData.estRate} SPARTA*
- - - -
{props.t("Rate Slip")}
- Estimated rate slip; the difference between spot price and the rate you are getting after slippage & fees. -
- - - -
{`${((props.tradeData.actualSlip) * 100).toFixed(3)}%`}*
-
- - - - -
{props.t("Fee")}
- Estimated pool fee for the swap. This fee is awarded to liquidity providers' pool holdings to incentivize deeper pools over time. - -
{formatGranularUnits(convertFromWei(props.tradeData.fee))} {props.tradeData.outputSymbol}*
- - - -
{props.t("Slip")}
- Estimated pool price slip; the difference between asset's price in the pool before/after this swap. - -
{`${((props.tradeData.slip) * 100).toFixed(3)}%`}*
- -
- - -
{props.t("Output")}
- Estimated final output from this swap. - -
{formatAllUnits(convertFromWei(props.tradeData.output))} {props.tradeData.outputSymbol}*
- -
- -

Estimated*

-
- } + + +
{props.t("Input")}
+ Estimated input amount + +
{formatAllUnits(convertFromWei(props.tradeData.input))} {props.tradeData.symbol}*
+ + +
{props.t("Rate")}
+ Estimated output rate (after fees and slippage) + +
{props.tradeData.estRate} SPARTA*
+ + + +
{props.t("Rate Slip")}
+ Estimated rate slip; the difference between spot price and the rate you are getting after slippage & fees. +
+ + + +
{`${((props.tradeData.actualSlip) * 100).toFixed(3)}%`}*
+
+ + + + +
{props.t("Fee")}
+ Estimated pool fee for the swap. This fee is awarded to liquidity providers' pool holdings to incentivize deeper pools over time. + +
{formatGranularUnits(convertFromWei(props.tradeData.fee))} {props.tradeData.outputSymbol}*
+ + + +
{props.t("Slip")}
+ Estimated pool price slip; the difference between asset's price in the pool before/after this swap. + +
{`${((props.tradeData.slip) * 100).toFixed(3)}%`}*
+ +
+ + +
{props.t("Output")}
+ Estimated final output from this swap. + +
{formatAllUnits(convertFromWei(props.tradeData.output))} {props.tradeData.outputSymbol}*
+ +
+ +

Estimated*

+
{props.tradeData.balance <= 0 && props.tradeData.symbol !== 'XXX' &&
You have no {props.tradeData.symbol} in your wallet.