From 3932c18baf3a9e974754882d335e5c2c72af2470 Mon Sep 17 00:00:00 2001 From: Hossein Date: Sat, 29 Jun 2024 13:53:13 +0330 Subject: [PATCH 1/7] Update general info component --- .../components/MostVolume/MostVolume.js | 7 +++++-- .../components/GeneralInfo/GeneralInfo.js | 16 +++++++++++++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/main/Browser/Pages/AllMarket/components/VolumeInfo/components/MostVolume/MostVolume.js b/src/main/Browser/Pages/AllMarket/components/VolumeInfo/components/MostVolume/MostVolume.js index f8a7ad9e..8ca16917 100644 --- a/src/main/Browser/Pages/AllMarket/components/VolumeInfo/components/MostVolume/MostVolume.js +++ b/src/main/Browser/Pages/AllMarket/components/VolumeInfo/components/MostVolume/MostVolume.js @@ -19,9 +19,12 @@ const MostVolume = ({mostVolume}) => { {mostVolume?.pairInfo?.baseAsset} {new BN(mostVolume?.volume).toFormat()} -
+ + {/*++ to do ++*/} + + {/*
0 ? "text-green" : "text-red"} direction-ltr`}>{new BN(mostVolume?.change).toFormat(2)} % -
+
*/} ); }; diff --git a/src/main/Browser/Pages/Landing/components/GeneralInfo/GeneralInfo.js b/src/main/Browser/Pages/Landing/components/GeneralInfo/GeneralInfo.js index 5e3f6311..970f13ab 100644 --- a/src/main/Browser/Pages/Landing/components/GeneralInfo/GeneralInfo.js +++ b/src/main/Browser/Pages/Landing/components/GeneralInfo/GeneralInfo.js @@ -4,6 +4,7 @@ import {useGetExchangeInfo} from "../../../../../../queries"; import Loading from "../../../../../../components/Loading/Loading"; import Error from "../../../../../../components/Error/Error"; import {useTranslation} from "react-i18next"; +import i18n from "i18next"; const GeneralInfo = () => { @@ -17,15 +18,24 @@ const GeneralInfo = () => { if (error) return else return <>
- {data.activeUsers.toLocaleString()} +
+ {data.activeUsers.toLocaleString()} + + +
{t("GeneralInfo.activeUsers")}
- {data.totalOrders.toLocaleString()} +
+ {data.totalOrders.toLocaleString()} + + +
{t("GeneralInfo.totalOrders")}
- {data.totalTrades.toLocaleString()} +
+ {data.totalTrades.toLocaleString()} + + +
{t("GeneralInfo.totalTrades")}
From 16b5deb010cd196e609c7465c3fd6f66068d6e94 Mon Sep 17 00:00:00 2001 From: Hossein Date: Sat, 29 Jun 2024 20:22:11 +0330 Subject: [PATCH 2/7] #199: Refactor transactions history --- public/assets/locales/fa/translation.json | 6 + .../UserPanel/Sections/Content/Content.js | 4 +- .../components/Transactions/Transactions.js | 60 ++++ .../Transactions/Transactions.module.css | 46 +++ .../components/BuyAndSell/BuyAndSell.js | 284 ++++++++++++++++++ .../BuyAndSell/BuyAndSell.module.css | 17 ++ .../BuyAndSellTable/BuyAndSellTable.js | 103 +++++++ .../BuyAndSellTable.module.css | 6 + .../DepositHistory/DepositHistory.js | 280 +++++++++++++++++ .../DepositHistory/DepositHistory.module.css | 17 ++ .../DepositHistoryTable.js | 112 +++++++ .../DepositHistoryTable.module.css | 0 .../WithdrawHistory/WithdrawHistory.js | 280 +++++++++++++++++ .../WithdrawHistory.module.css | 17 ++ .../WithdrawHistoryTable.js | 122 ++++++++ .../WithdrawHistoryTable.module.css | 0 .../Pages/UserPanel/Sections/Header/Header.js | 4 +- .../UserPanel/Sections/MainMenu/MainMenu.js | 3 +- src/main/Browser/Pages/UserPanel/UserPanel.js | 3 +- src/main/Browser/Routes/routes.js | 3 + src/queries/hooks/useGetBuyAndSellHistory.js | 19 ++ src/queries/hooks/useGetDepositHistory.js | 23 ++ src/queries/hooks/useGetWithdrawHistory.js | 23 ++ src/queries/index.js | 5 +- yarn.lock | 4 +- 25 files changed, 1432 insertions(+), 9 deletions(-) create mode 100644 src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/Transactions.js create mode 100644 src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/Transactions.module.css create mode 100644 src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/BuyAndSell/BuyAndSell.js create mode 100644 src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/BuyAndSell/BuyAndSell.module.css create mode 100644 src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/BuyAndSellTable/BuyAndSellTable.js create mode 100644 src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/BuyAndSellTable/BuyAndSellTable.module.css create mode 100644 src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/DepositHistory/DepositHistory.js create mode 100644 src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/DepositHistory/DepositHistory.module.css create mode 100644 src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/DepositHistoryTable/DepositHistoryTable.js create mode 100644 src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/DepositHistoryTable/DepositHistoryTable.module.css create mode 100644 src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/WithdrawHistory/WithdrawHistory.js create mode 100644 src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/WithdrawHistory/WithdrawHistory.module.css create mode 100644 src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/WithdrawHistoryTable/WithdrawHistoryTable.js create mode 100644 src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/WithdrawHistoryTable/WithdrawHistoryTable.module.css create mode 100644 src/queries/hooks/useGetBuyAndSellHistory.js create mode 100644 src/queries/hooks/useGetDepositHistory.js create mode 100644 src/queries/hooks/useGetWithdrawHistory.js diff --git a/public/assets/locales/fa/translation.json b/public/assets/locales/fa/translation.json index 7dedcc6c..bc5fffee 100644 --- a/public/assets/locales/fa/translation.json +++ b/public/assets/locales/fa/translation.json @@ -246,6 +246,12 @@ "estimateAlert": "مبلغ دارایی معادل براساس بالاترین پیشنهاد خرید محاسبه شده" }, "TransactionHistory": { + "buyAndSell" : "خرید و فروش", + "buyAndSellTx" : "تاریخچه خرید و فروش", + "withdrawTx" : "تاریخچه برداشت", + "depositTx" : "تاریخچه واریز", + "destAddress" : "آدرس مقصد", + "txType" : "نوع تراکنش", "coin" : "ارز", "category" : "نوع تراکنش", "size" : "تعداد", diff --git a/src/main/Browser/Pages/UserPanel/Sections/Content/Content.js b/src/main/Browser/Pages/UserPanel/Sections/Content/Content.js index e0bc9959..decaa2eb 100644 --- a/src/main/Browser/Pages/UserPanel/Sections/Content/Content.js +++ b/src/main/Browser/Pages/UserPanel/Sections/Content/Content.js @@ -9,7 +9,7 @@ import Footer from "../Footer/Footer"; import Settings from "./components/Settings/Settings"; import {useSelector} from "react-redux"; import TechnicalChart from "./components/TechnicalChart/TechnicalChart"; -import TransactionHistory from "./components/TransactionHistory/TransactionHistory"; +import Transactions from "./components/Transactions/Transactions"; const Content = () => { @@ -24,7 +24,7 @@ const Content = () => { }/> }/> }/> - }/> + }/> { + + const {t} = useTranslation(); + + const [activeTx, setActiveTx] = useState("buyAndSell") + + + const content = () => { + if (activeTx === "buyAndSell") return + if (activeTx === "deposit") return + if (activeTx === "withdraw") return + } + + return (<> + + +
+ +
+ +
+ setActiveTx("buyAndSell")}>{t("TransactionHistory.buyAndSell")} + setActiveTx("deposit")}>{t("TransactionCategory.DEPOSIT")} + setActiveTx("withdraw")}>{t("TransactionCategory.WITHDRAW")} +
+
+ + {content()} + +
+ + + +
+ + +
+ + + + + + + ); +}; + +export default Transactions; diff --git a/src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/Transactions.module.css b/src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/Transactions.module.css new file mode 100644 index 00000000..768e1319 --- /dev/null +++ b/src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/Transactions.module.css @@ -0,0 +1,46 @@ +.thisInput :global(.lead) { + width: 30%; +} +.thisInput :global(.selectExternalClass) { + width: 70% !important; +} + +.thisInput :global(.rmdp-container ) { + width: 70%; + height: 100%; +} + + + +.thisButton { + background-color: var(--orange); + color: #000; +} +.disable:disabled,.button[disabled] { + border: 0.3vh solid var(--cardHeader); + background: var(--cardHeader); + color: var(--textColor); + cursor: not-allowed; +} + +.thisButton:disabled,.button[disabled] { + border: 0.3vh solid var(--cardHeader); + background: var(--cardHeader); + color: var(--textColor); + cursor: not-allowed; +} + + + +.header { + height: 10vh; +} + +/*.title { + background-color: var(--cardBodyAlpha); +}*/ + +.active { + background-color: var(--activeTitle); + color: var(--activeTab); +} \ No newline at end of file diff --git a/src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/BuyAndSell/BuyAndSell.js b/src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/BuyAndSell/BuyAndSell.js new file mode 100644 index 00000000..026e6bf1 --- /dev/null +++ b/src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/BuyAndSell/BuyAndSell.js @@ -0,0 +1,284 @@ +import React, {useEffect, useRef, useState} from 'react'; +import classes from './BuyAndSell.module.css'; +import {useTranslation} from "react-i18next"; +import {useSelector} from "react-redux"; +import {useTransactionHistory} from "../../../../../../../../../../queries/hooks/useTransactionHistory"; +import {useGetBuyAndSellHistory} from "../../../../../../../../../../queries"; +import TextInput from "../../../../../../../../../../components/TextInput/TextInput"; +import DatePanel from "react-multi-date-picker/plugins/date_panel"; +import i18n from "i18next"; +import moment from "moment-jalaali"; +import Loading from "../../../../../../../../../../components/Loading/Loading"; +import Error from "../../../../../../../../../../components/Error/Error"; +import TransactionHistoryTable + from "../../../TransactionHistory/components/TransactionHistoryTable/TransactionHistoryTable"; +import Date from "../../../../../../../../../../components/Date/Date"; +import ToggleSwitch from "../../../../../../../../../../components/ToggleSwitch/ToggleSwitch"; +import BuyAndSellTable from "../BuyAndSellTable/BuyAndSellTable"; +import Button from "../../../../../../../../../../components/Button/Button"; + +const BuyAndSell = () => { + + const {t} = useTranslation(); + const user_id = useSelector((state) => state.auth.id) + const coins = useSelector((state) => state.exchange.assets) + + const [query, setQuery] = useState({ + "coin": null, // optional + "category": null, // optional [DEPOSIT, FEE, TRADE, WITHDRAW, ORDER_CANCEL, ORDER_CREATE, ORDER_FINALIZED] + "startTime": null, + "endTime": null, + "ascendingByTime": false, + "limit": 10, + "offset": 0 + }); + + const {data, isLoading, error, refetch} = useGetBuyAndSellHistory(user_id, query); + + const pagination = { + page: (query.offset / query.limit) + 1, + isLastPage: data?.length < query.limit + } + + const isFirst = useRef(true); + + useEffect(() => { + if (!isFirst.current) scrollRef.current?.scrollIntoView({behavior: 'smooth'}); + }, [data]); + + const categories = ['DEPOSIT', 'FEE', 'TRADE', 'WITHDRAW', 'ORDER_CANCEL', 'ORDER_CREATE', 'ORDER_FINALIZED']; + + const coinsOptions = [{value: null, label: t('all')}] + const categoryOptions = [{value: null, label: t('all')}] + const size = [10, 20, 30, 40, 50] + + categories.forEach((o) => { + categoryOptions.push({value: o, label: t('TransactionCategory.' + o)}) + }) + + coins.forEach((o) => { + coinsOptions.push({value: o, label: t('currency.' + o)}) + }) + + + const scrollRef = useRef(null); + + + const pageSizeHandler = (e) => { + setQuery({ + ...query, + limit: e.value, + offset: 0 + }) + } + + const firstPage = () => { + setQuery({ + ...query, + offset: 0 + }) + } + const nextPage = () => { + isFirst.current = false; + setQuery({ + ...query, + offset: query.offset + query.limit + }) + } + const prevPage = () => { + setQuery({ + ...query, + offset: query.offset - query.limit + }) + } + const startDateHandler = (dateRange) => { + const start = dateRange[0] ? moment.unix(dateRange[0].toUnix()).startOf("day").valueOf() : null; + const end = dateRange[1] ? moment.unix(dateRange[1].toUnix()).endOf("day").valueOf() : null; + setQuery({ + ...query, + startTime: start, + endTime: end + }) + } + + + const content = () => { + if (isLoading) return
+ if (error) return
+ if (data?.length === 0) return
{t("noTx")}
+ else return <> + + + } + + const periodTextHandler = () => { + if (query?.startTime && query?.endTime) return <> + {t("from")} + + {t("until")} + + + if (query?.startTime) return <> + {t("from")} + + {t("until")} + + + } + + + + + + return ( +
+ +
+ {/* setQuery({...query, coin: e.value, offset:0})} + customClass={`width-24 ${classes.thisInput}`} + /> + setQuery({...query, category: e.value, offset:0})} + customClass={`width-24 ${classes.thisInput}`} + />*/} + { + return {label: s, value: s} + })} + lead={t('TransactionHistory.size')} + type="select" + value={{ + value: query?.limit, + label: query?.limit, + }} + onchange={pageSizeHandler} + customClass={`width-30 ${classes.thisInput}`} + /> + + + ]} + lead={t('TransactionHistory.period')} + type="input" + onChange={startDateHandler} + /*value={[query.startTime, query.endTime]}*/ + value={[query.startTime, query.endTime]} + dateSeparator={" " + t('to') + " "} + range + hideOnScroll + dataPanelPosition="Bottom" + position={`${i18n.language === "fa" ? "bottom-left" : "bottom-right" }`} + customClass={`width-30 ${classes.thisInput}`} + /> + +
+ {t("TransactionHistory.ascendingByTime")} + setQuery(prevState => {return { + ...prevState, + ascendingByTime: !prevState.ascendingByTime + }}) } + + /*onchange={()=> setQuery({ + ...query, + ascendingByTime: (prevState => !prevState)} + )}*/ + checked={!query?.ascendingByTime}/> +
+ +
+ +
+
+
+

