diff --git a/src/components/Popup/Popup.js b/src/components/Popup/Popup.js index 16038f1b..b844d591 100644 --- a/src/components/Popup/Popup.js +++ b/src/components/Popup/Popup.js @@ -11,6 +11,8 @@ import {useGetCurrencyInfo} from "../../queries"; import Loading from "../Loading/Loading"; import Error from "../Error/Error"; import PopupAddress from "./PopupAddress/PopupAddress"; +import i18n from "i18next"; +import {getCurrencyNameOrAlias} from "../../utils/utils"; const Popup = ({currency, closePopup}) => { @@ -18,6 +20,8 @@ const Popup = ({currency, closePopup}) => { const isLogin = useSelector((state) => state.auth.isLogin) + const language = i18n.language + const currencies = useSelector((state) => state.exchange.currencies) const [networkName, setNetworkName] = useState({value: 0, error: []}); @@ -75,7 +79,7 @@ const Popup = ({currency, closePopup}) => { return (
{t("MarketInfo.lastPrice")}{" "} {t("currency." + selected?.buy)}:
- {showBestPrice()}{" "}{t("currency." + selected?.sell)} +{t("MarketInfo.lastPrice")}{" "} {getCurrencyNameOrAlias(currencies[selected?.buy], language)}:
+ {showBestPrice()}{" "}{ getCurrencyNameOrAlias(currencies[selected?.sell], language)}{t("orders.availableAmount")}:{" "}
{new BN(userAccount?.wallets[selected?.sell]?.free || 0).toFormat()}{" "}{t("currency." + selected?.sell)} + onClick={fillBuyByWallet}>{new BN(userAccount?.wallets[selected?.sell]?.free || 0).decimalPlaces(currencies[selected?.sell]?.precision ?? 0).toFormat()}{" "}{getCurrencyNameOrAlias(currencies[selected?.sell], language)}{t("myOrders.tradedAmount")} :{" "} - {executedQty.decimalPlaces(activePair.baseAssetPrecision).toFormat()} + {executedQty.decimalPlaces(currencies[activePair.baseAsset].precision).toFormat()}
{t("myOrders.tradedPrice")} :{" "} - {executedQty.multipliedBy(pricePerUnit).decimalPlaces(activePair.baseAssetPrecision).toFormat()} + {executedQty.multipliedBy(pricePerUnit).decimalPlaces(currencies[activePair.baseAsset].precision).toFormat()}
{t("myOrders.orderId")} : {tr.orderId}
- {t("commission")} : {new BN(tr.commission).toFormat()} {t("currency." + tr.commissionAsset.toUpperCase())} + {t("commission")} : {new BN(tr.commission).decimalPlaces(currencies[tr.commissionAsset.toUpperCase()].precision).toFormat()} + {getCurrencyNameOrAlias(currencies[tr.commissionAsset.toUpperCase()], language)}
{ @@ -283,7 +293,7 @@ const BuyOrder = () => { }}> {t("orders.bestOffer")}:{" "} - {new BN(bestBuyPrice).toFormat()}{" "}{t("currency." + activePair.quoteAsset)} + {new BN(bestBuyPrice).toFormat()}{" "}{getCurrencyNameOrAlias(currencies[activePair.quoteAsset], language)}
@@ -313,9 +323,9 @@ const BuyOrder = () => {{t("orders.tradeFee")}:{" "} {order.tradeFee.toFormat()}{" "} - {t("currency." + activePair.baseAsset)} + {getCurrencyNameOrAlias(currencies[activePair.baseAsset], language)}
{t("orders.getAmount")}:{" "} - {order.reqAmount.minus(order.tradeFee).decimalPlaces(activePair.baseAssetPrecision).toFormat()}{" "} - {t("currency." + activePair.baseAsset)} + {order.reqAmount.minus(order.tradeFee).decimalPlaces(currencies[activePair.baseAsset].precision).toFormat()}{" "} + {getCurrencyNameOrAlias(currencies[activePair.baseAsset], language)}