Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
113337e
#246 feat: fetch and store currencies as a Map in Redux state
Hossein-ab99 Jan 4, 2025
24752b7
#246 refactor: optimize pairs data storage in Redux state
Hossein-ab99 Jan 4, 2025
c0cc409
#246 feat: fetch and store fees as a Map in Redux state
Hossein-ab99 Jan 4, 2025
692b183
#246 Feat: Add utility function to retrieve currency name or alias ba…
Hossein-ab99 Jan 5, 2025
675dcaf
#246 feat: Integrated currency data from service into MarketDisplay c…
Hossein-ab99 Jan 7, 2025
a8e755c
#246 feat: Updated MarketStats to fetch currency details from service…
Hossein-ab99 Jan 8, 2025
09fcd36
#246 fix: initialize activeCurrency after quoteCurrencies load
Hossein-ab99 Jan 9, 2025
4d97e9e
#246 feat: Updated pair display in professional trading to fetch curr…
Hossein-ab99 Jan 12, 2025
73f5398
#246 feat: Updated professional trading header with service-based cur…
Hossein-ab99 Jan 13, 2025
0627174
#246 feat: Updated currency names in overview to use service-based de…
Hossein-ab99 Jan 13, 2025
0033640
#246 feat: Integrated currency service for buy order details
Hossein-ab99 Jan 20, 2025
0f06236
#246 feat: Integrated currency service for sell order details
Hossein-ab99 Jan 20, 2025
3261c86
#246 feat: Updated order book to fetch currency details from service
Hossein-ab99 Jan 20, 2025
d87837e
#246 feat: Updated recent trades to utilize currency service for data
Hossein-ab99 Jan 21, 2025
5bb72c8
#246 feat: Refactored current orders to fetch currency details from s…
Hossein-ab99 Jan 21, 2025
f22bdf5
#246 feat: Updated order history to use service-based currency details
Hossein-ab99 Jan 22, 2025
90c900c
#246 feat: Integrated currency service for trade history display
Hossein-ab99 Jan 22, 2025
bc30daf
#246 feat: Refactored quick deposit in professional trading to fetch …
Hossein-ab99 Jan 22, 2025
576ac3d
#246 feat: Update transaction history to use currency details from se…
Hossein-ab99 Jan 23, 2025
3786360
#246 feat: Update deposit history to fetch and display currency detai…
Hossein-ab99 Jan 26, 2025
37d6dba
#246 feat: Update withdrawal history to utilize currency details from…
Hossein-ab99 Jan 29, 2025
8e60452
#246 feat: Use new currency data in recent deposits section
Hossein-ab99 Feb 1, 2025
fe1b531
#246 feat: Update recent withdrawals to use latest currency data
Hossein-ab99 Feb 1, 2025
a3d79d8
#246 feat: Fetch updated currency details in wallet overview
Hossein-ab99 Feb 11, 2025
55e9c40
#246 feat: Update baseCurrency in walletBalance
Hossein-ab99 Feb 11, 2025
a4caf24
#246 feat: Integrate new currency source in user’s available, locked,…
Hossein-ab99 Feb 11, 2025
abc91e5
#246 feat: Integrate currency service in Easy Trade component
Hossein-ab99 Feb 13, 2025
0b4a726
#246 feat: display user's equivalent balance based on reference curre…
Hossein-ab99 Feb 13, 2025
c3d7f85
#246 refactor: cleaned up and streamlined extra sections in Easy Trade
Hossein-ab99 Feb 13, 2025
b09dd33
#247 feat: add useGetGatewaysByCurrency hook with config support
Hossein-ab99 Feb 14, 2025
32ba9ec
#247 feat: Implement Deposit Flow Based on Gateway and New Currency S…
Hossein-ab99 Feb 14, 2025
1bb9205
#247 feat: Fetch depositAllowed & withdrawAllowed in fetchCurrencies
Hossein-ab99 Feb 15, 2025
512a240
#247 feat:Implement Deposit Flow Based on Gateway and New Currency Se…
Hossein-ab99 Feb 16, 2025
07e33a5
#247 feat: Implement Withdrawal Flow Based on Gateway and New Currenc…
Hossein-ab99 Feb 17, 2025
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
9 changes: 6 additions & 3 deletions public/assets/locales/fa/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,6 @@
"cancel": "لغو",
"seconds": "ثانیه",
"submitPaymentReq": "ثبت درخواست واریز",
"noInventory": "موجودی کافی نیست !",
"allowableWithdraw": "حداقل مقدار مجاز برداشت رعایت نشده است.",
"fillAddress": "وارد کردن آدرس الزامیست.",
"important": "مهم",
"DepositTETHContentBefore": "فقط ETH تستی شبکه Ropsten مورد قبول قرار می گیرد! برای دریافت رایگان به ",
Expand All @@ -354,7 +352,11 @@
"network": "شبکه",
"selectNetwork": " شبکه را انتخاب کنید",
"gettingAddress": "درحال گرفتن آدرس...",
"errorGettingAddress": "خطا در گرفتن آدرس"
"errorGettingAddress": "خطا در گرفتن آدرس",