{t("TransactionHistory.buyAndSellTx")}

+
+ {periodTextHandler()} +
+
+ +
+
+ +
+
+ {content()} +
+
+
+ +
+ +
+ ); +}; + +export default BuyAndSell; diff --git a/src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/BuyAndSell/BuyAndSell.module.css b/src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/BuyAndSell/BuyAndSell.module.css new file mode 100644 index 00000000..7579db6f --- /dev/null +++ b/src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/BuyAndSell/BuyAndSell.module.css @@ -0,0 +1,17 @@ +.thisButton { + background-color: var(--orange); + color: #000; +} +.disable:disabled,.button[disabled] { + border: 0.3vh solid var(--cardBodyAlpha); + background: var(--cardBodyAlpha); + color: var(--textColor); + cursor: not-allowed; +} + +.thisButton:disabled,.button[disabled] { + border: 0.3vh solid var(--cardBodyAlpha); + background: var(--cardBodyAlpha); + color: var(--textColor); + cursor: not-allowed; +} \ No newline at end of file diff --git a/src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/BuyAndSellTable/BuyAndSellTable.js b/src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/BuyAndSellTable/BuyAndSellTable.js new file mode 100644 index 00000000..dfb3f7c8 --- /dev/null +++ b/src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/BuyAndSellTable/BuyAndSellTable.js @@ -0,0 +1,103 @@ +import React from 'react'; +import classes from './BuyAndSellTable.module.css' +import {useTranslation} from "react-i18next"; +import {useSelector} from "react-redux"; +import Date from "../../../../../../../../../../components/Date/Date"; +import moment from "moment-jalaali"; +import i18n from "i18next"; +import {BN} from "../../../../../../../../../../utils/utils"; +import Icon from "../../../../../../../../../../components/Icon/Icon"; + +const BuyAndSellTable = ({txs, offset}) => { + const {t} = useTranslation(); + + const id = useSelector(state => state.auth.id); + + + let head = ( +
+ {t("row")} + {t("date")} + {t("time")} + {t("TransactionHistory.category")} + {t("TransactionHistory.coin")} + {t("pricePerUnit")} + {t("volume")} + {t("totalPrice")} + {t("TransactionCategory.FEE")} + {/*{t("details")}*/} + +
+ ); + let body = ( + <> + {txs.map((tr, index) => { + + const isMaker = tr?.additionalData?.makerUuid === id + const isTaker = tr?.additionalData?.takerUuid === id + + const isSelfTrade = (((tr?.additionalData?.takerDirection === "ASK") || ( tr?.additionalData?.makerDirection === "BID")) && isTaker && isMaker) + + return ( + +
+ +
+ + {index + offset + 1} + + + + + + {moment(tr.createDate).format("HH:mm:ss")} + + + {tr?.side === "BID" && t("buy")} + {tr?.side === "ASK" && t("sell")} + + + + {t("currency." + tr.symbol )} + + + {new BN(tr?.matchedPrice).toFormat()} + + + {new BN(tr?.volume).toFormat()} + + + {new BN(tr?.transactionPrice).toFormat()} + + + {new BN(tr?.fee).toFormat()} + + + + + + +
+ +
+ + + + ) + })} + + ); + + + + + + return ( + <> + {head} + {body} + + ); +}; + +export default BuyAndSellTable; diff --git a/src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/BuyAndSellTable/BuyAndSellTable.module.css b/src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/BuyAndSellTable/BuyAndSellTable.module.css new file mode 100644 index 00000000..c6570126 --- /dev/null +++ b/src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/BuyAndSellTable/BuyAndSellTable.module.css @@ -0,0 +1,6 @@ +.striped:nth-child(even) { + background-color: var(--tableRow); + -webkit-transition: background-color 0.4s; + -o-transition: background-color 0.4s; + transition: background-color 0.4s; +} \ No newline at end of file diff --git a/src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/DepositHistory/DepositHistory.js b/src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/DepositHistory/DepositHistory.js new file mode 100644 index 00000000..09ddbe81 --- /dev/null +++ b/src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/DepositHistory/DepositHistory.js @@ -0,0 +1,280 @@ +import React, {useEffect, useRef, useState} from 'react'; +import {useTranslation} from "react-i18next"; +import {useSelector} from "react-redux"; +import {useGetDepositHistory} from "../../../../../../../../../../queries"; +import moment from "moment-jalaali"; +import Loading from "../../../../../../../../../../components/Loading/Loading"; +import Error from "../../../../../../../../../../components/Error/Error"; +import WithdrawHistoryTable from "../WithdrawHistoryTable/WithdrawHistoryTable"; +import Date from "../../../../../../../../../../components/Date/Date"; +import TextInput from "../../../../../../../../../../components/TextInput/TextInput"; +import classes from "./DepositHistory.module.css"; +import DatePanel from "react-multi-date-picker/plugins/date_panel"; +import i18n from "i18next"; +import ToggleSwitch from "../../../../../../../../../../components/ToggleSwitch/ToggleSwitch"; +import Button from "../../../../../../../../../../components/Button/Button"; +import DepositHistoryTable from "../DepositHistoryTable/DepositHistoryTable"; + + +const DepositHistory = () => { + + const {t} = useTranslation(); + const user_id = useSelector((state) => state.auth.id) + const coins = useSelector((state) => state.exchange.assets) + + const [query, setQuery] = useState({ + "coin": null, // optional + "category": null, // optional [DEPOSIT, FEE, TRADE, WITHDRAW, ORDER_CANCEL, ORDER_CREATE, ORDER_FINALIZED] + "startTime": null, + "endTime": null, + "ascendingByTime": false, + "limit": 10, + "offset": 0 + }); + + const {data, isLoading, error, refetch} = useGetDepositHistory(user_id, query); + + const pagination = { + page: (query.offset / query.limit) + 1, + isLastPage: data?.length < query.limit + } + + const isFirst = useRef(true); + + useEffect(() => { + if (!isFirst.current) scrollRef.current?.scrollIntoView({behavior: 'smooth'}); + }, [data]); + + const categories = ['DEPOSIT', 'FEE', 'TRADE', 'WITHDRAW', 'ORDER_CANCEL', 'ORDER_CREATE', 'ORDER_FINALIZED']; + + const coinsOptions = [{value: null, label: t('all')}] + const categoryOptions = [{value: null, label: t('all')}] + const size = [10, 20, 30, 40, 50] + + categories.forEach((o) => { + categoryOptions.push({value: o, label: t('TransactionCategory.' + o)}) + }) + + coins.forEach((o) => { + coinsOptions.push({value: o, label: t('currency.' + o)}) + }) + + + const scrollRef = useRef(null); + + + const pageSizeHandler = (e) => { + setQuery({ + ...query, + limit: e.value, + offset: 0 + }) + } + + const firstPage = () => { + setQuery({ + ...query, + offset: 0 + }) + } + const nextPage = () => { + isFirst.current = false; + setQuery({ + ...query, + offset: query.offset + query.limit + }) + } + const prevPage = () => { + setQuery({ + ...query, + offset: query.offset - query.limit + }) + } + const startDateHandler = (dateRange) => { + const start = dateRange[0] ? moment.unix(dateRange[0].toUnix()).startOf("day").valueOf() : null; + const end = dateRange[1] ? moment.unix(dateRange[1].toUnix()).endOf("day").valueOf() : null; + setQuery({ + ...query, + startTime: start, + endTime: end + }) + } + + + const content = () => { + if (isLoading) return
+ if (error) return
+ if (data?.length === 0) return
{t("noTx")}
+ else return <> + + + } + + const periodTextHandler = () => { + if (query?.startTime && query?.endTime) return <> + {t("from")} + + {t("until")} + + + if (query?.startTime) return <> + {t("from")} + + {t("until")} + + + } + + + return ( +
+ +
+ {/* setQuery({...query, coin: e.value, offset:0})} + customClass={`width-24 ${classes.thisInput}`} + /> + setQuery({...query, category: e.value, offset:0})} + customClass={`width-24 ${classes.thisInput}`} + />*/} + { + return {label: s, value: s} + })} + lead={t('TransactionHistory.size')} + type="select" + value={{ + value: query?.limit, + label: query?.limit, + }} + onchange={pageSizeHandler} + customClass={`width-30 ${classes.thisInput}`} + /> + + + ]} + lead={t('TransactionHistory.period')} + type="input" + onChange={startDateHandler} + /*value={[query.startTime, query.endTime]}*/ + value={[query.startTime, query.endTime]} + dateSeparator={" " + t('to') + " "} + range + hideOnScroll + dataPanelPosition="Bottom" + position={`${i18n.language === "fa" ? "bottom-left" : "bottom-right" }`} + customClass={`width-30 ${classes.thisInput}`} + /> + +
+ {t("TransactionHistory.ascendingByTime")} + setQuery(prevState => {return { + ...prevState, + ascendingByTime: !prevState.ascendingByTime + }}) } + + /*onchange={()=> setQuery({ + ...query, + ascendingByTime: (prevState => !prevState)} + )}*/ + checked={!query?.ascendingByTime}/> +
+ +
+ +
+
+
+

