From c0fab4f170ef8f60b114083fb69491d29393fa24 Mon Sep 17 00:00:00 2001 From: Hossein Date: Sun, 11 Dec 2022 11:11:21 +0330 Subject: [PATCH 1/2] Fix price change in overview & market stats --- .../components/AllMarketInfoCard/AllMarketInfoCard.js | 6 +++--- .../components/AllMarketInfoTable/AllMarketInfoTable.js | 8 +++----- .../components/MostDecreasedPrice/MostDecreasedPrice.js | 6 +++--- .../components/MostIncreasedPrice/MostIncreasedPrice.js | 6 +++--- .../AllMarketContent/components/VolumeInfo/VolumeInfo.js | 5 ++--- .../VolumeInfo/components/MostTrades/MostTrades.js | 2 +- .../VolumeInfo/components/MostVolume/MostVolume.js | 8 ++++---- .../LandingContent/components/GeneralInfo/GeneralInfo.js | 6 +++--- .../components/MarketInfoCard/MarketInfoCard.js | 6 +++--- .../components/MarketInfoTable/MarketInfoTable.js | 6 ++---- .../LandingContent/components/MarketView/MarketView.js | 4 ++-- .../components/MostDecreasedPrice/MostDecreasedPrice.js | 4 ++-- .../components/MostIncreasedPrice/MostIncreasedPrice.js | 4 ++-- .../MarketView/components/MostVolume/MostVolume.js | 4 ++-- 14 files changed, 35 insertions(+), 40 deletions(-) diff --git a/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/AllMarketInfo/components/AllMarketInfoCard/AllMarketInfoCard.js b/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/AllMarketInfo/components/AllMarketInfoCard/AllMarketInfoCard.js index e9131f26..e93a35b4 100644 --- a/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/AllMarketInfo/components/AllMarketInfoCard/AllMarketInfoCard.js +++ b/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/AllMarketInfo/components/AllMarketInfoCard/AllMarketInfoCard.js @@ -50,7 +50,7 @@ const AllMarketInfoCard = ({data, activeCurrency}) => { {data.map((tr, index) => { return ( -
MouseEnterEventHandler(index)} onMouseLeave={MouseLeaveEventHandler}>
@@ -61,13 +61,13 @@ const AllMarketInfoCard = ({data, activeCurrency}) => { {activeCurrency ? t("currency." + tr?.base) : tr?.base + " / " + tr?.quote}
- 0 ? "text-green" : "text-red"} direction-ltr mr-05`}>{new BN(tr.priceChange).toFormat()} % + 0 ? "text-green" : "text-red"} direction-ltr mr-05`}>{new BN(tr.priceChangePercent).toFormat(2)} %
{t("MarketInfo.lastPrice")}: - 0 ? "text-green" : "text-red"} fs-01`}>{new BN(tr.lastPrice).toFormat()} {t("currency." + tr?.quote)} + 0 ? "text-green" : "text-red"} fs-01`}>{new BN(tr.lastPrice).toFormat()} {t("currency." + tr?.quote)}
{t("MarketInfo.lowPrice")}: diff --git a/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/AllMarketInfo/components/AllMarketInfoTable/AllMarketInfoTable.js b/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/AllMarketInfo/components/AllMarketInfoTable/AllMarketInfoTable.js index c76ed5f3..878ea143 100644 --- a/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/AllMarketInfo/components/AllMarketInfoTable/AllMarketInfoTable.js +++ b/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/AllMarketInfo/components/AllMarketInfoTable/AllMarketInfoTable.js @@ -12,8 +12,6 @@ import {useDispatch, useSelector} from "react-redux"; const AllMarketInfTable = ({data, activeCurrency}) => { - console.log("data" , data) - const {t} = useTranslation(); const navigate = useNavigate(); const dispatch = useDispatch(); @@ -28,7 +26,7 @@ const AllMarketInfTable = ({data, activeCurrency}) => { let head = (
{t("MarketInfo.name")} - {t("MarketInfo.lastPrice")} + {t("MarketInfo.lastPrice")} {t("MarketInfo.priceChange")} {t("MarketInfo.lowPrice")} {t("MarketInfo.highPrice")} @@ -51,10 +49,10 @@ const AllMarketInfTable = ({data, activeCurrency}) => { title={tr?.base} className={`img-md-plus ml-05`}/> {activeCurrency ? t("currency." + tr?.base) : tr?.base + " / " + tr?.quote} - 0 ? "text-green" : "text-red"}`}>{new BN(tr.lastPrice).toFormat()} {t("currency." + tr?.quote)} + 0 ? "text-green" : "text-red"}`}>{new BN(tr.lastPrice).toFormat()} {t("currency." + tr?.quote)} - 0 ? "text-green" : "text-red"} direction-ltr`}>{new BN(tr?.priceChange).toFormat()} % + 0 ? "text-green" : "text-red"} direction-ltr`}>{new BN(tr?.priceChangePercent).toFormat(2)} % {new BN(tr?.lowPrice).toFormat()} {new BN(tr?.highPrice).toFormat()} diff --git a/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/PriceInfo/components/MostDecreasedPrice/MostDecreasedPrice.js b/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/PriceInfo/components/MostDecreasedPrice/MostDecreasedPrice.js index e538af2d..7d2415e3 100644 --- a/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/PriceInfo/components/MostDecreasedPrice/MostDecreasedPrice.js +++ b/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/PriceInfo/components/MostDecreasedPrice/MostDecreasedPrice.js @@ -15,12 +15,12 @@ const MostDecreasedPrice = ({mostDecreasedPrice}) => { title={mostDecreasedPrice?.pairInfo?.baseAsset} className={`img-md-plus`}/> {t("currency." + mostDecreasedPrice?.pairInfo?.baseAsset)} -
+
{mostDecreasedPrice?.pairInfo?.quoteAsset} {new BN(mostDecreasedPrice?.lastPrice).toFormat()}
-
- {new BN(mostDecreasedPrice?.priceChangePercent).toFormat(2)} % +
+ 0 ? "text-green" : "text-red"} direction-ltr`}>{new BN(mostDecreasedPrice?.priceChangePercent).toFormat(2)} %
); diff --git a/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/PriceInfo/components/MostIncreasedPrice/MostIncreasedPrice.js b/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/PriceInfo/components/MostIncreasedPrice/MostIncreasedPrice.js index 3c824d93..f64b7c50 100644 --- a/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/PriceInfo/components/MostIncreasedPrice/MostIncreasedPrice.js +++ b/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/PriceInfo/components/MostIncreasedPrice/MostIncreasedPrice.js @@ -15,12 +15,12 @@ const MostIncreasedPrice = ({mostIncreasedPrice}) => { title={mostIncreasedPrice?.pairInfo?.baseAsset} className={`img-md-plus`}/> {t("currency." + mostIncreasedPrice?.pairInfo?.baseAsset)} -
+
{mostIncreasedPrice?.pairInfo?.quoteAsset} {new BN(mostIncreasedPrice?.lastPrice).toFormat()}
-
- % {new BN(mostIncreasedPrice?.priceChangePercent).toFormat(2)}+ +
+ 0 ? "text-green" : "text-red"} direction-ltr`}>{new BN(mostIncreasedPrice?.priceChangePercent).toFormat(2)} %
); diff --git a/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/VolumeInfo/VolumeInfo.js b/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/VolumeInfo/VolumeInfo.js index d6511dd1..abd5e806 100644 --- a/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/VolumeInfo/VolumeInfo.js +++ b/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/VolumeInfo/VolumeInfo.js @@ -17,13 +17,12 @@ const VolumeInfo = () => { const interval = useSelector((state) => state.global.marketInterval) const {data:stats, isLoading, error} = useGetMarketStats(interval) const allSymbols = useSelector((state) => state.exchange.symbols) - const mostDecreasedPrice = stats?.mostDecreasedPrice[0] const mostVolume = stats?.mostVolume const mostTrades = stats?.mostTrades if(!isLoading && !error && mostVolume) { - mostVolume.pairInfo = allSymbols.find(s => s.symbol === (mostDecreasedPrice?.symbol)) - mostTrades.pairInfo = allSymbols.find(s => s.symbol === (mostDecreasedPrice?.symbol)) + mostVolume.pairInfo = allSymbols.find(s => s.symbol === (mostVolume?.symbol)) + mostTrades.pairInfo = allSymbols.find(s => s.symbol === (mostTrades?.symbol)) } const mostVolumeContent = () => { diff --git a/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/VolumeInfo/components/MostTrades/MostTrades.js b/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/VolumeInfo/components/MostTrades/MostTrades.js index 70051aab..270276aa 100644 --- a/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/VolumeInfo/components/MostTrades/MostTrades.js +++ b/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/VolumeInfo/components/MostTrades/MostTrades.js @@ -15,7 +15,7 @@ const MostTrades = ({mostTrades}) => { title={mostTrades?.pairInfo?.baseAsset} className={`img-md-plus`}/> {t("currency." + mostTrades?.pairInfo?.baseAsset)} -
+
{new BN(mostTrades?.tradeCount).toFormat()}
diff --git a/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/VolumeInfo/components/MostVolume/MostVolume.js b/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/VolumeInfo/components/MostVolume/MostVolume.js index 42e403a8..064b1f1c 100644 --- a/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/VolumeInfo/components/MostVolume/MostVolume.js +++ b/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/VolumeInfo/components/MostVolume/MostVolume.js @@ -15,12 +15,12 @@ const MostVolume = ({mostVolume}) => { title={mostVolume?.pairInfo?.baseAsset} className={`img-md-plus`}/> {t("currency." + mostVolume?.pairInfo?.baseAsset)} -
- {mostVolume?.pairInfo?.quoteAsset} +
+ {mostVolume?.pairInfo?.baseAsset} {new BN(mostVolume?.volume).toFormat()}
-
- % {new BN(mostVolume?.change).toFormat(2)}+ +
+ 0 ? "text-green" : "text-red"} direction-ltr`}>{new BN(mostVolume?.change).toFormat(2)} %
); diff --git a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/GeneralInfo/GeneralInfo.js b/src/main/Browser/Pages/Landing/Sections/LandingContent/components/GeneralInfo/GeneralInfo.js index 8996a9f4..e2588e0c 100644 --- a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/GeneralInfo/GeneralInfo.js +++ b/src/main/Browser/Pages/Landing/Sections/LandingContent/components/GeneralInfo/GeneralInfo.js @@ -17,15 +17,15 @@ const GeneralInfo = () => { if (error) return else return <>
- {data.activeUsers} + {data.activeUsers.toLocaleString()} {t("GeneralInfo.activeUsers")}
- {data.totalOrders} + {data.totalOrders.toLocaleString()} {t("GeneralInfo.totalOrders")}
- {data.totalTrades} + {data.totalTrades.toLocaleString()} {t("GeneralInfo.totalTrades")}
diff --git a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketInfo/components/MarketInfoCard/MarketInfoCard.js b/src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketInfo/components/MarketInfoCard/MarketInfoCard.js index a14c6c8e..8bae6cbd 100644 --- a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketInfo/components/MarketInfoCard/MarketInfoCard.js +++ b/src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketInfo/components/MarketInfoCard/MarketInfoCard.js @@ -36,18 +36,18 @@ const MarketInfoCard = ({data, activeCurrency}) => {
{data.map((tr, index) => { return ( -
navigateToPanel(tr.symbol)}> +
navigateToPanel(tr.symbol)}>
{tr?.base}
{activeCurrency ? t("currency." + tr?.base) : tr?.base + " / " + tr?.quote} 0 ? "text-green" : "text-red"} direction-ltr`}>{new BN(tr.priceChange).toFormat()} % + className={`${tr.priceChangePercent > 0 ? "text-green" : "text-red"} direction-ltr`}>{new BN(tr.priceChangePercent).toFormat(2)} %
0 ? "text-green" : "text-red"} fs-02`}>{new BN(tr.lastPrice).toFormat()} {t("currency." + tr?.quote)} + className={`${tr.priceChangePercent > 0 ? "text-green" : "text-red"} fs-02`}>{new BN(tr.lastPrice).toFormat()} {t("currency." + tr?.quote)}
{t("MarketInfo.volume")}: {new BN(tr.volume).toFormat()} diff --git a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketInfo/components/MarketInfoTable/MarketInfoTable.js b/src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketInfo/components/MarketInfoTable/MarketInfoTable.js index fed08581..d6314837 100644 --- a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketInfo/components/MarketInfoTable/MarketInfoTable.js +++ b/src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketInfo/components/MarketInfoTable/MarketInfoTable.js @@ -11,8 +11,6 @@ import {useNavigate} from "react-router-dom"; const MarketInfoTable = ({data, activeCurrency}) => { - console.log("data" , data) - const {t} = useTranslation(); const navigate = useNavigate(); const dispatch = useDispatch(); @@ -44,8 +42,8 @@ const MarketInfoTable = ({data, activeCurrency}) => { title={tr?.base} className={`img-lg ml-05`}/> {activeCurrency ? t("currency." + tr?.base) : tr?.base + " / " + tr?.quote} - 0 ? "text-green" : "text-red"}`}>{new BN(tr.lastPrice).toFormat()} {t("currency." + tr?.quote)} - 0 ? "text-green" : "text-red"} direction-ltr`}>{new BN(tr.priceChange).toFormat()} % + 0 ? "text-green" : "text-red"}`}>{new BN(tr.lastPrice).toFormat()} {t("currency." + tr?.quote)} + 0 ? "text-green" : "text-red"} direction-ltr`}>{new BN(tr.priceChangePercent).toFormat(2)} % {new BN(tr.volume).toFormat()} { if (!isLoading && !error && mostIncreasedPrice) { mostIncreasedPrice.pairInfo = allSymbols.find(s => s.symbol === (mostIncreasedPrice?.symbol)) mostDecreasedPrice.pairInfo = allSymbols.find(s => s.symbol === (mostDecreasedPrice?.symbol)) - mostVolume.pairInfo = allSymbols.find(s => s.symbol === (mostDecreasedPrice?.symbol)) - mostTrades.pairInfo = allSymbols.find(s => s.symbol === (mostDecreasedPrice?.symbol)) + mostVolume.pairInfo = allSymbols.find(s => s.symbol === (mostVolume?.symbol)) + mostTrades.pairInfo = allSymbols.find(s => s.symbol === (mostTrades?.symbol)) } diff --git a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketView/components/MostDecreasedPrice/MostDecreasedPrice.js b/src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketView/components/MostDecreasedPrice/MostDecreasedPrice.js index 29eda234..db97b3cd 100644 --- a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketView/components/MostDecreasedPrice/MostDecreasedPrice.js +++ b/src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketView/components/MostDecreasedPrice/MostDecreasedPrice.js @@ -22,12 +22,12 @@ const MostDecreasedPrice = ({mostDecreasedPrice}) => { /> {t("currency." + mostDecreasedPrice.pairInfo.baseAsset)}
-
+
{mostDecreasedPrice.pairInfo.quoteAsset} {new BN(mostDecreasedPrice?.lastPrice).toFormat()}
- {new BN(mostDecreasedPrice?.priceChangePercent).toFormat(2)} % + 0 ? "text-green" : "text-red"} direction-ltr`}>{new BN(mostDecreasedPrice?.priceChangePercent).toFormat(2)} %
diff --git a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketView/components/MostIncreasedPrice/MostIncreasedPrice.js b/src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketView/components/MostIncreasedPrice/MostIncreasedPrice.js index 6143afd1..6e02ffcc 100644 --- a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketView/components/MostIncreasedPrice/MostIncreasedPrice.js +++ b/src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketView/components/MostIncreasedPrice/MostIncreasedPrice.js @@ -22,12 +22,12 @@ const MostIncreasedPrice = ({mostIncreasedPrice}) => { /> {t("currency." + mostIncreasedPrice.pairInfo.baseAsset)}
-
+
{mostIncreasedPrice.pairInfo.quoteAsset} {new BN(mostIncreasedPrice?.lastPrice).toFormat()}
- % {new BN(mostIncreasedPrice?.priceChangePercent).toFormat(2)}+ + 0 ? "text-green" : "text-red"} direction-ltr`}>{new BN(mostIncreasedPrice?.priceChangePercent).toFormat(2)} %
diff --git a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketView/components/MostVolume/MostVolume.js b/src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketView/components/MostVolume/MostVolume.js index 2e77a580..c9650baf 100644 --- a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketView/components/MostVolume/MostVolume.js +++ b/src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketView/components/MostVolume/MostVolume.js @@ -24,10 +24,10 @@ const MostVolume = ({mostVolume}) => {
- {mostVolume.pairInfo.quoteAsset} + {mostVolume.pairInfo.baseAsset} {new BN(mostVolume?.volume).toFormat()}
- % {new BN(mostVolume?.change).toFormat(2)}+ + 0 ? "text-green" : "text-red"} direction-ltr`}>{new BN(mostVolume?.change).toFormat(2)} %
From c7de39b8ba18491e43864302166860ab56f3c821 Mon Sep 17 00:00:00 2001 From: Hossein Date: Sun, 11 Dec 2022 11:22:00 +0330 Subject: [PATCH 2/2] Add version number --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6e00e93b..2f6a96f1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "opex", - "version": "v1.0.2-beta.9", + "version": "v1.0.2-beta.10", "homepage": "", "private": true, "dependencies": {