"noInventory": "موجودی کافی نیست !",
"noInventorywithdrawFee": "با احتساب کارمزد، موجودی کافی نیست !",
"allowableWithdraw": "حداقل مقدار مجاز برداشت رعایت نشده است."
},
"CallbackPage": {
"ok": "واریز وجه با موفقیت انجام شد.",
Expand All @@ -380,6 +382,7 @@
"inventory": "موجودی بعد از تراکنش",
"freeWallet": "موجودی قابل برداشت",
"minWithdraw": "حداقل مقدار برداشت",
"maxWithdrawal": "حداکثر مقدار برداشت",
"minDeposit": "حداقل مقدار واریز",
"maxWithdraw": "سقف برداشت روزانه شما",
"maxMonthWithdraw": "سقف برداشت ماهانه شما",
Expand Down
2 changes: 1 addition & 1 deletion src/components/NumberInput/NumberInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const NumberInput = (props) => {
customClass="hint-icon"
/>
<div className="column pt-05">
{ alerts.map((alert , index) => <span key={index} className={`${classes.alert} pr-05 `}>{alert}</span>) }
{ alerts?.map((alert , index) => <span key={index} className={`${classes.alert} pr-05 `}>{alert}</span>) }
</div>
</div>
}
Expand Down
6 changes: 5 additions & 1 deletion src/components/Popup/Popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@ 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}) => {

const {t} = useTranslation();

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: []});