{t("TransactionHistory.depositTx")}

+
+ {periodTextHandler()} +
+
+ +
+
+ +
+
+ {content()} +
+
+
+ +
+ +
+ ); +}; + +export default DepositHistory; diff --git a/src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/DepositHistory/DepositHistory.module.css b/src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/DepositHistory/DepositHistory.module.css new file mode 100644 index 00000000..7579db6f --- /dev/null +++ b/src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/DepositHistory/DepositHistory.module.css @@ -0,0 +1,17 @@ +.thisButton { + background-color: var(--orange); + color: #000; +} +.disable:disabled,.button[disabled] { + border: 0.3vh solid var(--cardBodyAlpha); + background: var(--cardBodyAlpha); + color: var(--textColor); + cursor: not-allowed; +} + +.thisButton:disabled,.button[disabled] { + border: 0.3vh solid var(--cardBodyAlpha); + background: var(--cardBodyAlpha); + color: var(--textColor); + cursor: not-allowed; +} \ No newline at end of file diff --git a/src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/DepositHistoryTable/DepositHistoryTable.js b/src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/DepositHistoryTable/DepositHistoryTable.js new file mode 100644 index 00000000..959cc3c2 --- /dev/null +++ b/src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/DepositHistoryTable/DepositHistoryTable.js @@ -0,0 +1,112 @@ +import React from 'react'; +import classes from './DepositHistoryTable.module.css' +import {useTranslation} from "react-i18next"; +import {useSelector} from "react-redux"; +import Date from "../../../../../../../../../../components/Date/Date"; +import moment from "moment-jalaali"; +import {BN} from "../../../../../../../../../../utils/utils"; + +const DepositHistoryTable = ({txs, offset}) => { + + const {t} = useTranslation(); + + const id = useSelector(state => state.auth.id); + + const txStatus = (status) => { + switch (status) { + case 0: + return t("orderStatus.NEW"); + case 1: + return t("orderStatus.DONE"); + case 2: + return t("orderStatus.REJECTED"); + default: + return t("orderStatus.NEW"); + } + }; + + let head = ( +
+ {t("row")} + {t("date")} + {t("time")} + {t("TransactionHistory.category")} + {t("TransactionHistory.coin")} + {t("DepositWithdraw.network")} + {t("volume")} + {t("status")} + {t("TransactionHistory.txType")} + +
+ ); + let body = ( + <> + {txs.map((tr, index) => { + + const isMaker = tr?.additionalData?.makerUuid === id + const isTaker = tr?.additionalData?.takerUuid === id + + const isSelfTrade = (((tr?.additionalData?.takerDirection === "ASK") || ( tr?.additionalData?.makerDirection === "BID")) && isTaker && isMaker) + + return ( + +
+ +
+ + {index + offset + 1} + + + + + + {moment(tr.createDate).format("HH:mm:ss")} + + + { t("TransactionCategory.DEPOSIT")} + + + + {t("currency." + tr.currency )} + + + + {tr.network} + + + + + {new BN(tr?.amount).toFormat()} + + + + {txStatus(tr.status)} + + + {tr.depositType} + + + + + + +
+ +
+ + + + ) + })} + + ); + + return ( + <> + {head} + {body} + + ); +}; + +export default DepositHistoryTable; diff --git a/src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/DepositHistoryTable/DepositHistoryTable.module.css b/src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/DepositHistoryTable/DepositHistoryTable.module.css new file mode 100644 index 00000000..e69de29b diff --git a/src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/WithdrawHistory/WithdrawHistory.js b/src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/WithdrawHistory/WithdrawHistory.js new file mode 100644 index 00000000..ab643ff7 --- /dev/null +++ b/src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/WithdrawHistory/WithdrawHistory.js @@ -0,0 +1,280 @@ +import React, {useEffect, useRef, useState} from 'react'; +import classes from './WithdrawHistory.module.css' +import {useTranslation} from "react-i18next"; +import {useSelector} from "react-redux"; +import {useGetBuyAndSellHistory, useGetWithdrawHistory} from "../../../../../../../../../../queries"; +import moment from "moment-jalaali"; +import Loading from "../../../../../../../../../../components/Loading/Loading"; +import Error from "../../../../../../../../../../components/Error/Error"; +import BuyAndSellTable from "../BuyAndSellTable/BuyAndSellTable"; +import Date from "../../../../../../../../../../components/Date/Date"; +import TextInput from "../../../../../../../../../../components/TextInput/TextInput"; +import DatePanel from "react-multi-date-picker/plugins/date_panel"; +import i18n from "i18next"; +import ToggleSwitch from "../../../../../../../../../../components/ToggleSwitch/ToggleSwitch"; +import Button from "../../../../../../../../../../components/Button/Button"; +import WithdrawHistoryTable from "../WithdrawHistoryTable/WithdrawHistoryTable"; + +const WithdrawHistory = () => { + + const {t} = useTranslation(); + const user_id = useSelector((state) => state.auth.id) + const coins = useSelector((state) => state.exchange.assets) + + const [query, setQuery] = useState({ + "coin": null, // optional + "category": null, // optional [DEPOSIT, FEE, TRADE, WITHDRAW, ORDER_CANCEL, ORDER_CREATE, ORDER_FINALIZED] + "startTime": null, + "endTime": null, + "ascendingByTime": false, + "limit": 10, + "offset": 0 + }); + + const {data, isLoading, error, refetch} = useGetWithdrawHistory(user_id, query); + + const pagination = { + page: (query.offset / query.limit) + 1, + isLastPage: data?.length < query.limit + } + + const isFirst = useRef(true); + + useEffect(() => { + if (!isFirst.current) scrollRef.current?.scrollIntoView({behavior: 'smooth'}); + }, [data]); + + const categories = ['DEPOSIT', 'FEE', 'TRADE', 'WITHDRAW', 'ORDER_CANCEL', 'ORDER_CREATE', 'ORDER_FINALIZED']; + + const coinsOptions = [{value: null, label: t('all')}] + const categoryOptions = [{value: null, label: t('all')}] + const size = [10, 20, 30, 40, 50] + + categories.forEach((o) => { + categoryOptions.push({value: o, label: t('TransactionCategory.' + o)}) + }) + + coins.forEach((o) => { + coinsOptions.push({value: o, label: t('currency.' + o)}) + }) + + + const scrollRef = useRef(null); + + + const pageSizeHandler = (e) => { + setQuery({ + ...query, + limit: e.value, + offset: 0 + }) + } + + const firstPage = () => { + setQuery({ + ...query, + offset: 0 + }) + } + const nextPage = () => { + isFirst.current = false; + setQuery({ + ...query, + offset: query.offset + query.limit + }) + } + const prevPage = () => { + setQuery({ + ...query, + offset: query.offset - query.limit + }) + } + const startDateHandler = (dateRange) => { + const start = dateRange[0] ? moment.unix(dateRange[0].toUnix()).startOf("day").valueOf() : null; + const end = dateRange[1] ? moment.unix(dateRange[1].toUnix()).endOf("day").valueOf() : null; + setQuery({ + ...query, + startTime: start, + endTime: end + }) + } + + + const content = () => { + if (isLoading) return
+ if (error) return
+ if (data?.length === 0) return
{t("noTx")}
+ else return <> + + + } + + const periodTextHandler = () => { + if (query?.startTime && query?.endTime) return <> + {t("from")} + + {t("until")} + + + if (query?.startTime) return <> + {t("from")} + + {t("until")} + + + } + + + + return ( +
+ +
+ {/* setQuery({...query, coin: e.value, offset:0})} + customClass={`width-24 ${classes.thisInput}`} + /> + setQuery({...query, category: e.value, offset:0})} + customClass={`width-24 ${classes.thisInput}`} + />*/} + { + return {label: s, value: s} + })} + lead={t('TransactionHistory.size')} + type="select" + value={{ + value: query?.limit, + label: query?.limit, + }} + onchange={pageSizeHandler} + customClass={`width-30 ${classes.thisInput}`} + /> + + + ]} + lead={t('TransactionHistory.period')} + type="input" + onChange={startDateHandler} + /*value={[query.startTime, query.endTime]}*/ + value={[query.startTime, query.endTime]} + dateSeparator={" " + t('to') + " "} + range + hideOnScroll + dataPanelPosition="Bottom" + position={`${i18n.language === "fa" ? "bottom-left" : "bottom-right" }`} + customClass={`width-30 ${classes.thisInput}`} + /> + +
+ {t("TransactionHistory.ascendingByTime")} + setQuery(prevState => {return { + ...prevState, + ascendingByTime: !prevState.ascendingByTime + }}) } + + /*onchange={()=> setQuery({ + ...query, + ascendingByTime: (prevState => !prevState)} + )}*/ + checked={!query?.ascendingByTime}/> +
+ +
+ +
+
+
+

