diff --git a/README.md b/README.md index d8573879..15667177 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@

- Opex + Opex

# OPEX Web APP diff --git a/public/assets/locales/en/translation.json b/public/assets/locales/en/translation.json index bc1bd5ca..28e92207 100644 --- a/public/assets/locales/en/translation.json +++ b/public/assets/locales/en/translation.json @@ -595,7 +595,7 @@ "mostVolume": "Most Volume", "nullResponse": "No transactions in the last {{interval}}" }, - "footer": { + "Footer": { "darkMode": "Dark Mode", "aboutUs" : "About Us", "contactUS" : "Contact Us", @@ -606,7 +606,7 @@ "addCoin": "Add Coin", "demo": "Market Demo", "errorReport": "Error Report", - "copyright": "© 2021 OPEX. All rights reserved." + "copyright": "© {{year}} OPEX. All rights reserved." }, "ImageInput": { "title": "", @@ -621,5 +621,102 @@ "needKYC" : "Access denied for KYC status", "reload" : "Try Again", "errorText" : "Server connection error" + }, + "aboutUs": { + "title": "About US", + "text1": "About US content", + "p1": "", + "p2": "", + "p3": "", + "p4": "", + "text2": "", + "subTitle1": "", + "text3": "", + "p5": "", + "p6": "", + "p7": "", + "p8": "", + "p9": "", + "p10": "", + "subTitle2": "", + "text4": "", + "subTitle3": "", + "p11": "", + "p12": "", + "p13": "", + "text5": "" + }, + "commissions": { + "title": "Commission", + "subTitle1": "Commission content", + "text1": "", + "p1": "", + "p2": "", + "p3": "", + "p4": "", + "p5": "", + "p6": "", + "text2": "", + "text3": "", + "p7": "", + "p8": "", + "p9": "", + "text4": "" + + }, + "transferFees": { + "title": "Transfer Fees", + "text1": "Transfer Fees content", + "p1": "", + "p2": "", + "p3": "", + "p4": "", + "p5": "", + "text2": "", + "text3": "", + "text4": "", + "subTitle1": "", + "text5": "", + "subTitle2": "", + "text6": "", + "subTitle3": "", + "text7": "", + "subTitle4": "", + "text8": "" + }, + "guide": { + "title": "Guide", + "subTitle1": "Guide content", + "p1": "", + "p2": "", + "p3": "", + "p4": "", + "p5": "", + "p6": "", + "subTitle2": "", + "p7": "", + "p8": "", + "p9": "", + "p10": "" + }, + "rules": { + "title": "Rules", + "subTitle1": "Rules content", + "p1": "", + "p2": "", + "p3": "", + "p4": "", + "p5": "", + "p6": "", + "subTitle2": "", + "p7": "", + "p8": "", + "p9": "", + "p10": "" + }, + "contactUs": { + "title": "Contact Us", + "subTitle1": "Contact Us content", + "text1": "" } } \ No newline at end of file diff --git a/public/assets/locales/fa/translation.json b/public/assets/locales/fa/translation.json index d0e80fc1..bb1dd396 100644 --- a/public/assets/locales/fa/translation.json +++ b/public/assets/locales/fa/translation.json @@ -46,7 +46,7 @@ "unit": "واحد", "offline": "اتصال اینترنت را بررسی کنید!", "improperMobileView ": "فعلاً برای موبایل بهینه نشده است.", - "home": "صفحه‌اصلی", + "home": "صفحه اصلی", "country": { "iran" : "جمهوری اسلامی ایران", "germany" : "آلمان", @@ -595,7 +595,7 @@ "mostVolume": "بیشترین حجم معامله", "nullResponse": "در {{interval}} گذشته معامله‌ای انجام نشده" }, - "footer": { + "Footer": { "darkMode": "تم تاریک", "aboutUs": "درباره ما", "contactUS": "تماس با ما", @@ -606,7 +606,7 @@ "addCoin": "درخواست افزودن سکه یا توکن", "demo": "بازار نمایشی (ویژه تمرین رایگان)", "errorReport": "گزارش خطا و مشکل", - "copyright": "1400 - کلیه حقوق برای شرکت تجربه کاربری متن باز (در شرف تاُسیس) محفوظ است." + "copyright": "{{year}} - کلیه حقوق برای شرکت تجربه کاربری متن باز (در شرف تاُسیس) محفوظ است." }, "ImageInput": { "title": "", @@ -621,5 +621,102 @@ "needKYC" : "دسترسی این بخش فقط برای کاربران احراز هویت شده مجاز است!", "reload" : "تلاش مجدد", "errorText" : "خطا در ارتباط با سرور" + }, + "aboutUs": { + "title": "درباره ما", + "text1": "متن درباره ما", + "p1": "", + "p2": "", + "p3": "", + "p4": "", + "text2": "", + "subTitle1": "", + "text3": "", + "p5": "", + "p6": "", + "p7": "", + "p8": "", + "p9": "", + "p10": "", + "subTitle2": "", + "text4": "", + "subTitle3": "", + "p11": "", + "p12": "", + "p13": "", + "text5": "" + }, + "commissions": { + "title": "کارمزد", + "subTitle1": "متن کارمزدها", + "text1": "", + "p1": "", + "p2": "", + "p3": "", + "p4": "", + "p5": "", + "p6": "", + "text2": "", + "text3": "", + "p7": "", + "p8": "", + "p9": "", + "text4": "" + + }, + "transferFees": { + "title": "کارمزد انتقال", + "text1": "متن کارمزد انتقال", + "p1": "", + "p2": "", + "p3": "", + "p4": "", + "p5": "", + "text2": "", + "text3": "", + "text4": "", + "subTitle1": "", + "text5": "", + "subTitle2": "", + "text6": "", + "subTitle3": "", + "text7": "", + "subTitle4": "", + "text8": "" + }, + "guide": { + "title": "راهنما", + "subTitle1": "متن راهنما", + "p1": "", + "p2": "", + "p3": "", + "p4": "", + "p5": "", + "p6": "", + "subTitle2": "", + "p7": "", + "p8": "", + "p9": "", + "p10": "" + }, + "rules": { + "title": "قوانین", + "subTitle1": "متن قوانین", + "p1": "", + "p2": "", + "p3": "", + "p4": "", + "p5": "", + "p6": "", + "subTitle2": "", + "p7": "", + "p8": "", + "p9": "", + "p10": "" + }, + "contactUs": { + "title": "تماس با ما", + "subTitle1": "متن تماس با ما", + "text1": "" } } \ No newline at end of file diff --git a/src/components/HeaderBuilder/HeaderBuilder.js b/src/components/HeaderBuilder/HeaderBuilder.js index 035d8293..7c199e3b 100644 --- a/src/components/HeaderBuilder/HeaderBuilder.js +++ b/src/components/HeaderBuilder/HeaderBuilder.js @@ -61,6 +61,11 @@ 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")} +
diff --git a/src/components/Layout/Layout.js b/src/components/Layout/Layout.js new file mode 100644 index 00000000..9e9d5bfd --- /dev/null +++ b/src/components/Layout/Layout.js @@ -0,0 +1,23 @@ +import React from 'react'; +import classes from './Layout.module.css' +import {images} from "../../assets/images"; +import LayoutHeader from "./LayoutHeader/LayoutHeader"; +import {Outlet} from "react-router-dom"; +import Footer from "../../main/Browser/Pages/UserPanel/Sections/Footer/Footer"; +import ScrollBar from "../ScrollBar"; + +const Layout = () => { + return ( +
+ +
+ + +
+ +
+
+ ); +}; + +export default Layout; diff --git a/src/components/Layout/Layout.module.css b/src/components/Layout/Layout.module.css new file mode 100644 index 00000000..c4cdb4c9 --- /dev/null +++ b/src/components/Layout/Layout.module.css @@ -0,0 +1,8 @@ +.container { + height: 100vh; + background-color: var(--mainContent); + position: relative; +} +.content { + height: 88vh; +} \ No newline at end of file diff --git a/src/components/Layout/LayoutHeader/LayoutHeader.js b/src/components/Layout/LayoutHeader/LayoutHeader.js new file mode 100644 index 00000000..0b61aaf7 --- /dev/null +++ b/src/components/Layout/LayoutHeader/LayoutHeader.js @@ -0,0 +1,127 @@ +import React from 'react'; +import classes from './LayoutHeader.module.css'; +import {useTranslation} from "react-i18next"; +import {Link, NavLink, Route, Routes, useLocation, useParams} from "react-router-dom"; +import * as RoutesName from "../../../main/Browser/Routes/routes"; +import {Commission, Login} from "../../../main/Browser/Routes/routes"; +import {toAbsoluteUrl} from "../../../utils/utils"; +import Clock from "../../../main/Browser/Pages/UserPanel/Sections/Header/components/Clock/Clock"; +import {images} from "../../../assets/images"; +import {useDispatch, useSelector} from "react-redux"; +import {logout} from "js-api-client"; +import {toast} from "react-hot-toast"; +import {setLogoutInitiate} from "../../../store/actions"; +import AboutUs from "../../../main/Browser/Pages/Info/AboutUs/AboutUs"; + +const LayoutHeader = () => { + const {t} = useTranslation(); + + const dispatch = useDispatch(); + + const isLogin = useSelector((state) => state.auth.isLogin) + const firstName = useSelector((state) => state.auth.firstName) + const lastName = useSelector((state) => state.auth.lastName) + const location = useLocation(); + + const interval = useSelector((state) => state.global.marketInterval) + + const logOutHandler = async () => { + logout().then(() => { + toast.success(t("header.logOutSuccess")) + dispatch(setLogoutInitiate()) + }).catch(() => { + toast.error(t("header.logOutError")); + }) + } + + return ( +
+
+ + {t("title")} + +
+ + {t("Landing.title")}}/> + {t("commissions.title")}}/> + {t("aboutUs.title")}}/> + {t("transferFees.title")}}/> + {t("guide.title")}}/> + {t("rules.title")}}/> + {t("contactUs.title")}}/> + +

{t("market.title")}