Expand Down Expand Up @@ -75,7 +79,7 @@ const Popup = ({currency, closePopup}) => {
return (
<div className={`width-100 column jc-between ai-center px-1 py-1 appear-animation card-border ${classes.container}`}>
<div className={`${classes.header} width-100`}>
<h3>{t("deposit")} <span>{t("currency." + currency)}</span></h3>
<h3>{t("deposit")} <span>{getCurrencyNameOrAlias(currencies[currency], language)}</span></h3>
</div>
<div className={`${classes.content} width-100 column jc-center ai-center`}>
{content()}
Expand Down
12 changes: 8 additions & 4 deletions src/components/TextInput/TextInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,21 @@ const TextInput = (props) => {
const type = useSelector((state) => state.exchange.dateType)

const optionClassHandler = (state) => {
let className = classes.selectOptions
let className = classes.selectOptions;

if (state.isFocused) {
className = className + " " + classes.isFocused
className += " " + classes.isFocused;
}
if (state.isSelected) {
className = className + " " + classes.isSelected
className += " " + classes.isSelected;
}
if (state.isDisabled) {
className += " " + classes.disabledOption; // اضافه کردن کلاس برای گزینه‌های غیرفعال
}

return className;
}
};


const calenderTypeHandler = () => {
if (type === "Hijri" && i18n.language === "en") {
Expand Down
6 changes: 6 additions & 0 deletions src/components/TextInput/TextInput.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -209,4 +209,10 @@
/*width: 1px !important;*/
}

.disabledOption {
color: var(--gray) !important;
background-color: var(--deActive) !important;
cursor: not-allowed !important;
}


1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ i18n
});



const Toast = () => {
return <Toaster position="top-right" toastOptions={
{
Expand Down
3 changes: 3 additions & 0 deletions src/main/Browser/Browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import Guide from "./Pages/Info/Guide/Guide";
import Rules from "./Pages/Info/Rules/Rules";
import ContactUs from "./Pages/Info/ContactUs/ContactUs";
import EasyTrading from "./Pages/EasyTrading/EasyTrading";
import axios from "axios";

const Browser = () => {
const query = useQuery();
Expand All @@ -34,6 +35,8 @@ const Browser = () => {
const title = useSelector((state) => state.exchange.title)
const description = useSelector((state) => state.exchange.description)

const currencies = useSelector((state) => state.exchange.currencies)
const fees = useSelector((state) => state.exchange.fees)

theme === "DARK" ? document.body.classList.add('dark') : document.body.classList.remove('dark');

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {useState} from 'react';
import React, {useEffect, useState} from 'react';
import classes from './AllMarketInfo.module.css'
import Icon from "../../../../../../components/Icon/Icon";
import AllMarketInfoCard from "./components/AllMarketInfoCard/AllMarketInfoCard";
Expand All @@ -9,6 +9,8 @@ import Loading from "../../../../../../components/Loading/Loading";
import Error from "../../../../../../components/Error/Error";
import {setMarketInterval} from "../../../../../../store/actions";
import {useTranslation} from "react-i18next";
import i18n from "i18next";
import {getCurrencyNameOrAlias} from "../../../../../../utils/utils";

const AllMarketInfo = () => {

Expand All @@ -21,13 +23,22 @@ const AllMarketInfo = () => {
const interval = useSelector((state) => state.global.marketInterval)
const quote = activeCurrency === "" ? null : activeCurrency

const language = i18n.language
const currencies = useSelector((state) => state.exchange.currencies)

const {data: overview, isLoading, error} = useOverview(null, interval, quote)
const {data: currencies} = useGetQuoteCurrencies()
const {data: quoteCurrencies, isLoading:quoteCurrenciesIsLoading, error:quoteCurrenciesError} = useGetQuoteCurrencies()

useEffect(() => {
if (quoteCurrencies?.length > 0) {
setActiveCurrency(quoteCurrencies[0]);
}
}, [quoteCurrencies]);


const content = () => {
if (isLoading) return <div style={{height: "40vh"}}><Loading/></div>
if (error) return <div style={{height: "40vh"}}><Error/></div>
if (isLoading || quoteCurrenciesIsLoading) return <div style={{height: "40vh"}}><Loading/></div>
if (error || quoteCurrenciesError) return <div style={{height: "40vh"}}><Error/></div>
else return <>
{card ?
<AllMarketInfoCard data={overview} activeCurrency={activeCurrency}/>
Expand All @@ -44,8 +55,8 @@ const AllMarketInfo = () => {
<Icon iconName={`${card ? 'icon-row' : 'icon-grid'} fs-02 flex cursor-pointer hover-text`} customClass={`ml-05`} onClick={()=>setCard(prevState => !prevState)}/>
<h1 className={`mr-05 ml-025 cursor-pointer hover-text`} onClick={()=>setActiveCurrency("")}>{t("market.title")}</h1>
<div className={`row jc-center ai-center fs-0-8 mr-1`}>
{currencies?.map((currency) =>
<span className={`px-2 py-1 rounded-5 cursor-pointer hover-text ${classes.title} ${activeCurrency === currency && classes.active}`} onClick={() => setActiveCurrency(currency)} key={currency}>{t("currency." + currency)}</span>
{quoteCurrencies?.map((currency) =>
<span className={`px-2 py-1 rounded-5 cursor-pointer hover-text ${classes.title} ${activeCurrency === currency && classes.active}`} onClick={() => setActiveCurrency(currency)} key={currency}>{getCurrencyNameOrAlias(currencies[currency], language)}</span>
)}
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import classes from './AllMarketInfoCard.module.css'
import {useTranslation} from "react-i18next";
import {images} from "../../../../../../../../assets/images";
import Button from "../../../../../../../../components/Button/Button";
import {BN} from "../../../../../../../../utils/utils";
import {BN, getCurrencyNameOrAlias} from "../../../../../../../../utils/utils";
import {setActivePairInitiate} from "../../../../../../../../store/actions";
import {Panel} from "../../../../../../Routes/routes";
import {useNavigate} from "react-router-dom";
Expand All @@ -16,6 +16,8 @@ const AllMarketInfoCard = ({data, activeCurrency}) => {
const {t} = useTranslation();
const navigate = useNavigate();
const dispatch = useDispatch();
const language = i18n.language
const currencies = useSelector((state) => state.exchange.currencies)
const allExchangeSymbols = useSelector((state) => state.exchange.symbols)

const [showButton, setShowButton] = useState(null)
Expand Down Expand Up @@ -53,33 +55,38 @@ const AllMarketInfoCard = ({data, activeCurrency}) => {
<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`}>
<div className={`column jc-start ai-start width-100 px-1`}>
<div className={`row jc-center ai-center`}>
<img src={images[tr?.base]} alt={tr?.base}
<img src={currencies[tr?.base]?.icon} alt={tr?.base}
title={tr?.base} className={`img-md-plus ml-05`}/>

<span className={`fs-01`}>{activeCurrency ? t("currency." + tr?.base) : tr?.base + " / " + tr?.quote}</span>
<span className={`fs-01`}>{activeCurrency ?
<>
{getCurrencyNameOrAlias(currencies[tr?.base], language)}
<span className={`text-gray fs-0-8 mr-05`}>{tr?.base}</span>
</>
: tr?.base + " / " + tr?.quote}</span>
</div>
<div className={`flex jc-end ai-center fs-0-6`}>
<span className={`${tr.priceChangePercent > 0 ? "text-green" : "text-red"} direction-ltr mr-05`}>{new BN(tr.priceChangePercent).toFormat(2)} %</span>
<span className={`flex ${i18n.language !== "fa" ? 'jc-start' : 'jc-end'} ai-center ${tr.priceChangePercent > 0 ? "text-green" : tr.priceChangePercent < 0 ? "text-red" : ""} direction-ltr`}>{tr.priceChangePercent === 0 ? "0 %" : `${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.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>
<span className={`${tr.priceChangePercent > 0 ? "text-green" : "text-red"} fs-01`}>{new BN(tr.lastPrice).toFormat()} <span className={`fs-0-7 mr-025`}>{tr?.quote}</span></span>
</div>
<div className={`row jc-between ai-center`}>
<span className={`text-gray`}>{t("MarketInfo.lowPrice")}:</span>
<span>{new BN(tr.lowPrice).toFormat()}</span>
<span>{new BN(tr.lowPrice).decimalPlaces(currencies[tr?.quote]?.precision ?? 0).toFormat()} <span className={`fs-0-7 mr-05`}>{tr?.quote}</span></span>
</div>
<div className={`row jc-between ai-center`}>
<span className={`text-gray`}>{t("MarketInfo.highPrice")}:</span>
<span>{new BN(tr.highPrice).toFormat()}</span>
<span>{new BN(tr.highPrice).decimalPlaces(currencies[tr?.quote]?.precision ?? 0).toFormat()} <span className={`fs-0-7 mr-05`}>{tr?.quote}</span></span>
</div>
<div className={`row jc-between ai-center`}>
<span className={`text-gray`}>{t("MarketInfo.volume")}:</span>
<span>{new BN(tr.volume).toFormat()}</span>
<span>{new BN(tr.volume).decimalPlaces(currencies[tr?.base]?.precision ?? 0).toFormat()} <span className={`fs-0-7 mr-05`}>{tr?.base}</span></span>
</div>
</div>
</div>
Expand Down
Loading
Loading