{t("TransactionHistory.withdrawTx")}

+
+ {periodTextHandler()} +
+
+ +
+
+ +
+
+ {content()} +
+
+
+ +
+ +
+ ); +}; + +export default WithdrawHistory; diff --git a/src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/WithdrawHistory/WithdrawHistory.module.css b/src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/WithdrawHistory/WithdrawHistory.module.css new file mode 100644 index 00000000..7579db6f --- /dev/null +++ b/src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/WithdrawHistory/WithdrawHistory.module.css @@ -0,0 +1,17 @@ +.thisButton { + background-color: var(--orange); + color: #000; +} +.disable:disabled,.button[disabled] { + border: 0.3vh solid var(--cardBodyAlpha); + background: var(--cardBodyAlpha); + color: var(--textColor); + cursor: not-allowed; +} + +.thisButton:disabled,.button[disabled] { + border: 0.3vh solid var(--cardBodyAlpha); + background: var(--cardBodyAlpha); + color: var(--textColor); + cursor: not-allowed; +} \ No newline at end of file diff --git a/src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/WithdrawHistoryTable/WithdrawHistoryTable.js b/src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/WithdrawHistoryTable/WithdrawHistoryTable.js new file mode 100644 index 00000000..9e556755 --- /dev/null +++ b/src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/WithdrawHistoryTable/WithdrawHistoryTable.js @@ -0,0 +1,122 @@ +import React from 'react'; +import classes from './WithdrawHistoryTable.module.css' +import {useTranslation} from "react-i18next"; +import {useSelector} from "react-redux"; +import Date from "../../../../../../../../../../components/Date/Date"; +import moment from "moment-jalaali"; +import {BN} from "../../../../../../../../../../utils/utils"; + +const WithdrawHistoryTable = ({txs, offset}) => { + + const {t} = useTranslation(); + + const id = useSelector(state => state.auth.id); + + const txStatus = (status) => { + switch (status) { + case 0: + return t("orderStatus.NEW"); + case 1: + return t("orderStatus.DONE"); + case 2: + return t("orderStatus.REJECTED"); + default: + return t("orderStatus.NEW"); + } + }; + + let head = ( +
+ {t("row")} + {t("date")} + {t("time")} + {t("TransactionHistory.category")} + {t("TransactionHistory.coin")} + {t("DepositWithdraw.network")} + {t("volume")} + {t("status")} + {t("TransactionHistory.destAddress")} + {t("DepositWithdrawTx.transactionId")} + {t("TransactionHistory.type")} + {/*{t("details")}*/} + +
+ ); + let body = ( + <> + {txs.map((tr, index) => { + + const isMaker = tr?.additionalData?.makerUuid === id + const isTaker = tr?.additionalData?.takerUuid === id + + const isSelfTrade = (((tr?.additionalData?.takerDirection === "ASK") || ( tr?.additionalData?.makerDirection === "BID")) && isTaker && isMaker) + + return ( + +
+ +
+ + {index + offset + 1} + + + + + + {moment(tr.applyTime).format("HH:mm:ss")} + + + { t("TransactionCategory.WITHDRAW")} + + + + {t("currency." + tr.coin )} + + + + {tr.network} + + + + + {new BN(tr?.amount).toFormat()} + + + + {txStatus(tr.status)} + + + {tr.address} + + + {tr.txId} + + + + + + +
+ +
+ + + + ) + })} + + ); + + + + + + return ( + <> + {head} + {body} + + ); +}; + +export default WithdrawHistoryTable; diff --git a/src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/WithdrawHistoryTable/WithdrawHistoryTable.module.css b/src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/WithdrawHistoryTable/WithdrawHistoryTable.module.css new file mode 100644 index 00000000..e69de29b diff --git a/src/main/Browser/Pages/UserPanel/Sections/Header/Header.js b/src/main/Browser/Pages/UserPanel/Sections/Header/Header.js index 375dd10b..2d8a483d 100644 --- a/src/main/Browser/Pages/UserPanel/Sections/Header/Header.js +++ b/src/main/Browser/Pages/UserPanel/Sections/Header/Header.js @@ -4,7 +4,7 @@ import {useTranslation} from "react-i18next"; import {useDispatch, useSelector} from "react-redux"; import {Link, Route, Routes, useLocation} from "react-router-dom"; import * as RoutesName from "../../../../Routes/routes"; -import {Login} from "../../../../Routes/routes"; +import {Login, TransactionsRelative} from "../../../../Routes/routes"; import MarketHeader from "./components/MarketHeader/MarketHeader"; import WalletHeader from "./components/WalletHeader/WalletHeader"; import SettingHeader from "./components/SettingsHeader/SettingsHeader"; @@ -38,7 +38,7 @@ const Header = () => {
}> - {t("txHistory.title")}}/> + {t("txHistory.title")}}/> }/> }/> diff --git a/src/main/Browser/Pages/UserPanel/Sections/MainMenu/MainMenu.js b/src/main/Browser/Pages/UserPanel/Sections/MainMenu/MainMenu.js index cb76f448..12055d07 100644 --- a/src/main/Browser/Pages/UserPanel/Sections/MainMenu/MainMenu.js +++ b/src/main/Browser/Pages/UserPanel/Sections/MainMenu/MainMenu.js @@ -6,6 +6,7 @@ import {useTranslation} from "react-i18next"; import MessagesSubMenu from "../SubMenu/components/MessagesSubMenu/MessagesSubMenu"; import Icon from "../../../../../../components/Icon/Icon"; import {toAbsoluteUrl} from "../../../../../../utils/utils"; +import {Transactions} from "../../../../Routes/routes"; const MainMenu = () => { @@ -85,7 +86,7 @@ const MainMenu = () => { isActive ? classes.selected : undefined } diff --git a/src/main/Browser/Pages/UserPanel/UserPanel.js b/src/main/Browser/Pages/UserPanel/UserPanel.js index 84ce174e..bf98ff6a 100644 --- a/src/main/Browser/Pages/UserPanel/UserPanel.js +++ b/src/main/Browser/Pages/UserPanel/UserPanel.js @@ -8,11 +8,12 @@ import Info from "../../../../components/Info/Info"; import Content from "./Sections/Content/Content"; import {useSelector} from "react-redux"; import classes from "./UserPanel.module.css" +import {Transactions} from "../../Routes/routes"; const UserPanel = () => { const isLogin = useSelector((state) => state.auth.isLogin) - const isTxHistoryPage = useMatch(RoutesName.TxHistory) + const isTxHistoryPage = useMatch(RoutesName.Transactions) const isTechnicalPage = useMatch(RoutesName.Technical) const hasSubMenu = !(isTxHistoryPage || isTechnicalPage); diff --git a/src/main/Browser/Routes/routes.js b/src/main/Browser/Routes/routes.js index 8554edd0..b40f668f 100644 --- a/src/main/Browser/Routes/routes.js +++ b/src/main/Browser/Routes/routes.js @@ -19,6 +19,9 @@ export const UserForgetPasswordRelative = "forget-password"; export const TxHistory = "/panel/transaction-history"; export const TxHistoryRelative = "/transaction-history"; +export const Transactions = "/panel/transactions"; +export const TransactionsRelative = "/transactions"; + export const Wallet = "/panel/wallet"; diff --git a/src/queries/hooks/useGetBuyAndSellHistory.js b/src/queries/hooks/useGetBuyAndSellHistory.js new file mode 100644 index 00000000..46a384d1 --- /dev/null +++ b/src/queries/hooks/useGetBuyAndSellHistory.js @@ -0,0 +1,19 @@ +import {useQuery} from "@tanstack/react-query"; +import {getBuyAndSellHistory} from "js-api-client/client/txs"; + +export const useGetBuyAndSellHistory = (user_id, query) => { + + return useQuery( + ['buyAndSellHistory', user_id, query.coin, query.category, query.endTime, query.startTime, query.limit, query.offset, query.ascendingByTime], + () => getBuyAndSellHistoryFunc(user_id, query), + { + retry: 1, + staleTime: 5000, + refetchInterval: 10000, + }); +} + +const getBuyAndSellHistoryFunc = async (user_id, query) => { + const {data} = await getBuyAndSellHistory(user_id, query) + return data?.transactions; +} diff --git a/src/queries/hooks/useGetDepositHistory.js b/src/queries/hooks/useGetDepositHistory.js new file mode 100644 index 00000000..6a7f1552 --- /dev/null +++ b/src/queries/hooks/useGetDepositHistory.js @@ -0,0 +1,23 @@ +import {useQuery} from "@tanstack/react-query"; +import {getBuyAndSellHistory, getDepositHistory, getWithdrawHistory} from "js-api-client/client/txs"; + +export const useGetDepositHistory = (user_id, query) => { + + console.log("first query", query) + + return useQuery( + ['depositHistory', user_id, query.coin, query.category, query.endTime, query.startTime, query.limit, query.offset, query.ascendingByTime], + () => getDepositHistoryFunc(user_id, query), + { + retry: 1, + staleTime: 5000, + refetchInterval: 10000, + }); +} + +const getDepositHistoryFunc = async (user_id, query) => { + + console.log("second query", query) + const {data} = await getDepositHistory(user_id, query) + return data?.deposits; +} diff --git a/src/queries/hooks/useGetWithdrawHistory.js b/src/queries/hooks/useGetWithdrawHistory.js new file mode 100644 index 00000000..0522f65b --- /dev/null +++ b/src/queries/hooks/useGetWithdrawHistory.js @@ -0,0 +1,23 @@ +import {useQuery} from "@tanstack/react-query"; +import {getBuyAndSellHistory, getWithdrawHistory} from "js-api-client/client/txs"; + +export const useGetWithdrawHistory = (user_id, query) => { + + console.log("first query", query) + + return useQuery( + ['withdrawHistory', user_id, query.coin, query.category, query.endTime, query.startTime, query.limit, query.offset, query.ascendingByTime], + () => getWithdrawHistoryFunc(user_id, query), + { + retry: 1, + staleTime: 5000, + refetchInterval: 10000, + }); +} + +const getWithdrawHistoryFunc = async (user_id, query) => { + + console.log("second query", query) + const {data} = await getWithdrawHistory(user_id, query) + return data; +} diff --git a/src/queries/index.js b/src/queries/index.js index 6af95379..591985ef 100644 --- a/src/queries/index.js +++ b/src/queries/index.js @@ -21,4 +21,7 @@ export {useGetUserOtpStatus} from "./hooks/useGetUserOtpStatus"; export {useGetKycStatus} from "./hooks/useGetKycStatus"; export {useGetFeeForSymbol} from "./hooks/useGetFeeForSymbol"; export {useGetUserAssets} from "./hooks/useGetUserAssets"; -export {useGetUserAssetsEstimatedValue} from "./hooks/useGetUserAssetsEstimatedValue"; \ No newline at end of file +export {useGetUserAssetsEstimatedValue} from "./hooks/useGetUserAssetsEstimatedValue"; +export {useGetBuyAndSellHistory} from "./hooks/useGetBuyAndSellHistory"; +export {useGetWithdrawHistory} from "./hooks/useGetWithdrawHistory"; +export {useGetDepositHistory} from "./hooks/useGetDepositHistory"; \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index a831b18a..e8f8324f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9486,8 +9486,8 @@ __metadata: "js-api-client@https://github.com/opexdev/js-api-client.git#develop": version: 1.0.0-beta2 - resolution: "js-api-client@https://github.com/opexdev/js-api-client.git#commit=754533374a6d8c61a80fe95122810b33229815d0" - checksum: a97c02196681a0538c164fb3e0c8348eeee1a8a0fd984441ab257b9187675a4d7b71b16153dfc4f7399c7554fc94d1bdbb29d6422fd9c783b34130f1acd882e2 + resolution: "js-api-client@https://github.com/opexdev/js-api-client.git#commit=f656e7d42c77db27600a6715dd21247f42e46317" + checksum: 9a1466e5bdd5c99c17bdfadb829ec9f1363eef1824c9769423ffaed1c84d97bf83d12f8fee61c2e468c5abd100206a65086d2173dcb9220c316524c7a3bbfae3 languageName: node linkType: hard From 66b85001435849ed571d4a24d1d32d559b5798de Mon Sep 17 00:00:00 2001 From: Hossein Date: Sat, 29 Jun 2024 21:06:15 +0330 Subject: [PATCH 3/7] #199: Fix withdrawHistory query --- src/queries/hooks/useGetWithdrawHistory.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/queries/hooks/useGetWithdrawHistory.js b/src/queries/hooks/useGetWithdrawHistory.js index 0522f65b..257b1702 100644 --- a/src/queries/hooks/useGetWithdrawHistory.js +++ b/src/queries/hooks/useGetWithdrawHistory.js @@ -2,9 +2,6 @@ import {useQuery} from "@tanstack/react-query"; import {getBuyAndSellHistory, getWithdrawHistory} from "js-api-client/client/txs"; export const useGetWithdrawHistory = (user_id, query) => { - - console.log("first query", query) - return useQuery( ['withdrawHistory', user_id, query.coin, query.category, query.endTime, query.startTime, query.limit, query.offset, query.ascendingByTime], () => getWithdrawHistoryFunc(user_id, query), @@ -16,8 +13,6 @@ export const useGetWithdrawHistory = (user_id, query) => { } const getWithdrawHistoryFunc = async (user_id, query) => { - - console.log("second query", query) const {data} = await getWithdrawHistory(user_id, query) return data; } From 716bc2c3f062796847f88a00e9be873d74ba1f44 Mon Sep 17 00:00:00 2001 From: Hossein Date: Sat, 29 Jun 2024 21:25:33 +0330 Subject: [PATCH 4/7] Update contact-us locales --- public/assets/locales/en/translation.json | 6 +++++- public/assets/locales/fa/translation.json | 6 +++++- src/main/Browser/Pages/Info/ContactUs/ContactUs.js | 11 +++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/public/assets/locales/en/translation.json b/public/assets/locales/en/translation.json index f43e9fd1..e337689c 100644 --- a/public/assets/locales/en/translation.json +++ b/public/assets/locales/en/translation.json @@ -768,6 +768,10 @@ "contactUs": { "title": "Contact Us", "subTitle1": "Contact Us content", - "text1": "" + "text1": "", + "businessEmailsValue": "", + "businessEmails": "Business Email", + "supportRelated": "Support Related", + "supportRelatedValue": "" } } \ No newline at end of file diff --git a/public/assets/locales/fa/translation.json b/public/assets/locales/fa/translation.json index bc5fffee..801deefb 100644 --- a/public/assets/locales/fa/translation.json +++ b/public/assets/locales/fa/translation.json @@ -774,6 +774,10 @@ "contactUs": { "title": "تماس با ما", "subTitle1": "متن تماس با ما", - "text1": "" + "text1": "", + "businessEmailsValue": "", + "businessEmails": "ایمیل کسب و کار", + "supportRelated": "ایمیل پشتیبانی", + "supportRelatedValue": "" } } \ No newline at end of file diff --git a/src/main/Browser/Pages/Info/ContactUs/ContactUs.js b/src/main/Browser/Pages/Info/ContactUs/ContactUs.js index 32c740c9..72e1204e 100644 --- a/src/main/Browser/Pages/Info/ContactUs/ContactUs.js +++ b/src/main/Browser/Pages/Info/ContactUs/ContactUs.js @@ -10,6 +10,17 @@ const ContactUs = () => {
{t("contactUs.subTitle1")} {t("contactUs.text1")} + +
+ {t("contactUs.businessEmails")}: + {t("contactUs.businessEmailsValue")} +
+
+ + {t("contactUs.supportRelated")}: + {t("contactUs.supportRelatedValue")} +
+
); From a1278ee5e03a2d37e320422bd5c13f0e0d7adf24 Mon Sep 17 00:00:00 2001 From: Hossein Date: Sat, 29 Jun 2024 21:30:20 +0330 Subject: [PATCH 5/7] Update en locales file --- public/assets/locales/en/translation.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/public/assets/locales/en/translation.json b/public/assets/locales/en/translation.json index e337689c..d562dcf4 100644 --- a/public/assets/locales/en/translation.json +++ b/public/assets/locales/en/translation.json @@ -246,6 +246,12 @@ "estimateAlert": "The equivalent amount is calculated based on the highest buy offer" }, "TransactionHistory": { + "buyAndSell" : "Buy And Sell", + "buyAndSellTx" : "Buy And Sell History", + "withdrawTx" : "Withdraw History", + "depositTx" : "Deposit History", + "destAddress" : "Dest Address", + "txType" : "ُTransaction Type", "coin": "Coins", "category": "Categories", "size": "Number", From 1584d8ac726197ce619ae661252c20b6886dac30 Mon Sep 17 00:00:00 2001 From: Hossein Date: Sat, 29 Jun 2024 21:52:26 +0330 Subject: [PATCH 6/7] Fix transactions history navLink --- public/assets/locales/en/translation.json | 2 +- src/components/HeaderBuilder/HeaderBuilder.js | 6 ------ .../Layout/LayoutHeader/LayoutHeader.js | 2 +- .../DepositHistoryTable/DepositHistoryTable.js | 15 +-------------- .../WithdrawHistoryTable/WithdrawHistoryTable.js | 6 ++---- 5 files changed, 5 insertions(+), 26 deletions(-) diff --git a/public/assets/locales/en/translation.json b/public/assets/locales/en/translation.json index d562dcf4..64dcf069 100644 --- a/public/assets/locales/en/translation.json +++ b/public/assets/locales/en/translation.json @@ -251,7 +251,7 @@ "withdrawTx" : "Withdraw History", "depositTx" : "Deposit History", "destAddress" : "Dest Address", - "txType" : "ُTransaction Type", + "txType" : "Transaction Type", "coin": "Coins", "category": "Categories", "size": "Number", diff --git a/src/components/HeaderBuilder/HeaderBuilder.js b/src/components/HeaderBuilder/HeaderBuilder.js index 7c199e3b..72983dce 100644 --- a/src/components/HeaderBuilder/HeaderBuilder.js +++ b/src/components/HeaderBuilder/HeaderBuilder.js @@ -61,12 +61,6 @@ const HeaderBuilder = ({children}) => { to={Routes.AllMarket} className={({ isActive }) => isActive ? 'text-orange mx-1 cursor-pointer hover-text' : 'mx-1 cursor-pointer hover-text'} >{t("market.title")} - isActive ? 'text-orange mx-1 cursor-pointer hover-text' : 'mx-1 cursor-pointer hover-text'} - >{t("info.title")} - -
{firstName === null ? ( diff --git a/src/components/Layout/LayoutHeader/LayoutHeader.js b/src/components/Layout/LayoutHeader/LayoutHeader.js index 12ad32ef..ef6af30f 100644 --- a/src/components/Layout/LayoutHeader/LayoutHeader.js +++ b/src/components/Layout/LayoutHeader/LayoutHeader.js @@ -85,7 +85,7 @@ const LayoutHeader = () => {

-
navigate(RoutesName.TxHistory)}>{t("txHistory.title")}
+
navigate(RoutesName.Transactions)}>{t("txHistory.title")}
navigate(RoutesName.Settings)}>{t("settings.title")}
{t("signOut")}
diff --git a/src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/DepositHistoryTable/DepositHistoryTable.js b/src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/DepositHistoryTable/DepositHistoryTable.js index 959cc3c2..ebe88ec9 100644 --- a/src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/DepositHistoryTable/DepositHistoryTable.js +++ b/src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/DepositHistoryTable/DepositHistoryTable.js @@ -12,19 +12,6 @@ const DepositHistoryTable = ({txs, offset}) => { const id = useSelector(state => state.auth.id); - const txStatus = (status) => { - switch (status) { - case 0: - return t("orderStatus.NEW"); - case 1: - return t("orderStatus.DONE"); - case 2: - return t("orderStatus.REJECTED"); - default: - return t("orderStatus.NEW"); - } - }; - let head = (
{t("row")} @@ -80,7 +67,7 @@ const DepositHistoryTable = ({txs, offset}) => { - {txStatus(tr.status)} + {t("orderStatus.DONE")} {tr.depositType} diff --git a/src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/WithdrawHistoryTable/WithdrawHistoryTable.js b/src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/WithdrawHistoryTable/WithdrawHistoryTable.js index 9e556755..62a7f34f 100644 --- a/src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/WithdrawHistoryTable/WithdrawHistoryTable.js +++ b/src/main/Browser/Pages/UserPanel/Sections/Content/components/Transactions/components/WithdrawHistoryTable/WithdrawHistoryTable.js @@ -32,13 +32,11 @@ const WithdrawHistoryTable = ({txs, offset}) => { {t("time")} {t("TransactionHistory.category")} {t("TransactionHistory.coin")} - {t("DepositWithdraw.network")} + {t("DepositWithdraw.network")} {t("volume")} {t("status")} {t("TransactionHistory.destAddress")} {t("DepositWithdrawTx.transactionId")} - {t("TransactionHistory.type")} - {/*{t("details")}*/}
); @@ -73,7 +71,7 @@ const WithdrawHistoryTable = ({txs, offset}) => { {t("currency." + tr.coin )} - + {tr.network} From 06a6c7fe7b488be98494e9da78b782da20126a98 Mon Sep 17 00:00:00 2001 From: Hossein Date: Sat, 29 Jun 2024 22:01:50 +0330 Subject: [PATCH 7/7] #202: Add version number --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 80e72baa..e20c0ff1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "opex", - "version": "v1.0.7-beta.17", + "version": "v1.0.9-beta.18", "homepage": "", "private": true, "dependencies": {