+ ( {t("marketInterval." + interval)} ) +
}/> + +
+
+ + isActive ? 'text-orange mx-1 cursor-pointer hover-text' : 'mx-1 cursor-pointer hover-text'} + >{t("home")} + {/* {t("MarketTitle.easyTrading")}*/} + isActive ? 'text-orange mx-1 cursor-pointer hover-text' : 'mx-1 cursor-pointer hover-text'} + >{t("MarketTitle.advancedTrading")} + isActive ? 'text-orange mx-1 cursor-pointer hover-text' : 'mx-1 cursor-pointer hover-text'} + >{t("market.title")} + +
+
+ {firstName === null ? ( + +

{t("signIn")} | {t("signUp")}

+ + ) : ( +

+ {firstName + " " + lastName} +

+ )} + {/*

+ +

*/} + +
+ +
+ {isLogin ? ( + {t("signOut")}${t("signOut")}`} + /> + ) : ( + + ${t("signIn")}`} + alt={t("signIn")} + data-tooltip-id="opex-tooltip" + data-tooltip-place="right" + /> + + )} +
+ + + +
+
+ ); +}; + +export default LayoutHeader; diff --git a/src/components/Layout/LayoutHeader/LayoutHeader.module.css b/src/components/Layout/LayoutHeader/LayoutHeader.module.css new file mode 100644 index 00000000..75fc7f66 --- /dev/null +++ b/src/components/Layout/LayoutHeader/LayoutHeader.module.css @@ -0,0 +1,6 @@ +.container { + height: 12vh; + background-color: var(--menu); +} +.content { +} \ No newline at end of file diff --git a/src/components/ScrollBar/index.js b/src/components/ScrollBar/index.js index ac6e1592..f7ec8fff 100644 --- a/src/components/ScrollBar/index.js +++ b/src/components/ScrollBar/index.js @@ -1,7 +1,16 @@ -import React from "react"; +import React, {useEffect, useRef} from "react"; import {Scrollbars} from "rc-scrollbars"; +import {useLocation} from "react-router-dom"; const ScrollBar = ({customClass, ...props}) => { + + const location = useLocation(); + const scrollRef = useRef(null); + + useEffect(() => { + scrollRef.current.scrollTop() + }, [location.pathname]); + const style = props.style ? props.style : {width: "100%", height: "100%"}; return ( {
)} renderView={(props) =>
} + ref={scrollRef} style={style}> {props.children} diff --git a/src/main/Browser/Browser.js b/src/main/Browser/Browser.js index 0462e385..6d352777 100644 --- a/src/main/Browser/Browser.js +++ b/src/main/Browser/Browser.js @@ -5,7 +5,6 @@ import i18n from "i18next"; import * as RoutesName from "./Routes/routes"; import {Toaster} from "react-hot-toast"; import Login from "./Pages/Login/Login"; -import Guide from "./Pages/Guide/Guide"; import FullWidthLoading from "../../components/FullWidthLoading/FullWidthLoading"; import {loadConfig, setInfoMessage} from "../../store/actions"; import "./Styles/Browser.css" @@ -16,6 +15,13 @@ import Landing from "./Pages/Landing/Landing"; import AllMarket from "./Pages/AllMarket/AllMarket"; import UserPanel from "./Pages/UserPanel/UserPanel"; import {Tooltip} from "react-tooltip"; +import Layout from "../../components/Layout/Layout"; +import AboutUs from "./Pages/Info/AboutUs/AboutUs"; +import Commission from "./Pages/Info/Commission/Commission"; +import TransferFees from "./Pages/Info/TransferFees/TransferFees"; +import Guide from "./Pages/Info/Guide/Guide"; +import Rules from "./Pages/Info/Rules/Rules"; +import ContactUs from "./Pages/Info/ContactUs/ContactUs"; const Browser = () => { const query = useQuery(); @@ -81,10 +87,20 @@ const Browser = () => { }/> }/> - }/> - }/> - }/> + + }/> + + }> + }/> + }/> + }/> + }/> + }/> + }/> + }/> + }/> + diff --git a/src/main/Browser/Pages/AllMarket/AllMarket.js b/src/main/Browser/Pages/AllMarket/AllMarket.js index 20a2e38c..aa6b140d 100644 --- a/src/main/Browser/Pages/AllMarket/AllMarket.js +++ b/src/main/Browser/Pages/AllMarket/AllMarket.js @@ -1,15 +1,29 @@ import React from 'react'; import classes from "./AllMarket.module.css"; -import AllMarketHeader from "./Sections/AllMarketHeader/AllMarketHeader"; -import AllMarketContent from "./Sections/AllMarketContent/AllMarketContent"; import {images} from "../../../../assets/images"; +import PriceInfo from "./components/PriceInfo/PriceInfo"; +import Swing from "./components/Swing/Swing"; +import VolumeInfo from "./components/VolumeInfo/VolumeInfo"; +import AllMarketInfo from "./components/AllMarketInfo/AllMarketInfo"; const AllMarket = () => { return ( -
- - +
+
+
+ +
+
+ +
+
+ +
+
+
+ +
); } diff --git a/src/main/Browser/Pages/AllMarket/AllMarket.module.css b/src/main/Browser/Pages/AllMarket/AllMarket.module.css index cc62fe76..c884f19e 100644 --- a/src/main/Browser/Pages/AllMarket/AllMarket.module.css +++ b/src/main/Browser/Pages/AllMarket/AllMarket.module.css @@ -1,7 +1,4 @@ .container { - height: 100vh; - background-color: var(--mainContent); - position: relative; background-repeat: repeat; background-position: center center; background-size: 600px 1200px; diff --git a/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/AllMarketContent.js b/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/AllMarketContent.js deleted file mode 100644 index dc60218e..00000000 --- a/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/AllMarketContent.js +++ /dev/null @@ -1,35 +0,0 @@ -import React from 'react'; -import classes from './AllMarketContent.module.css' -import ScrollBar from "../../../../../../components/ScrollBar"; -import Footer from "../../../UserPanel/Sections/Footer/Footer"; -import Swing from "./components/Swing/Swing"; -import AllMarketInfo from "./components/AllMarketInfo/AllMarketInfo"; -import PriceInfo from "./components/PriceInfo/PriceInfo"; -import VolumeInfo from "./components/VolumeInfo/VolumeInfo"; - -const AllMarketContent = () => { - - return ( -
- -
-
- -
-
- -
-
- -
-
-
- -
-
- -
- ); -}; - -export default AllMarketContent; \ No newline at end of file diff --git a/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/AllMarketContent.module.css b/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/AllMarketContent.module.css deleted file mode 100644 index 33508efd..00000000 --- a/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/AllMarketContent.module.css +++ /dev/null @@ -1,3 +0,0 @@ -.container { - height: 88vh; -} diff --git a/src/main/Browser/Pages/AllMarket/Sections/AllMarketHeader/AllMarketHeader.js b/src/main/Browser/Pages/AllMarket/Sections/AllMarketHeader/AllMarketHeader.js deleted file mode 100644 index edc46ae9..00000000 --- a/src/main/Browser/Pages/AllMarket/Sections/AllMarketHeader/AllMarketHeader.js +++ /dev/null @@ -1,21 +0,0 @@ -import React from 'react'; -import {useTranslation} from "react-i18next"; -import HeaderBuilder from "../../../../../../components/HeaderBuilder/HeaderBuilder"; -import {useSelector} from "react-redux"; - -const AllMarketHeader = () => { - - const {t} = useTranslation(); - const interval = useSelector((state) => state.global.marketInterval) - - return ( - -
-

{t("market.title")}

- ( {t("marketInterval." + interval)} ) -
-
- ); -}; - -export default AllMarketHeader; \ No newline at end of file diff --git a/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/AllMarketInfo/AllMarketInfo.js b/src/main/Browser/Pages/AllMarket/components/AllMarketInfo/AllMarketInfo.js similarity index 91% rename from src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/AllMarketInfo/AllMarketInfo.js rename to src/main/Browser/Pages/AllMarket/components/AllMarketInfo/AllMarketInfo.js index fe483b07..049e5d9f 100644 --- a/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/AllMarketInfo/AllMarketInfo.js +++ b/src/main/Browser/Pages/AllMarket/components/AllMarketInfo/AllMarketInfo.js @@ -1,13 +1,13 @@ import React, {useState} from 'react'; import classes from './AllMarketInfo.module.css' -import Icon from "../../../../../../../../components/Icon/Icon"; +import Icon from "../../../../../../components/Icon/Icon"; import AllMarketInfoCard from "./components/AllMarketInfoCard/AllMarketInfoCard"; import AllMarketInfoTable from "./components/AllMarketInfoTable/AllMarketInfoTable"; -import {useGetQuoteCurrencies, useOverview} from "../../../../../../../../queries"; +import {useGetQuoteCurrencies, useOverview} from "../../../../../../queries"; import {useDispatch, useSelector} from "react-redux"; -import Loading from "../../../../../../../../components/Loading/Loading"; -import Error from "../../../../../../../../components/Error/Error"; -import {setMarketInterval} from "../../../../../../../../store/actions"; +import Loading from "../../../../../../components/Loading/Loading"; +import Error from "../../../../../../components/Error/Error"; +import {setMarketInterval} from "../../../../../../store/actions"; import {useTranslation} from "react-i18next"; const AllMarketInfo = () => { diff --git a/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/AllMarketInfo/AllMarketInfo.module.css b/src/main/Browser/Pages/AllMarket/components/AllMarketInfo/AllMarketInfo.module.css similarity index 100% rename from src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/AllMarketInfo/AllMarketInfo.module.css rename to src/main/Browser/Pages/AllMarket/components/AllMarketInfo/AllMarketInfo.module.css diff --git a/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/AllMarketInfo/components/AllMarketInfoCard/AllMarketInfoCard.js b/src/main/Browser/Pages/AllMarket/components/AllMarketInfo/components/AllMarketInfoCard/AllMarketInfoCard.js similarity index 94% rename from src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/AllMarketInfo/components/AllMarketInfoCard/AllMarketInfoCard.js rename to src/main/Browser/Pages/AllMarket/components/AllMarketInfo/components/AllMarketInfoCard/AllMarketInfoCard.js index e93a35b4..a3741bbd 100644 --- a/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/AllMarketInfo/components/AllMarketInfoCard/AllMarketInfoCard.js +++ b/src/main/Browser/Pages/AllMarket/components/AllMarketInfo/components/AllMarketInfoCard/AllMarketInfoCard.js @@ -1,11 +1,11 @@ import React, {useState} from 'react'; 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 {setActivePairInitiate} from "../../../../../../../../../../store/actions"; -import {Panel} from "../../../../../../../../Routes/routes"; +import {images} from "../../../../../../../../assets/images"; +import Button from "../../../../../../../../components/Button/Button"; +import {BN} from "../../../../../../../../utils/utils"; +import {setActivePairInitiate} from "../../../../../../../../store/actions"; +import {Panel} from "../../../../../../Routes/routes"; import {useNavigate} from "react-router-dom"; import {useDispatch, useSelector} from "react-redux"; import i18n from "i18next"; diff --git a/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/AllMarketInfo/components/AllMarketInfoCard/AllMarketInfoCard.module.css b/src/main/Browser/Pages/AllMarket/components/AllMarketInfo/components/AllMarketInfoCard/AllMarketInfoCard.module.css similarity index 100% rename from src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/AllMarketInfo/components/AllMarketInfoCard/AllMarketInfoCard.module.css rename to src/main/Browser/Pages/AllMarket/components/AllMarketInfo/components/AllMarketInfoCard/AllMarketInfoCard.module.css diff --git a/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/AllMarketInfo/components/AllMarketInfoTable/AllMarketInfoTable.js b/src/main/Browser/Pages/AllMarket/components/AllMarketInfo/components/AllMarketInfoTable/AllMarketInfoTable.js similarity index 93% rename from src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/AllMarketInfo/components/AllMarketInfoTable/AllMarketInfoTable.js rename to src/main/Browser/Pages/AllMarket/components/AllMarketInfo/components/AllMarketInfoTable/AllMarketInfoTable.js index 878ea143..ca325345 100644 --- a/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/AllMarketInfo/components/AllMarketInfoTable/AllMarketInfoTable.js +++ b/src/main/Browser/Pages/AllMarket/components/AllMarketInfo/components/AllMarketInfoTable/AllMarketInfoTable.js @@ -1,12 +1,12 @@ import React from 'react'; import classes from './AllMarketInfoTable.module.css' import {useTranslation} from "react-i18next"; -import {images} from "../../../../../../../../../../assets/images"; -import Button from "../../../../../../../../../../components/Button/Button"; -import {BN} from "../../../../../../../../../../utils/utils"; +import {images} from "../../../../../../../../assets/images"; +import Button from "../../../../../../../../components/Button/Button"; +import {BN} from "../../../../../../../../utils/utils"; import i18n from "i18next"; -import {setActivePairInitiate} from "../../../../../../../../../../store/actions"; -import {Panel} from "../../../../../../../../Routes/routes"; +import {setActivePairInitiate} from "../../../../../../../../store/actions"; +import {Panel} from "../../../../../../Routes/routes"; import {useNavigate} from "react-router-dom"; import {useDispatch, useSelector} from "react-redux"; diff --git a/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/AllMarketInfo/components/AllMarketInfoTable/AllMarketInfoTable.module.css b/src/main/Browser/Pages/AllMarket/components/AllMarketInfo/components/AllMarketInfoTable/AllMarketInfoTable.module.css similarity index 100% rename from src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/AllMarketInfo/components/AllMarketInfoTable/AllMarketInfoTable.module.css rename to src/main/Browser/Pages/AllMarket/components/AllMarketInfo/components/AllMarketInfoTable/AllMarketInfoTable.module.css diff --git a/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/PriceInfo/PriceInfo.js b/src/main/Browser/Pages/AllMarket/components/PriceInfo/PriceInfo.js similarity index 92% rename from src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/PriceInfo/PriceInfo.js rename to src/main/Browser/Pages/AllMarket/components/PriceInfo/PriceInfo.js index 53607ee1..edd579e8 100644 --- a/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/PriceInfo/PriceInfo.js +++ b/src/main/Browser/Pages/AllMarket/components/PriceInfo/PriceInfo.js @@ -1,10 +1,10 @@ import React from 'react'; import classes from './PriceInfo.module.css' import {useTranslation} from "react-i18next"; -import {useGetMarketStats} from "../../../../../../../../queries"; +import {useGetMarketStats} from "../../../../../../queries"; import {useSelector} from "react-redux"; -import Loading from "../../../../../../../../components/Loading/Loading"; -import Error from "../../../../../../../../components/Error/Error"; +import Loading from "../../../../../../components/Loading/Loading"; +import Error from "../../../../../../components/Error/Error"; import MostIncreasedPrice from "./components/MostIncreasedPrice/MostIncreasedPrice"; import MostDecreasedPrice from "./components/MostDecreasedPrice/MostDecreasedPrice"; diff --git a/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/PriceInfo/PriceInfo.module.css b/src/main/Browser/Pages/AllMarket/components/PriceInfo/PriceInfo.module.css similarity index 100% rename from src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/PriceInfo/PriceInfo.module.css rename to src/main/Browser/Pages/AllMarket/components/PriceInfo/PriceInfo.module.css diff --git a/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/PriceInfo/components/MostDecreasedPrice/MostDecreasedPrice.js b/src/main/Browser/Pages/AllMarket/components/PriceInfo/components/MostDecreasedPrice/MostDecreasedPrice.js similarity index 90% rename from src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/PriceInfo/components/MostDecreasedPrice/MostDecreasedPrice.js rename to src/main/Browser/Pages/AllMarket/components/PriceInfo/components/MostDecreasedPrice/MostDecreasedPrice.js index 7d2415e3..26fb0843 100644 --- a/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/PriceInfo/components/MostDecreasedPrice/MostDecreasedPrice.js +++ b/src/main/Browser/Pages/AllMarket/components/PriceInfo/components/MostDecreasedPrice/MostDecreasedPrice.js @@ -1,7 +1,7 @@ import React from 'react'; -import {images} from "../../../../../../../../../../assets/images"; +import {images} from "../../../../../../../../assets/images"; import i18n from "i18next"; -import {BN} from "../../../../../../../../../../utils/utils"; +import {BN} from "../../../../../../../../utils/utils"; import {useTranslation} from "react-i18next"; const MostDecreasedPrice = ({mostDecreasedPrice}) => { diff --git a/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/PriceInfo/components/MostIncreasedPrice/MostIncreasedPrice.js b/src/main/Browser/Pages/AllMarket/components/PriceInfo/components/MostIncreasedPrice/MostIncreasedPrice.js similarity index 90% rename from src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/PriceInfo/components/MostIncreasedPrice/MostIncreasedPrice.js rename to src/main/Browser/Pages/AllMarket/components/PriceInfo/components/MostIncreasedPrice/MostIncreasedPrice.js index f64b7c50..1e4b60a8 100644 --- a/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/PriceInfo/components/MostIncreasedPrice/MostIncreasedPrice.js +++ b/src/main/Browser/Pages/AllMarket/components/PriceInfo/components/MostIncreasedPrice/MostIncreasedPrice.js @@ -1,7 +1,7 @@ import React from 'react'; -import {images} from "../../../../../../../../../../assets/images"; +import {images} from "../../../../../../../../assets/images"; import i18n from "i18next"; -import {BN} from "../../../../../../../../../../utils/utils"; +import {BN} from "../../../../../../../../utils/utils"; import {useTranslation} from "react-i18next"; const MostIncreasedPrice = ({mostIncreasedPrice}) => { diff --git a/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/Swing/Swing.js b/src/main/Browser/Pages/AllMarket/components/Swing/Swing.js similarity index 96% rename from src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/Swing/Swing.js rename to src/main/Browser/Pages/AllMarket/components/Swing/Swing.js index 0b825cb9..bf66c631 100644 --- a/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/Swing/Swing.js +++ b/src/main/Browser/Pages/AllMarket/components/Swing/Swing.js @@ -1,6 +1,6 @@ import React, {useState} from 'react'; import classes from './Swing.module.css' -import {images} from "../../../../../../../../assets/images"; +import {images} from "../../../../../../assets/images"; const Swing = () => { diff --git a/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/Swing/Swing.module.css b/src/main/Browser/Pages/AllMarket/components/Swing/Swing.module.css similarity index 100% rename from src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/Swing/Swing.module.css rename to src/main/Browser/Pages/AllMarket/components/Swing/Swing.module.css diff --git a/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/VolumeInfo/VolumeInfo.js b/src/main/Browser/Pages/AllMarket/components/VolumeInfo/VolumeInfo.js similarity index 88% rename from src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/VolumeInfo/VolumeInfo.js rename to src/main/Browser/Pages/AllMarket/components/VolumeInfo/VolumeInfo.js index abd5e806..603d3686 100644 --- a/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/VolumeInfo/VolumeInfo.js +++ b/src/main/Browser/Pages/AllMarket/components/VolumeInfo/VolumeInfo.js @@ -1,13 +1,13 @@ import React from 'react'; import classes from './VolumeInfo.module.css' import {useTranslation} from "react-i18next"; -import {useGetMarketStats} from "../../../../../../../../queries"; +import {useGetMarketStats} from "../../../../../../queries"; import {useSelector} from "react-redux"; -import Loading from "../../../../../../../../components/Loading/Loading"; -import Error from "../../../../../../../../components/Error/Error"; +import Loading from "../../../../../../components/Loading/Loading"; +import Error from "../../../../../../components/Error/Error"; import MostVolume from "./components/MostVolume/MostVolume"; import MostTrades from "./components/MostTrades/MostTrades"; -import NullMarketStats from "../../../../../../../../components/NullMarketStats/NullMarketStats"; +import NullMarketStats from "../../../../../../components/NullMarketStats/NullMarketStats"; const VolumeInfo = () => { diff --git a/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/VolumeInfo/VolumeInfo.module.css b/src/main/Browser/Pages/AllMarket/components/VolumeInfo/VolumeInfo.module.css similarity index 100% rename from src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/VolumeInfo/VolumeInfo.module.css rename to src/main/Browser/Pages/AllMarket/components/VolumeInfo/VolumeInfo.module.css diff --git a/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/VolumeInfo/components/MostTrades/MostTrades.js b/src/main/Browser/Pages/AllMarket/components/VolumeInfo/components/MostTrades/MostTrades.js similarity index 86% rename from src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/VolumeInfo/components/MostTrades/MostTrades.js rename to src/main/Browser/Pages/AllMarket/components/VolumeInfo/components/MostTrades/MostTrades.js index 270276aa..6eda6b87 100644 --- a/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/VolumeInfo/components/MostTrades/MostTrades.js +++ b/src/main/Browser/Pages/AllMarket/components/VolumeInfo/components/MostTrades/MostTrades.js @@ -1,7 +1,7 @@ import React from 'react'; -import {images} from "../../../../../../../../../../assets/images"; +import {images} from "../../../../../../../../assets/images"; import i18n from "i18next"; -import {BN} from "../../../../../../../../../../utils/utils"; +import {BN} from "../../../../../../../../utils/utils"; import {useTranslation} from "react-i18next"; const MostTrades = ({mostTrades}) => { diff --git a/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/VolumeInfo/components/MostVolume/MostVolume.js b/src/main/Browser/Pages/AllMarket/components/VolumeInfo/components/MostVolume/MostVolume.js similarity index 90% rename from src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/VolumeInfo/components/MostVolume/MostVolume.js rename to src/main/Browser/Pages/AllMarket/components/VolumeInfo/components/MostVolume/MostVolume.js index 064b1f1c..f8a7ad9e 100644 --- a/src/main/Browser/Pages/AllMarket/Sections/AllMarketContent/components/VolumeInfo/components/MostVolume/MostVolume.js +++ b/src/main/Browser/Pages/AllMarket/components/VolumeInfo/components/MostVolume/MostVolume.js @@ -1,7 +1,7 @@ import React from 'react'; -import {images} from "../../../../../../../../../../assets/images"; +import {images} from "../../../../../../../../assets/images"; import i18n from "i18next"; -import {BN} from "../../../../../../../../../../utils/utils"; +import {BN} from "../../../../../../../../utils/utils"; import {useTranslation} from "react-i18next"; const MostVolume = ({mostVolume}) => { diff --git a/src/main/Browser/Pages/Guide/Guide.js b/src/main/Browser/Pages/Guide/Guide.js deleted file mode 100644 index f1f0f713..00000000 --- a/src/main/Browser/Pages/Guide/Guide.js +++ /dev/null @@ -1,176 +0,0 @@ -import React, {useEffect, useState} from "react"; -import {useSelector} from "react-redux"; -import classes from "./Guide.module.css"; -import i18n from "i18next"; -import {NavLink, useLocation, useNavigate} from "react-router-dom"; - -import {useTranslation} from "react-i18next"; -import Button from "../../../../components/Button/Button"; -import ScrollBar from "../../../../components/ScrollBar"; -import * as Routes from "../../Routes/routes"; -import HashContent from "./components/HashContent/HashContent"; -import {toAbsoluteUrl} from "../../../../utils/utils"; - -const Guide = () => { - const {t} = useTranslation(); - const [ltr, setLtr] = useState(false); - const navigate = useNavigate(); - const location = useLocation (); - const isDark = useSelector((state) => state.global.isDark) - - useEffect(() => { - i18n.language !== "fa" ? setLtr(true) : setLtr(false); - i18n.on("languageChanged", (lng) => { - lng !== "fa" ? setLtr(true) : setLtr(false); - }); - }, []); - - return ( -
-
-
- {t("title")} -
- -
- - location.hash === "#about-us" ? `${classes.navMenu} ${classes.selected}` : classes.navMenu - }> - {t("footer.aboutUs")} - - - location.hash === "#contact-us" ? `${classes.navMenu} ${classes.selected}` : classes.navMenu - }> - {t("footer.contactUS")} - - - location.hash === "#blog" ? `${classes.navMenu} ${classes.selected}` : classes.navMenu - }> - {t("footer.blog")} - - - location.hash === "#guides" ? `${classes.navMenu} ${classes.selected}` : classes.navMenu - }> - {t("footer.guide")} - - - location.hash === "#rules" ? `${classes.navMenu} ${classes.selected}` : classes.navMenu - }> - {t("footer.rules")} - - - location.hash === "#commission" ? `${classes.navMenu} ${classes.selected}` : classes.navMenu - }> - {t("commission")} - - - location.hash === "#api" ? `${classes.navMenu} ${classes.selected}` : classes.navMenu - }> - {t("footer.api")} - - - location.hash === "#addCoin" ? `${classes.navMenu} ${classes.selected}` : classes.navMenu - }> - {t("footer.addCoin")} - - - location.hash === "#demo" ? `${classes.navMenu} ${classes.selected}` : classes.navMenu - }> - {t("footer.demo")} - - - location.hash === "#errorReport" ? `${classes.navMenu} ${classes.selected}` : classes.navMenu - }> - {t("footer.errorReport")} - -
-
- -
- - - - - - - - - - - - -
-
- ); -}; - - -export default Guide; - - diff --git a/src/main/Browser/Pages/Guide/Guide.module.css b/src/main/Browser/Pages/Guide/Guide.module.css deleted file mode 100644 index 00b83a34..00000000 --- a/src/main/Browser/Pages/Guide/Guide.module.css +++ /dev/null @@ -1,69 +0,0 @@ -.container { - height: 100vh; - background-color: #383a59; - color: var(--textColor); -} -.menu{ - width: 20%; - height: 100%; - background-color: var(--subMenu); - box-shadow: 0 0 8px 0 #00000080; -} -.content{ - width: 80%; - height: 100%; - background-color: var(--mainContent); -} -.top{ - height: 20%; - background-color: var(--cardHeader); - /*background-color: #00a97f;*/ -} -.top img{ - width: 9vw; -} -.body{ - height: 80%; - background-color: var(--cardBody); - /*background-color: #8c0b72;*/ -} -.thisButton { - width: 40%; - background: var(--orange); - color: var(--textColor); - bottom: 0; -} - -.navMenu{ - padding: 1vh 0; - width: 100%; - display: flex; - align-items: center; - justify-content: center; - cursor: pointer; - position: relative; -} -.selected{ - color: var(--orange); - font-weight: bold; - font-size: 1vw; -} -.selected:after{ - content: ''; - width: 2%; - height: 100%; - border-radius: 9px; - background-color: var(--orange); - position: absolute; - left: 0; -} -:global(.ltr) .selected:after{ - content: ''; - width: 2%; - height: 100%; - border-radius: 9px; - background-color: var(--orange); - position: absolute; - left: initial; - right: 0; -} \ No newline at end of file diff --git a/src/main/Browser/Pages/Guide/components/HashContent/HashContent.js b/src/main/Browser/Pages/Guide/components/HashContent/HashContent.js deleted file mode 100644 index 3555d767..00000000 --- a/src/main/Browser/Pages/Guide/components/HashContent/HashContent.js +++ /dev/null @@ -1,22 +0,0 @@ -import React from "react"; -import Icon from "../../../../../../components/Icon/Icon"; - - -const HashContent = (props) => { - const {id , title , text} = props - - return ( -
-
- -

{title}

-
-
{text}
-
- ); -}; - -export default HashContent; \ No newline at end of file diff --git a/src/main/Browser/Pages/Info/AboutUs/AboutUs.js b/src/main/Browser/Pages/Info/AboutUs/AboutUs.js new file mode 100644 index 00000000..353fbc25 --- /dev/null +++ b/src/main/Browser/Pages/Info/AboutUs/AboutUs.js @@ -0,0 +1,44 @@ +import React from 'react'; +import classes from "./AboutUs.module.css"; +import {useTranslation} from "react-i18next"; + +const AboutUs = () => { + + const {t} = useTranslation(); + + return ( +
+
+ {t("aboutUs.text1")} +
+ {t("aboutUs.p1")} + {t("aboutUs.p2")} + {t("aboutUs.p3")} + {t("aboutUs.p4")} +
+ {t("aboutUs.text2")} + {t("aboutUs.subTitle1")} + {t("aboutUs.text3")} +
+ {t("aboutUs.p5")} + {t("aboutUs.p6")} + {t("aboutUs.p7")} + {t("aboutUs.p8")} + {t("aboutUs.p9")} + {t("aboutUs.p10")} +
+ {t("aboutUs.subTitle2")} + {t("aboutUs.text4")} + {t("aboutUs.subTitle3")} +
+ {t("aboutUs.p11")} + {t("aboutUs.p12")} + {t("aboutUs.p13")} +
+ {t("aboutUs.text5")} +
+
+ ); +}; + +export default AboutUs; diff --git a/src/main/Browser/Pages/Info/AboutUs/AboutUs.module.css b/src/main/Browser/Pages/Info/AboutUs/AboutUs.module.css new file mode 100644 index 00000000..7b6553b1 --- /dev/null +++ b/src/main/Browser/Pages/Info/AboutUs/AboutUs.module.css @@ -0,0 +1,3 @@ +.container { + min-height: 100%; +} \ No newline at end of file diff --git a/src/main/Browser/Pages/Info/Commission/Commission.js b/src/main/Browser/Pages/Info/Commission/Commission.js new file mode 100644 index 00000000..2af666f3 --- /dev/null +++ b/src/main/Browser/Pages/Info/Commission/Commission.js @@ -0,0 +1,34 @@ +import React from 'react'; +import classes from './Commission.module.css' +import {useTranslation} from "react-i18next"; + +const Commission = () => { + const {t} = useTranslation(); + + return ( +
+
+ {t("commissions.subTitle1")} + {t("commissions.text1")} +
+ {t("commissions.p1")} + {t("commissions.p2")} + {t("commissions.p3")} + {t("commissions.p4")} +
+ {t("commissions.p5")} + {t("commissions.p6")} + {t("commissions.text2")} + {t("commissions.text3")} +
+ {t("commissions.p7")} + {t("commissions.p8")} + {t("commissions.p9")} +
+ {t("commissions.text4")} +
+
+ ); +}; + +export default Commission; diff --git a/src/main/Browser/Pages/Info/Commission/Commission.module.css b/src/main/Browser/Pages/Info/Commission/Commission.module.css new file mode 100644 index 00000000..7b6553b1 --- /dev/null +++ b/src/main/Browser/Pages/Info/Commission/Commission.module.css @@ -0,0 +1,3 @@ +.container { + min-height: 100%; +} \ 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 new file mode 100644 index 00000000..32c740c9 --- /dev/null +++ b/src/main/Browser/Pages/Info/ContactUs/ContactUs.js @@ -0,0 +1,18 @@ +import React from 'react'; +import classes from './ContactUs.module.css'; +import {useTranslation} from "react-i18next"; + +const ContactUs = () => { + const {t} = useTranslation(); + + return ( +
+
+ {t("contactUs.subTitle1")} + {t("contactUs.text1")} +
+
+ ); +}; + +export default ContactUs; diff --git a/src/main/Browser/Pages/Info/ContactUs/ContactUs.module.css b/src/main/Browser/Pages/Info/ContactUs/ContactUs.module.css new file mode 100644 index 00000000..7b6553b1 --- /dev/null +++ b/src/main/Browser/Pages/Info/ContactUs/ContactUs.module.css @@ -0,0 +1,3 @@ +.container { + min-height: 100%; +} \ No newline at end of file diff --git a/src/main/Browser/Pages/Info/Guide/Guide.js b/src/main/Browser/Pages/Info/Guide/Guide.js new file mode 100644 index 00000000..7c3e2ebd --- /dev/null +++ b/src/main/Browser/Pages/Info/Guide/Guide.js @@ -0,0 +1,31 @@ +import React from 'react'; +import classes from "./Guide.module.css"; +import {useTranslation} from "react-i18next"; + +const Guide = () => { + + const {t} = useTranslation(); + + return ( +
+
+ {t("guide.subTitle1")} + {t("guide.p1")} + {t("guide.p2")} + {t("guide.p3")} + {t("guide.p4")} + {t("guide.p5")} + {t("guide.p6")} + {t("guide.subTitle2")} +
+ {t("guide.p7")} + {t("guide.p8")} + {t("guide.p9")} + {t("guide.p10")} +
+
+
+ ); +}; + +export default Guide; diff --git a/src/main/Browser/Pages/Info/Guide/Guide.module.css b/src/main/Browser/Pages/Info/Guide/Guide.module.css new file mode 100644 index 00000000..7b6553b1 --- /dev/null +++ b/src/main/Browser/Pages/Info/Guide/Guide.module.css @@ -0,0 +1,3 @@ +.container { + min-height: 100%; +} \ No newline at end of file diff --git a/src/main/Browser/Pages/Info/Rules/Rules.js b/src/main/Browser/Pages/Info/Rules/Rules.js new file mode 100644 index 00000000..903c01c1 --- /dev/null +++ b/src/main/Browser/Pages/Info/Rules/Rules.js @@ -0,0 +1,31 @@ +import React from 'react'; +import classes from './Rules.module.css' +import {useTranslation} from "react-i18next"; + +const Rules = () => { + + const {t} = useTranslation(); + + return ( +
+
+ {t("rules.subTitle1")} + {t("rules.p1")} + {t("rules.p2")} + {t("rules.p3")} + {t("rules.p4")} + {t("rules.p5")} + {t("rules.p6")} + {t("rules.subTitle2")} +
+ {t("rules.p7")} + {t("rules.p8")} + {t("rules.p9")} + {t("rules.p10")} +
+
+
+ ); +}; + +export default Rules; diff --git a/src/main/Browser/Pages/Info/Rules/Rules.module.css b/src/main/Browser/Pages/Info/Rules/Rules.module.css new file mode 100644 index 00000000..7b6553b1 --- /dev/null +++ b/src/main/Browser/Pages/Info/Rules/Rules.module.css @@ -0,0 +1,3 @@ +.container { + min-height: 100%; +} \ No newline at end of file diff --git a/src/main/Browser/Pages/Info/TransferFees/TransferFees.js b/src/main/Browser/Pages/Info/TransferFees/TransferFees.js new file mode 100644 index 00000000..3545267c --- /dev/null +++ b/src/main/Browser/Pages/Info/TransferFees/TransferFees.js @@ -0,0 +1,44 @@ +import React from 'react'; +import classes from './TransferFees.module.css' +import {useTranslation} from "react-i18next"; + +const TransferFees = () => { + + const {t} = useTranslation(); + + return ( +
+
+ {t("transferFees.text1")} +
+ {t("transferFees.p1")} + {t("transferFees.p2")} + {t("transferFees.p3")} + {t("transferFees.p4")} + {t("transferFees.p5")} +
+ {t("transferFees.text2")} + {t("transferFees.text3")} + {t("transferFees.text4")} + + + + + {t("transferFees.subTitle1")} + {t("transferFees.text5")} + + {t("transferFees.subTitle2")} + {t("transferFees.text6")} + + {t("transferFees.subTitle3")} + {t("transferFees.text7")} + + {t("transferFees.subTitle4")} + {t("transferFees.text8")} + +
+
+ ); +}; + +export default TransferFees; diff --git a/src/main/Browser/Pages/Info/TransferFees/TransferFees.module.css b/src/main/Browser/Pages/Info/TransferFees/TransferFees.module.css new file mode 100644 index 00000000..7b6553b1 --- /dev/null +++ b/src/main/Browser/Pages/Info/TransferFees/TransferFees.module.css @@ -0,0 +1,3 @@ +.container { + min-height: 100%; +} \ No newline at end of file diff --git a/src/main/Browser/Pages/Landing/Landing.js b/src/main/Browser/Pages/Landing/Landing.js index 478c8137..0b6ff1a8 100644 --- a/src/main/Browser/Pages/Landing/Landing.js +++ b/src/main/Browser/Pages/Landing/Landing.js @@ -1,15 +1,33 @@ import React from 'react'; import classes from "./Landing.module.css"; import {images} from "../../../../assets/images"; -import LandingHeader from "./Sections/LandingHeader/LandingHeader"; -import LandingContent from "./Sections/LandingContent/LandingContent"; +import MarketTitle from "./components/MarketTitle/MarketTitle"; +import GeneralInfo from "./components/GeneralInfo/GeneralInfo"; +import Spinner from "./components/Spinner/Spinner"; +import MarketView from "./components/MarketView/MarketView"; +import MarketInfo from "./components/MarketInfo/MarketInfo"; +import Footer from "../UserPanel/Sections/Footer/Footer"; +import ScrollBar from "../../../../components/ScrollBar"; const Landing = () => { return ( -
- - +
+
+
+ + +
+
+ +
+
+ +
+
+
+ +
); } diff --git a/src/main/Browser/Pages/Landing/Landing.module.css b/src/main/Browser/Pages/Landing/Landing.module.css index 0ebdfa58..14d24027 100644 --- a/src/main/Browser/Pages/Landing/Landing.module.css +++ b/src/main/Browser/Pages/Landing/Landing.module.css @@ -1,7 +1,5 @@ -.container{ - height: 100vh; - background-color: var(--mainContent); - position: relative; +.container { + background-repeat: repeat; background-position: center center; background-size: 600px 1200px; diff --git a/src/main/Browser/Pages/Landing/Sections/LandingContent/LandingContent.js b/src/main/Browser/Pages/Landing/Sections/LandingContent/LandingContent.js deleted file mode 100644 index f33e82e6..00000000 --- a/src/main/Browser/Pages/Landing/Sections/LandingContent/LandingContent.js +++ /dev/null @@ -1,36 +0,0 @@ -import React from 'react'; -import classes from './LandingContent.module.css' -import ScrollBar from "../../../../../../components/ScrollBar"; -import Footer from "../../../UserPanel/Sections/Footer/Footer"; -import Spinner from "./components/Spinner/Spinner"; -import MarketView from "./components/MarketView/MarketView"; -import MarketTitle from "./components/MarketTitle/MarketTitle"; -import GeneralInfo from "./components/GeneralInfo/GeneralInfo"; -import MarketInfo from "./components/MarketInfo/MarketInfo"; - -const LandingContent = () => { - return ( -
- -
-
- - -
-
- -
-
- -
-
-
- -
-
- -
- ); -}; - -export default LandingContent; \ No newline at end of file diff --git a/src/main/Browser/Pages/Landing/Sections/LandingContent/LandingContent.module.css b/src/main/Browser/Pages/Landing/Sections/LandingContent/LandingContent.module.css deleted file mode 100644 index 8fffe175..00000000 --- a/src/main/Browser/Pages/Landing/Sections/LandingContent/LandingContent.module.css +++ /dev/null @@ -1,3 +0,0 @@ -.container { - height: 88vh; -} \ No newline at end of file diff --git a/src/main/Browser/Pages/Landing/Sections/LandingHeader/LandingHeader.js b/src/main/Browser/Pages/Landing/Sections/LandingHeader/LandingHeader.js deleted file mode 100644 index 01057b86..00000000 --- a/src/main/Browser/Pages/Landing/Sections/LandingHeader/LandingHeader.js +++ /dev/null @@ -1,16 +0,0 @@ -import React from 'react'; -import {useTranslation} from "react-i18next"; -import HeaderBuilder from "../../../../../../components/HeaderBuilder/HeaderBuilder"; - -const LandingHeader = () => { - - const {t} = useTranslation(); - - return ( - -

{t("Landing.title")}

-
- ); -}; - -export default LandingHeader; \ No newline at end of file diff --git a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/GeneralInfo/GeneralInfo.js b/src/main/Browser/Pages/Landing/components/GeneralInfo/GeneralInfo.js similarity index 86% rename from src/main/Browser/Pages/Landing/Sections/LandingContent/components/GeneralInfo/GeneralInfo.js rename to src/main/Browser/Pages/Landing/components/GeneralInfo/GeneralInfo.js index e2588e0c..6f75b78b 100644 --- a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/GeneralInfo/GeneralInfo.js +++ b/src/main/Browser/Pages/Landing/components/GeneralInfo/GeneralInfo.js @@ -1,8 +1,8 @@ import React from 'react'; import classes from './GeneralInfo.module.css' -import {useGetExchangeInfo} from "../../../../../../../../queries"; -import Loading from "../../../../../../../../components/Loading/Loading"; -import Error from "../../../../../../../../components/Error/Error"; +import {useGetExchangeInfo} from "../../../../../../queries"; +import Loading from "../../../../../../components/Loading/Loading"; +import Error from "../../../../../../components/Error/Error"; import {useTranslation} from "react-i18next"; const GeneralInfo = () => { diff --git a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/GeneralInfo/GeneralInfo.module.css b/src/main/Browser/Pages/Landing/components/GeneralInfo/GeneralInfo.module.css similarity index 100% rename from src/main/Browser/Pages/Landing/Sections/LandingContent/components/GeneralInfo/GeneralInfo.module.css rename to src/main/Browser/Pages/Landing/components/GeneralInfo/GeneralInfo.module.css diff --git a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketInfo/MarketInfo.js b/src/main/Browser/Pages/Landing/components/MarketInfo/MarketInfo.js similarity index 91% rename from src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketInfo/MarketInfo.js rename to src/main/Browser/Pages/Landing/components/MarketInfo/MarketInfo.js index 732abd10..c88dee96 100644 --- a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketInfo/MarketInfo.js +++ b/src/main/Browser/Pages/Landing/components/MarketInfo/MarketInfo.js @@ -1,13 +1,13 @@ import React, {useState} from 'react'; import classes from './MarketInfo.module.css' -import Icon from "../../../../../../../../components/Icon/Icon"; +import Icon from "../../../../../../components/Icon/Icon"; import MarketInfoTable from "./components/MarketInfoTable/MarketInfoTable"; import MarketInfoCard from "./components/MarketInfoCard/MarketInfoCard"; -import * as Routes from "../../../../../../Routes/routes"; +import * as Routes from "../../../../Routes/routes"; import {Link} from "react-router-dom"; -import {useGetQuoteCurrencies, useOverview} from "../../../../../../../../queries"; -import Loading from "../../../../../../../../components/Loading/Loading"; -import Error from "../../../../../../../../components/Error/Error"; +import {useGetQuoteCurrencies, useOverview} from "../../../../../../queries"; +import Loading from "../../../../../../components/Loading/Loading"; +import Error from "../../../../../../components/Error/Error"; import {useTranslation} from "react-i18next"; import i18n from "i18next"; diff --git a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketInfo/MarketInfo.module.css b/src/main/Browser/Pages/Landing/components/MarketInfo/MarketInfo.module.css similarity index 100% rename from src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketInfo/MarketInfo.module.css rename to src/main/Browser/Pages/Landing/components/MarketInfo/MarketInfo.module.css diff --git a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketInfo/components/MarketInfoCard/MarketInfoCard.js b/src/main/Browser/Pages/Landing/components/MarketInfo/components/MarketInfoCard/MarketInfoCard.js similarity index 92% rename from src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketInfo/components/MarketInfoCard/MarketInfoCard.js rename to src/main/Browser/Pages/Landing/components/MarketInfo/components/MarketInfoCard/MarketInfoCard.js index 8bae6cbd..91e2f346 100644 --- a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketInfo/components/MarketInfoCard/MarketInfoCard.js +++ b/src/main/Browser/Pages/Landing/components/MarketInfo/components/MarketInfoCard/MarketInfoCard.js @@ -1,10 +1,10 @@ import React from 'react'; import classes from './MarketInfoCard.module.css' -import {images} from "../../../../../../../../../../assets/images"; +import {images} from "../../../../../../../../assets/images"; import {useTranslation} from "react-i18next"; -import {BN} from "../../../../../../../../../../utils/utils"; -import {setActivePairInitiate} from "../../../../../../../../../../store/actions"; -import {Panel} from "../../../../../../../../Routes/routes"; +import {BN} from "../../../../../../../../utils/utils"; +import {setActivePairInitiate} from "../../../../../../../../store/actions"; +import {Panel} from "../../../../../../Routes/routes"; import {useNavigate} from "react-router-dom"; import {useDispatch, useSelector} from "react-redux"; diff --git a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketInfo/components/MarketInfoCard/MarketInfoCard.module.css b/src/main/Browser/Pages/Landing/components/MarketInfo/components/MarketInfoCard/MarketInfoCard.module.css similarity index 100% rename from src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketInfo/components/MarketInfoCard/MarketInfoCard.module.css rename to src/main/Browser/Pages/Landing/components/MarketInfo/components/MarketInfoCard/MarketInfoCard.module.css diff --git a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketInfo/components/MarketInfoTable/MarketInfoTable.js b/src/main/Browser/Pages/Landing/components/MarketInfo/components/MarketInfoTable/MarketInfoTable.js similarity index 92% rename from src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketInfo/components/MarketInfoTable/MarketInfoTable.js rename to src/main/Browser/Pages/Landing/components/MarketInfo/components/MarketInfoTable/MarketInfoTable.js index d6314837..cf53721b 100644 --- a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketInfo/components/MarketInfoTable/MarketInfoTable.js +++ b/src/main/Browser/Pages/Landing/components/MarketInfo/components/MarketInfoTable/MarketInfoTable.js @@ -1,12 +1,12 @@ import React from 'react'; import classes from './MarketInfoTable.module.css' import {useTranslation} from "react-i18next"; -import {images} from "../../../../../../../../../../assets/images"; -import {BN} from "../../../../../../../../../../utils/utils"; +import {images} from "../../../../../../../../assets/images"; +import {BN} from "../../../../../../../../utils/utils"; import i18n from "i18next"; -import {setActivePairInitiate} from "../../../../../../../../../../store/actions"; +import {setActivePairInitiate} from "../../../../../../../../store/actions"; import {useDispatch, useSelector} from "react-redux"; -import {Panel} from "../../../../../../../../Routes/routes"; +import {Panel} from "../../../../../../Routes/routes"; import {useNavigate} from "react-router-dom"; const MarketInfoTable = ({data, activeCurrency}) => { diff --git a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketInfo/components/MarketInfoTable/MarketInfoTable.module.css b/src/main/Browser/Pages/Landing/components/MarketInfo/components/MarketInfoTable/MarketInfoTable.module.css similarity index 100% rename from src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketInfo/components/MarketInfoTable/MarketInfoTable.module.css rename to src/main/Browser/Pages/Landing/components/MarketInfo/components/MarketInfoTable/MarketInfoTable.module.css diff --git a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketTitle/MarketTitle.js b/src/main/Browser/Pages/Landing/components/MarketTitle/MarketTitle.js similarity index 92% rename from src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketTitle/MarketTitle.js rename to src/main/Browser/Pages/Landing/components/MarketTitle/MarketTitle.js index 5a34506f..4be96886 100644 --- a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketTitle/MarketTitle.js +++ b/src/main/Browser/Pages/Landing/components/MarketTitle/MarketTitle.js @@ -1,10 +1,10 @@ import React from 'react'; import classes from './MarketTitle.module.css' import {useTranslation} from "react-i18next"; -import {Panel} from "../../../../../../Routes/routes"; +import {Panel} from "../../../../Routes/routes"; import {Link} from "react-router-dom"; -import Icon from "../../../../../../../../components/Icon/Icon"; -import Button from "../../../../../../../../components/Button/Button"; +import Icon from "../../../../../../components/Icon/Icon"; +import Button from "../../../../../../components/Button/Button"; const MarketTitle = () => { diff --git a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketTitle/MarketTitle.module.css b/src/main/Browser/Pages/Landing/components/MarketTitle/MarketTitle.module.css similarity index 100% rename from src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketTitle/MarketTitle.module.css rename to src/main/Browser/Pages/Landing/components/MarketTitle/MarketTitle.module.css diff --git a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketView/MarketView.js b/src/main/Browser/Pages/Landing/components/MarketView/MarketView.js similarity index 86% rename from src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketView/MarketView.js rename to src/main/Browser/Pages/Landing/components/MarketView/MarketView.js index ef2796a2..56f005c3 100644 --- a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketView/MarketView.js +++ b/src/main/Browser/Pages/Landing/components/MarketView/MarketView.js @@ -1,15 +1,15 @@ import React from 'react'; import classes from './MarketView.module.css' import {useTranslation} from "react-i18next"; -import {useGetMarketStats} from "../../../../../../../../queries"; +import {useGetMarketStats} from "../../../../../../queries"; import {useSelector} from "react-redux"; -import Loading from "../../../../../../../../components/Loading/Loading"; -import Error from "../../../../../../../../components/Error/Error"; -import NullMarketStats from "../../../../../../../../components/NullMarketStats/NullMarketStats"; +import Loading from "../../../../../../components/Loading/Loading"; +import Error from "../../../../../../components/Error/Error"; +import NullMarketStats from "../../../../../../components/NullMarketStats/NullMarketStats"; import MostIncreasedPrice from "./components/MostIncreasedPrice/MostIncreasedPrice"; import MostDecreasedPrice from "./components/MostDecreasedPrice/MostDecreasedPrice"; import MostVolume from "./components/MostVolume/MostVolume"; -import {images} from "../../../../../../../../assets/images"; +import {images} from "../../../../../../assets/images"; const MarketView = () => { diff --git a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketView/MarketView.module.css b/src/main/Browser/Pages/Landing/components/MarketView/MarketView.module.css similarity index 100% rename from src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketView/MarketView.module.css rename to src/main/Browser/Pages/Landing/components/MarketView/MarketView.module.css diff --git a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketView/components/MostDecreasedPrice/MostDecreasedPrice.js b/src/main/Browser/Pages/Landing/components/MarketView/components/MostDecreasedPrice/MostDecreasedPrice.js similarity index 92% rename from src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketView/components/MostDecreasedPrice/MostDecreasedPrice.js rename to src/main/Browser/Pages/Landing/components/MarketView/components/MostDecreasedPrice/MostDecreasedPrice.js index db97b3cd..0f4ca3d7 100644 --- a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketView/components/MostDecreasedPrice/MostDecreasedPrice.js +++ b/src/main/Browser/Pages/Landing/components/MarketView/components/MostDecreasedPrice/MostDecreasedPrice.js @@ -1,8 +1,8 @@ import React from 'react'; import classes from "../../MarketView.module.css"; -import {images} from "../../../../../../../../../../assets/images"; +import {images} from "../../../../../../../../assets/images"; import i18n from "i18next"; -import {BN} from "../../../../../../../../../../utils/utils"; +import {BN} from "../../../../../../../../utils/utils"; import {useTranslation} from "react-i18next"; const MostDecreasedPrice = ({mostDecreasedPrice}) => { diff --git a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketView/components/MostIncreasedPrice/MostIncreasedPrice.js b/src/main/Browser/Pages/Landing/components/MarketView/components/MostIncreasedPrice/MostIncreasedPrice.js similarity index 92% rename from src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketView/components/MostIncreasedPrice/MostIncreasedPrice.js rename to src/main/Browser/Pages/Landing/components/MarketView/components/MostIncreasedPrice/MostIncreasedPrice.js index 6e02ffcc..9e75edf6 100644 --- a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketView/components/MostIncreasedPrice/MostIncreasedPrice.js +++ b/src/main/Browser/Pages/Landing/components/MarketView/components/MostIncreasedPrice/MostIncreasedPrice.js @@ -1,8 +1,8 @@ import React from 'react'; import classes from "../../MarketView.module.css"; -import {images} from "../../../../../../../../../../assets/images"; +import {images} from "../../../../../../../../assets/images"; import i18n from "i18next"; -import {BN} from "../../../../../../../../../../utils/utils"; +import {BN} from "../../../../../../../../utils/utils"; import {useTranslation} from "react-i18next"; const MostIncreasedPrice = ({mostIncreasedPrice}) => { diff --git a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketView/components/MostVolume/MostVolume.js b/src/main/Browser/Pages/Landing/components/MarketView/components/MostVolume/MostVolume.js similarity index 92% rename from src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketView/components/MostVolume/MostVolume.js rename to src/main/Browser/Pages/Landing/components/MarketView/components/MostVolume/MostVolume.js index c9650baf..6dceea4f 100644 --- a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketView/components/MostVolume/MostVolume.js +++ b/src/main/Browser/Pages/Landing/components/MarketView/components/MostVolume/MostVolume.js @@ -1,8 +1,8 @@ import React from 'react'; import classes from "../../MarketView.module.css"; -import {images} from "../../../../../../../../../../assets/images"; +import {images} from "../../../../../../../../assets/images"; import i18n from "i18next"; -import {BN} from "../../../../../../../../../../utils/utils"; +import {BN} from "../../../../../../../../utils/utils"; import {useTranslation} from "react-i18next"; const MostVolume = ({mostVolume}) => { diff --git a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/Spinner/Spinner.js b/src/main/Browser/Pages/Landing/components/Spinner/Spinner.js similarity index 93% rename from src/main/Browser/Pages/Landing/Sections/LandingContent/components/Spinner/Spinner.js rename to src/main/Browser/Pages/Landing/components/Spinner/Spinner.js index 2ba1afcc..afcd4789 100644 --- a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/Spinner/Spinner.js +++ b/src/main/Browser/Pages/Landing/components/Spinner/Spinner.js @@ -1,6 +1,6 @@ import React from 'react'; import classes from './Spinner.module.css' -import {images} from "../../../../../../../../assets/images"; +import {images} from "../../../../../../assets/images"; const Spinner = () => { return ( diff --git a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/Spinner/Spinner.module.css b/src/main/Browser/Pages/Landing/components/Spinner/Spinner.module.css similarity index 100% rename from src/main/Browser/Pages/Landing/Sections/LandingContent/components/Spinner/Spinner.module.css rename to src/main/Browser/Pages/Landing/components/Spinner/Spinner.module.css diff --git a/src/main/Browser/Pages/Login/components/LoginForm/LoginForm.js b/src/main/Browser/Pages/Login/components/LoginForm/LoginForm.js index 32b8ecba..49bc6138 100644 --- a/src/main/Browser/Pages/Login/components/LoginForm/LoginForm.js +++ b/src/main/Browser/Pages/Login/components/LoginForm/LoginForm.js @@ -114,7 +114,7 @@ const LoginForm = () => { return
submit(e)} className={`column ai-center jc-between ${classes.form}`}>
- {(!needOTP && isDevelopment) && setCredential({username: "demo1@opex.dev", password: "12345678", otp: ""})}>{t('login.forDemoLogin')}} + {(!needOTP && isDevelopment) && setCredential({username: "test1@opex.dev", password: "12345678", otp: ""})}>{t('login.forDemoLogin')}} {needOTP ? : diff --git a/src/main/Browser/Pages/UserPanel/Sections/Content/components/Market/components/Order/components/BuyOrder/BuyOrder.js b/src/main/Browser/Pages/UserPanel/Sections/Content/components/Market/components/Order/components/BuyOrder/BuyOrder.js index 73d7b1a4..7ea1017e 100644 --- a/src/main/Browser/Pages/UserPanel/Sections/Content/components/Market/components/Order/components/BuyOrder/BuyOrder.js +++ b/src/main/Browser/Pages/UserPanel/Sections/Content/components/Market/components/Order/components/BuyOrder/BuyOrder.js @@ -191,20 +191,31 @@ const BuyOrder = () => { const fillBuyByWallet = () => { - if(order.pricePerUnit.isEqualTo(0) && bestBuyPrice === 0 ) return toast.error(t("orders.hasNoOffer")); + if (order.pricePerUnit.isEqualTo(0) && bestBuyPrice === 0) return toast.error(t("orders.hasNoOffer")); if (order.pricePerUnit.isEqualTo(0)) { - const totalPrice = new BN(quote); + const pricePerUnit = new BN(bestBuyPrice) + let totalPrice = new BN(quote); + let reqAmount = totalPrice.dividedBy(pricePerUnit).decimalPlaces(activePair.baseAssetPrecision) + if (!reqAmount.mod(activePair.baseRange.step).isZero()) { + reqAmount = reqAmount.minus(reqAmount.mod(activePair.baseRange.step)); + totalPrice = reqAmount.multipliedBy(pricePerUnit); + } setOrder({ ...order, - reqAmount: totalPrice.dividedBy(bestBuyPrice).decimalPlaces(activePair.baseAssetPrecision), - pricePerUnit: new BN(bestBuyPrice), + reqAmount, + pricePerUnit, totalPrice, - tradeFee: totalPrice.multipliedBy(tradeFee[activePair.quoteAsset]).decimalPlaces(activePair.baseAssetPrecision), + tradeFee: reqAmount.multipliedBy(tradeFee[activePair.quoteAsset]).decimalPlaces(activePair.baseAssetPrecision), }); } else { + let totalPrice = new BN(quote); + let reqAmount = totalPrice.dividedBy(order.pricePerUnit).decimalPlaces(activePair.baseAssetPrecision) + if (!reqAmount.mod(activePair.baseRange.step).isZero()) { + reqAmount = reqAmount.minus(reqAmount.mod(activePair.baseRange.step)); + } buyPriceHandler( - quote.toString(), - "totalPrice", + reqAmount.toString(), + "reqAmount", ); } }; @@ -257,15 +268,10 @@ const BuyOrder = () => { }) } const submitButtonTextHandler = () => { - if (isLoading) { - return linearLoading - } - if (alert.submit) { - return {t("login.loginError")} - } - if (isLogin) { - return t("buy") - } + if (isLoading) return linearLoading + + if (isLogin) return t("buy") + return t("pleaseLogin") } diff --git a/src/main/Browser/Pages/UserPanel/Sections/Content/components/Market/components/Order/components/SellOrder/SellOrder.js b/src/main/Browser/Pages/UserPanel/Sections/Content/components/Market/components/Order/components/SellOrder/SellOrder.js index ec953b6a..103f3333 100644 --- a/src/main/Browser/Pages/UserPanel/Sections/Content/components/Market/components/Order/components/SellOrder/SellOrder.js +++ b/src/main/Browser/Pages/UserPanel/Sections/Content/components/Market/components/Order/components/SellOrder/SellOrder.js @@ -26,7 +26,6 @@ const SellOrder = () => { const {data: userAccount} = useGetUserAccount() const base = userAccount?.wallets[activePair.baseAsset]?.free || 0; - const quote = userAccount?.wallets[activePair.quoteAsset]?.free || 0; const [alert, setAlert] = useState({ reqAmount: null, @@ -119,7 +118,7 @@ const SellOrder = () => { ...order, reqAmount, totalPrice: reqAmount.multipliedBy(order.pricePerUnit).decimalPlaces(activePair.quoteAssetPrecision), - tradeFee: reqAmount.multipliedBy(order.pricePerUnit).multipliedBy(tradeFee[activePair.quoteAsset]).decimalPlaces(activePair.baseAssetPrecision), + tradeFee: reqAmount.multipliedBy(order.pricePerUnit).multipliedBy(tradeFee[activePair.quoteAsset]).decimalPlaces(activePair.quoteAssetPrecision), }); break; case "pricePerUnit": @@ -128,7 +127,7 @@ const SellOrder = () => { ...order, pricePerUnit: pricePerUnit, totalPrice: pricePerUnit.multipliedBy(order.reqAmount).decimalPlaces(activePair.quoteAssetPrecision), - tradeFee: pricePerUnit.multipliedBy(order.reqAmount).multipliedBy(tradeFee[activePair.quoteAsset]).decimalPlaces(activePair.baseAssetPrecision), + tradeFee: pricePerUnit.multipliedBy(order.reqAmount).multipliedBy(tradeFee[activePair.quoteAsset]).decimalPlaces(activePair.quoteAssetPrecision), }); break; case "totalPrice": @@ -138,7 +137,7 @@ const SellOrder = () => { ...order, reqAmount: req.isFinite() ? req : new BN(0), totalPrice, - tradeFee: req.isFinite() ? totalPrice.multipliedBy(tradeFee[activePair.quoteAsset]).decimalPlaces(activePair.baseAssetPrecision) : new BN(0), + tradeFee: req.isFinite() ? totalPrice.multipliedBy(tradeFee[activePair.quoteAsset]).decimalPlaces(activePair.quoteAssetPrecision) : new BN(0), }); currencyValidator("reqAmount", req, activePair.baseRange); break; @@ -174,20 +173,21 @@ const SellOrder = () => { }, [selectedSellOrder]); const fillSellByWallet = () => { - if(order.pricePerUnit.isEqualTo(0) && bestSellPrice === 0 ) return toast.error(t("orders.hasNoOffer")); + if (order.pricePerUnit.isEqualTo(0) && bestSellPrice === 0) return toast.error(t("orders.hasNoOffer")); if (order.pricePerUnit.isEqualTo(0)) { - const totalPrice = new BN(quote); + const reqAmount = new BN(base).decimalPlaces(activePair.baseAssetPrecision); + const pricePerUnit = new BN(bestSellPrice); setOrder({ ...order, - reqAmount: totalPrice.dividedBy(bestSellPrice).decimalPlaces(activePair.baseAssetPrecision), - pricePerUnit: new BN(bestSellPrice), - totalPrice, - tradeFee: totalPrice.multipliedBy(tradeFee[activePair.quoteAsset]).decimalPlaces(activePair.baseAssetPrecision), + reqAmount: reqAmount, + pricePerUnit: pricePerUnit, + totalPrice: reqAmount.multipliedBy(pricePerUnit).decimalPlaces(activePair.quoteAssetPrecision), + tradeFee: reqAmount.multipliedBy(pricePerUnit).multipliedBy(tradeFee[activePair.quoteAsset]).decimalPlaces(activePair.baseAssetPrecision), }); } else { sellPriceHandler( - quote.toString(), - "totalPrice", + base.toString(), + "reqAmount", ); } }; @@ -213,12 +213,10 @@ const SellOrder = () => { }, [order.reqAmount]); const submit = () => { - if (!isLogin) { - return false - } - if (isLoading) { - return false - } + if (!isLogin) return false + + if (isLoading) return false + setIsLoading(true) createOrder(activePair.symbol, "SELL", order) .then((res) => { @@ -253,15 +251,10 @@ const SellOrder = () => { } const submitButtonTextHandler = () => { - if (isLoading) { - return linearLoading - } - if (alert.submit) { - return {t("login.loginError")} - } - if (isLogin) { - return t("sell") - } + if (isLoading) return linearLoading + + if (isLogin) return t("sell") + return t("pleaseLogin") } @@ -269,7 +262,8 @@ const SellOrder = () => {

fillSellByWallet()}>{t("orders.availableAmount")}:{" "} - {new BN(base).toFormat()}{" "}{t("currency." + activePair.baseAsset)} + {new BN(base).toFormat()}{" "}{t("currency." + activePair.baseAsset)}

fillSellByBestPrice()}> {t("orders.bestOffer")}:{" "} @@ -358,7 +352,7 @@ const SellOrder = () => {

{t("orders.getAmount")}:{" "} - {order.totalPrice.minus(order.tradeFee).decimalPlaces(activePair.baseAssetPrecision).toNumber()}{" "} + {order.totalPrice.minus(order.tradeFee).decimalPlaces(activePair.quoteAssetPrecision).toFormat()}{" "} {t("currency." + activePair.quoteAsset)}

diff --git a/src/main/Browser/Pages/UserPanel/Sections/Content/components/Market/components/TradingView/components/MarketChart/MarketChart.js b/src/main/Browser/Pages/UserPanel/Sections/Content/components/Market/components/TradingView/components/MarketChart/MarketChart.js index 1f81cf0d..9416a27f 100644 --- a/src/main/Browser/Pages/UserPanel/Sections/Content/components/Market/components/TradingView/components/MarketChart/MarketChart.js +++ b/src/main/Browser/Pages/UserPanel/Sections/Content/components/Market/components/TradingView/components/MarketChart/MarketChart.js @@ -25,7 +25,6 @@ const MarketChart = ({type}) => { const chartContainerRef = useRef(); const resizeObserver = useRef(); - console.log(data) const timeScale = { tickMarkFormatter: (time) => { if (i18n.language === undefined || i18n.language === "fa") return moment(time * 1000).format("jYYYY/jM/jD") diff --git a/src/main/Browser/Pages/UserPanel/Sections/Footer/Footer.js b/src/main/Browser/Pages/UserPanel/Sections/Footer/Footer.js index 8f894506..0f5142e0 100644 --- a/src/main/Browser/Pages/UserPanel/Sections/Footer/Footer.js +++ b/src/main/Browser/Pages/UserPanel/Sections/Footer/Footer.js @@ -1,6 +1,6 @@ import React from "react"; import classes from "./Footer.module.css"; -import {useTranslation} from "react-i18next"; +import {Trans, useTranslation} from "react-i18next"; import {useDispatch, useSelector} from "react-redux"; import * as Routes from "../../../../Routes/routes"; import ToggleSwitch from "../../../../../../components/ToggleSwitch/ToggleSwitch"; @@ -9,6 +9,7 @@ import {setThemeInitiate} from "../../../../../../store/actions"; import {Link} from "react-router-dom"; import packageJson from "../../../../../../../package.json" import {toAbsoluteUrl} from "../../../../../../utils/utils"; +import {Commission} from "../../../../Routes/routes"; const Footer = () => { const {t} = useTranslation(); @@ -16,52 +17,48 @@ const Footer = () => { const dispatch = useDispatch() return ( -
-
+
+
-
- - {t("footer.aboutUs")} +
+ + {t("home")} - - {t("footer.contactUS")} + + {t("MarketTitle.advancedTrading")} - - {t("footer.blog")} + + {t("market.title")} - - {t("footer.guide")} + + + {t("commissions.title")} - - {t("footer.rules")} + + {t("transferFees.title")}
-
- - {t("commission")} - - - {t("footer.api")} +
+ + {t("aboutUs.title")} - - {t("footer.addCoin")} + + {t("contactUs.title")} - - {t("footer.demo")} + + {t("guide.title")} - - {t("footer.errorReport")} + + {t("rules.title")} +
-
-
- {t("footer.darkMode")}: + {t("Footer.darkMode")}: dispatch(setThemeInitiate(e.target.checked))} checked={isDark}/>
-
{ @@ -72,18 +69,24 @@ const Footer = () => { onClick={() => i18n.changeLanguage("en")}>{t("Languages.English")} } - -
- {t("title")} + {t("title")} {packageJson.version}
-
-

{t("footer.copyright")}

+
+

+ +

); diff --git a/src/main/Browser/Routes/routes.js b/src/main/Browser/Routes/routes.js index 209008b3..38fee34b 100644 --- a/src/main/Browser/Routes/routes.js +++ b/src/main/Browser/Routes/routes.js @@ -1,8 +1,15 @@ export const Landing = "/"; export const Panel = "/panel"; export const Login = "/login"; -export const Guide = "/guide"; export const AllMarket = "/all-market"; +export const AboutUs = "/about-us"; +export const Commission = "/commission"; +export const TransferFees = "/transfer-fees"; +export const Guide = "/guide"; +export const Rules = "/rules"; +export const ContactUs = "/contact-us"; + +export const Info = "/Info"; export const User = "/user"; export const UserVerifyRelative = "verify"; diff --git a/src/queries/hooks/useGetUserAccount.js b/src/queries/hooks/useGetUserAccount.js index 77e44085..42e01384 100644 --- a/src/queries/hooks/useGetUserAccount.js +++ b/src/queries/hooks/useGetUserAccount.js @@ -1,8 +1,10 @@ import {useQuery} from "@tanstack/react-query"; import {getUserAccount, parseWalletsResponse} from "js-api-client"; +import {useSelector} from "react-redux"; export const useGetUserAccount = () => { - return useQuery(['userAccount'], getUserAccountFunc, + const isLogin = useSelector((state) => state.auth.isLogin) + return useQuery(['userAccount'], () => getUserAccountFunc(isLogin), { retry: 1, refetchInterval: 10000 @@ -10,7 +12,8 @@ export const useGetUserAccount = () => { ); } -export const getUserAccountFunc = async () => { +export const getUserAccountFunc = async (isLogin) => { + if (!isLogin) return null const params = new URLSearchParams(); params.append('timestamp', Date.now().toString()); const {data} = await getUserAccount() diff --git a/src/queries/hooks/useLastTrades.js b/src/queries/hooks/useLastTrades.js index 8f2a9e01..4a93da70 100644 --- a/src/queries/hooks/useLastTrades.js +++ b/src/queries/hooks/useLastTrades.js @@ -9,6 +9,7 @@ export const useLastTrades = (symbol, onSuccess) => { retry: 1, staleTime: 5000, refetchInterval: 10000, + keepPreviousData: true, onSuccess }); } diff --git a/src/queries/hooks/useOrderBook.js b/src/queries/hooks/useOrderBook.js index 6eef8a27..4a9ede05 100644 --- a/src/queries/hooks/useOrderBook.js +++ b/src/queries/hooks/useOrderBook.js @@ -6,9 +6,10 @@ export const useOrderBook = (symbol, onSuccess) => { ['orderBook', symbol], () => getOrderBookFunc(symbol), { - retry: 1, + retry: 2, staleTime: 5000, refetchInterval: 10000, + keepPreviousData: true, onSuccess }); }