Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "opex",
"version": "v1.0.2-beta.9",
"version": "v1.0.2-beta.10",
"homepage": "",
"private": true,
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const AllMarketInfoCard = ({data, activeCurrency}) => {

{data.map((tr, index) => {
return (
<div key={index} className={`${classes.item} card-border card-bg column cursor-pointer`} style={backgroundBar(tr.priceChange.toString())}
<div key={index} className={`${classes.item} card-border card-bg column cursor-pointer`} style={backgroundBar(tr.priceChangePercent.toString())}
onMouseEnter={()=>MouseEnterEventHandler(index)} onMouseLeave={MouseLeaveEventHandler}>
<div className={`column jc-between ai-center pt-2 pb-3`} style={{height:"80%"}}>
<div className={`row jc-between ai-center width-100 px-1`}>
Expand All @@ -61,13 +61,13 @@ const AllMarketInfoCard = ({data, activeCurrency}) => {
<span className={`fs-01`}>{activeCurrency ? t("currency." + tr?.base) : tr?.base + " / " + tr?.quote}</span>
</div>
<div className={`flex jc-end ai-center fs-0-6`}>
<span className={`${tr.priceChange > 0 ? "text-green" : "text-red"} direction-ltr mr-05`}>{new BN(tr.priceChange).toFormat()} %</span>
<span className={`${tr.priceChangePercent > 0 ? "text-green" : "text-red"} direction-ltr mr-05`}>{new BN(tr.priceChangePercent).toFormat(2)} %</span>
</div>
</div>
<div className={`column px-1 width-100 fs-0-7`}>
<div className={`row jc-between ai-center`}>
<span className={``}>{t("MarketInfo.lastPrice")}:</span>
<span className={`${tr.priceChange > 0 ? "text-green" : "text-red"} fs-01`}>{new BN(tr.lastPrice).toFormat()} <span className={`fs-0-7 mr-025`}>{t("currency." + tr?.quote)}</span></span>
<span className={`${tr.priceChangePercent > 0 ? "text-green" : "text-red"} fs-01`}>{new BN(tr.lastPrice).toFormat()} <span className={`fs-0-7 mr-025`}>{t("currency." + tr?.quote)}</span></span>
</div>
<div className={`row jc-between ai-center`}>
<span className={`text-gray`}>{t("MarketInfo.lowPrice")}:</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -28,7 +26,7 @@ const AllMarketInfTable = ({data, activeCurrency}) => {
let head = (
<div className="row text-gray px-2 py-2" style={{backgroundColor:"var(--tableHeader)"}}>
<span className="width-15 flex jc-start ai-center">{t("MarketInfo.name")}</span>
<span className="width-11 flex jc-start ai-center">{t("MarketInfo.lastPrice")}</span>
<span className="width-11 flex jc-start ai-center">{t("MarketInfo.lastPrice")}</span>
<span className="width-9 flex jc-start ai-center">{t("MarketInfo.priceChange")}</span>
<span className="width-12 flex jc-start ai-center">{t("MarketInfo.lowPrice")}</span>
<span className="width-12 flex jc-start ai-center">{t("MarketInfo.highPrice")}</span>
Expand All @@ -51,10 +49,10 @@ const AllMarketInfTable = ({data, activeCurrency}) => {
title={tr?.base} className={`img-md-plus ml-05`}/>
<span className={`fs-01 mr-05`}>{activeCurrency ? t("currency." + tr?.base) : tr?.base + " / " + tr?.quote}</span>
</span>
<span className={`width-11 flex jc-start ai-center ${tr?.priceChange > 0 ? "text-green" : "text-red"}`}>{new BN(tr.lastPrice).toFormat()} <span className={`fs-0-7 mr-05`}>{t("currency." + tr?.quote)}</span></span>
<span className={`width-11 flex jc-start ai-center ${tr?.priceChangePercent > 0 ? "text-green" : "text-red"}`}>{new BN(tr.lastPrice).toFormat()} <span className={`fs-0-7 mr-05`}>{t("currency." + tr?.quote)}</span></span>


<span className={`width-9 flex ${i18n.language !== "fa" ? 'jc-start' : 'jc-end'} ai-center ${tr?.priceChange > 0 ? "text-green" : "text-red"} direction-ltr`}>{new BN(tr?.priceChange).toFormat()} %</span>
<span className={`width-9 flex ${i18n.language !== "fa" ? 'jc-start' : 'jc-end'} ai-center ${tr?.priceChangePercent > 0 ? "text-green" : "text-red"} direction-ltr`}>{new BN(tr?.priceChangePercent).toFormat(2)} %</span>
<span className="width-12 flex jc-start ai-center">{new BN(tr?.lowPrice).toFormat()}</span>

<span className={`width-12 flex jc-start ai-center`}>{new BN(tr?.highPrice).toFormat()}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ const MostDecreasedPrice = ({mostDecreasedPrice}) => {
title={mostDecreasedPrice?.pairInfo?.baseAsset}
className={`img-md-plus`}/>
<span>{t("currency." + mostDecreasedPrice?.pairInfo?.baseAsset)}</span>
<div className={`${i18n.language !== "fa" ? 'row-reverse' : 'row'} jc-center ai-center width-100 text-red`}>
<div className={`${i18n.language !== "fa" ? 'row-reverse' : 'row'} jc-center ai-center width-100`}>
<span className={`${i18n.language !== "fa" ? 'mr-025' : 'ml-025'} fs-0-6`}>{mostDecreasedPrice?.pairInfo?.quoteAsset}</span>
<span className={`${i18n.language !== "fa" ? 'mL-025' : 'mr-025'} fs-01`}>{new BN(mostDecreasedPrice?.lastPrice).toFormat()}</span>
</div>
<div className={`row jc-center ai-center width-100 text-red`}>
<span className={`direction-ltr`}>{new BN(mostDecreasedPrice?.priceChangePercent).toFormat(2)} %</span>
<div className={`row jc-center ai-center width-100`}>
<span className={`${mostDecreasedPrice?.priceChangePercent > 0 ? "text-green" : "text-red"} direction-ltr`}>{new BN(mostDecreasedPrice?.priceChangePercent).toFormat(2)} %</span>
</div>
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ const MostIncreasedPrice = ({mostIncreasedPrice}) => {
title={mostIncreasedPrice?.pairInfo?.baseAsset}
className={`img-md-plus`}/>
<span>{t("currency." + mostIncreasedPrice?.pairInfo?.baseAsset)}</span>
<div className={`${i18n.language !== "fa" ? 'row-reverse' : 'row'} jc-center ai-center width-100 text-green`}>
<div className={`${i18n.language !== "fa" ? 'row-reverse' : 'row'} jc-center ai-center width-100`}>
<span className={`${i18n.language !== "fa" ? 'mr-025' : 'ml-025'} fs-0-6`}>{mostIncreasedPrice?.pairInfo?.quoteAsset}</span>
<span className={`${i18n.language !== "fa" ? 'mL-025' : 'mr-025'} fs-01`}>{new BN(mostIncreasedPrice?.lastPrice).toFormat()}</span>
</div>
<div className={`row jc-center ai-center width-100 text-green`}>
<span>% {new BN(mostIncreasedPrice?.priceChangePercent).toFormat(2)}+</span>
<div className={`row jc-center ai-center width-100`}>
<span className={`${mostIncreasedPrice?.priceChangePercent > 0 ? "text-green" : "text-red"} direction-ltr`}>{new BN(mostIncreasedPrice?.priceChangePercent).toFormat(2)} %</span>
</div>
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const MostTrades = ({mostTrades}) => {
title={mostTrades?.pairInfo?.baseAsset}
className={`img-md-plus`}/>
<span>{t("currency." + mostTrades?.pairInfo?.baseAsset)}</span>
<div className={`${i18n.language !== "fa" ? 'row-reverse' : 'row'} jc-center ai-center width-100 text-green`}>
<div className={`${i18n.language !== "fa" ? 'row-reverse' : 'row'} jc-center ai-center width-100`}>
<span className={`${i18n.language !== "fa" ? 'mL-025' : 'mr-025'} fs-01`}>{new BN(mostTrades?.tradeCount).toFormat()} </span>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ const MostVolume = ({mostVolume}) => {
title={mostVolume?.pairInfo?.baseAsset}
className={`img-md-plus`}/>
<span>{t("currency." + mostVolume?.pairInfo?.baseAsset)}</span>
<div className={`${i18n.language !== "fa" ? 'row-reverse' : 'row'} jc-center ai-center width-100 text-green`}>
<span className={`${i18n.language !== "fa" ? 'mr-025' : 'ml-025'} fs-0-6`}>{mostVolume?.pairInfo?.quoteAsset}</span>
<div className={`${i18n.language !== "fa" ? 'row-reverse' : 'row'} jc-center ai-center width-100`}>
<span className={`${i18n.language !== "fa" ? 'mr-025' : 'ml-025'} fs-0-6`}>{mostVolume?.pairInfo?.baseAsset}</span>
<span className={`${i18n.language !== "fa" ? 'mL-025' : 'mr-025'} fs-01`}>{new BN(mostVolume?.volume).toFormat()} </span>
</div>
<div className={`row jc-center ai-center width-100 text-green`}>
<span>% {new BN(mostVolume?.change).toFormat(2)}+</span>
<div className={`row jc-center ai-center width-100`}>
<span className={`${mostVolume?.change > 0 ? "text-green" : "text-red"} direction-ltr`}>{new BN(mostVolume?.change).toFormat(2)} %</span>
</div>
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ const GeneralInfo = () => {
if (error) return <span className={`width-100`}><Error/></span>
else return <>
<div className={`column jc-center ai-center`}>
<span className={`fs-02`}>{data.activeUsers} </span>
<span className={`fs-02`}>{data.activeUsers.toLocaleString()} </span>
<span className={`fs-0-7`}>{t("GeneralInfo.activeUsers")}</span>
</div>
<div className={`column jc-center ai-center`}>
<span className={`fs-02`}>{data.totalOrders} </span>
<span className={`fs-02`}>{data.totalOrders.toLocaleString()} </span>
<span className={`fs-0-7`}>{t("GeneralInfo.totalOrders")}</span>
</div>
<div className={`column jc-center ai-center`}>
<span className={`fs-02`}>{data.totalTrades} </span>
<span className={`fs-02`}>{data.totalTrades.toLocaleString()} </span>
<span className={`fs-0-7`}>{t("GeneralInfo.totalTrades")}</span>
</div>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@ const MarketInfoCard = ({data, activeCurrency}) => {
<div className={`${classes.container} my-3 px-1`}>
{data.map((tr, index) => {
return (
<div className={`${classes.item} card-border card-bg column jc-between ai-center py-3 cursor-pointer`} style={backgroundBar(tr.priceChange.toString())} key={index} onClick={() => navigateToPanel(tr.symbol)}>
<div className={`${classes.item} card-border card-bg column jc-between ai-center py-3 cursor-pointer`} style={backgroundBar(tr.priceChangePercent.toString())} key={index} onClick={() => navigateToPanel(tr.symbol)}>
<div className={`row jc-center ai-center width-100`}>
<img src={images[tr?.base]} alt={tr?.base}
title={tr?.base} className={`img-lg ml-05`}/>
<div className={`column mr-05`}>
<span className={`fs-01`}>{activeCurrency ? t("currency." + tr?.base) : tr?.base + " / " + tr?.quote}</span>
<span
className={`${tr.priceChange > 0 ? "text-green" : "text-red"} direction-ltr`}>{new BN(tr.priceChange).toFormat()} %</span>
className={`${tr.priceChangePercent > 0 ? "text-green" : "text-red"} direction-ltr`}>{new BN(tr.priceChangePercent).toFormat(2)} %</span>
</div>
</div>
<span
className={`${tr.priceChange > 0 ? "text-green" : "text-red"} fs-02`}>{new BN(tr.lastPrice).toFormat()} <span className={`fs-0-7 mr-05`}>{t("currency." + tr?.quote)}</span></span>
className={`${tr.priceChangePercent > 0 ? "text-green" : "text-red"} fs-02`}>{new BN(tr.lastPrice).toFormat()} <span className={`fs-0-7 mr-05`}>{t("currency." + tr?.quote)}</span></span>
<div className={`row jc-center ai-center width-100`}>
<span className={`text-gray ml-05`}>{t("MarketInfo.volume")}:</span>
<span className={`mr-05`}>{new BN(tr.volume).toFormat()}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -44,8 +42,8 @@ const MarketInfoTable = ({data, activeCurrency}) => {
title={tr?.base} className={`img-lg ml-05`}/>
<span className={`fs-01 mr-05`}>{activeCurrency ? t("currency." + tr?.base) : tr?.base + " / " + tr?.quote}</span>
</span>
<span className={`width-30 flex jc-start ai-center ${tr.priceChange > 0 ? "text-green" : "text-red"}`}>{new BN(tr.lastPrice).toFormat()} <span className={`fs-0-7 mr-05`}>{t("currency." + tr?.quote)}</span></span>
<span className={`width-25 flex ${i18n.language !== "fa" ? 'jc-start' : 'jc-end'} ai-center ${tr.priceChange > 0 ? "text-green" : "text-red"} direction-ltr`}>{new BN(tr.priceChange).toFormat()} %</span>
<span className={`width-30 flex jc-start ai-center ${tr.priceChangePercent > 0 ? "text-green" : "text-red"}`}>{new BN(tr.lastPrice).toFormat()} <span className={`fs-0-7 mr-05`}>{t("currency." + tr?.quote)}</span></span>
<span className={`width-25 flex ${i18n.language !== "fa" ? 'jc-start' : 'jc-end'} ai-center ${tr.priceChangePercent > 0 ? "text-green" : "text-red"} direction-ltr`}>{new BN(tr.priceChangePercent).toFormat(2)} %</span>
<span className="width-20 flex jc-start ai-center">{new BN(tr.volume).toFormat()}</span>
<span className="width-25 flex jc-end ai-center position-relative">
<img
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ const MarketView = () => {
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))
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ const MostDecreasedPrice = ({mostDecreasedPrice}) => {
/>
<span className={`mr-05`}>{t("currency." + mostDecreasedPrice.pairInfo.baseAsset)}</span>
</div>
<div className={`column ai-end text-red`}>
<div className={`column ai-end`}>
<div className={`${i18n.language !== "fa" ? 'row-reverse' : 'row'}`}>
<span className={`fs-0-6 ${i18n.language !== "fa" ? 'mr-05' : 'ml-05'}`}>{mostDecreasedPrice.pairInfo.quoteAsset}</span>
<span> {new BN(mostDecreasedPrice?.lastPrice).toFormat()} </span>
</div>
<span className={`direction-ltr`}>{new BN(mostDecreasedPrice?.priceChangePercent).toFormat(2)} %</span>
<span className={`${mostDecreasedPrice?.priceChangePercent > 0 ? "text-green" : "text-red"} direction-ltr`}>{new BN(mostDecreasedPrice?.priceChangePercent).toFormat(2)} %</span>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ const MostIncreasedPrice = ({mostIncreasedPrice}) => {
/>
<span className={`mr-05`}>{t("currency." + mostIncreasedPrice.pairInfo.baseAsset)}</span>
</div>
<div className={`column ai-end text-green`}>
<div className={`column ai-end`}>
<div className={`${i18n.language !== "fa" ? 'row-reverse' : 'row'}`}>
<span className={`fs-0-6 ${i18n.language !== "fa" ? 'mr-05' : 'ml-05'}`}>{mostIncreasedPrice.pairInfo.quoteAsset}</span>
<span>{new BN(mostIncreasedPrice?.lastPrice).toFormat()}</span>
</div>
<span>% {new BN(mostIncreasedPrice?.priceChangePercent).toFormat(2)}+</span>
<span className={`${mostIncreasedPrice?.priceChangePercent > 0 ? "text-green" : "text-red"} direction-ltr`}>{new BN(mostIncreasedPrice?.priceChangePercent).toFormat(2)} %</span>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ const MostVolume = ({mostVolume}) => {
</div>
<div className={`column ai-end`}>
<div className={`${i18n.language !== "fa" ? 'row-reverse' : 'row'}`}>
<span className={`fs-0-6 ${i18n.language !== "fa" ? 'mr-05' : 'ml-05'}`}>{mostVolume.pairInfo.quoteAsset}</span>
<span className={`fs-0-6 ${i18n.language !== "fa" ? 'mr-05' : 'ml-05'}`}>{mostVolume.pairInfo.baseAsset}</span>
<span> {new BN(mostVolume?.volume).toFormat()} </span>
</div>
<span>% {new BN(mostVolume?.change).toFormat(2)}+</span>
<span className={`${mostVolume?.change > 0 ? "text-green" : "text-red"} direction-ltr`}>{new BN(mostVolume?.change).toFormat(2)} %</span>
</div>
</div>
</div>
Expand Down