From 8e68dd5e6587902ececf0663d70c9f3b0b80f294 Mon Sep 17 00:00:00 2001 From: Benyamin001 <23664159+Benyamin001@users.noreply.github.com> Date: Sun, 22 May 2022 17:08:20 +0430 Subject: [PATCH 01/42] fix loadConfig --- public/locales/fa/translation.json | 38 +----- src/index.css | 6 + src/main/Browser/Browser.js | 58 ++++----- .../components/MarketHeader/MarketHeader.js | 10 +- .../SubMenu/components/Market/Market.js | 2 +- src/store/actions/actionTypes.js | 3 +- src/store/actions/auth.js | 13 -- src/store/actions/exchange.js | 3 +- src/store/actions/global.js | 16 ++- src/store/actions/index.js | 2 +- src/store/reducers/authReducer.js | 6 - src/store/reducers/exchangeReducer.js | 1 - src/store/reducers/globalReducer.js | 9 +- src/store/sagas/global.js | 123 +++++++----------- src/store/sagas/index.js | 4 +- 15 files changed, 107 insertions(+), 187 deletions(-) diff --git a/public/locales/fa/translation.json b/public/locales/fa/translation.json index 4fc08443..0e931e5e 100644 --- a/public/locales/fa/translation.json +++ b/public/locales/fa/translation.json @@ -104,7 +104,6 @@ "done": "سفارش موفق", "incompleted": "سفارش نیمه تمام" }, - "orderTypes": { "LIMIT": "محدود", "MARKET": "بازار", @@ -114,35 +113,6 @@ "TAKE_PROFIT_LIMIT": "*متوقف محدود", "LIMIT_MAKER": "*متوقف محدود" }, - - "pair": { - "BTC/IRT": "بیتکوین/تومان", - "ETH/IRT": "اتر/تومان", - "ETH/BTC": "اتر/بیتکوین", - "BTC/USDT": "بیتکوین/تتر", - "TBTC/TUSDT": "بیتکوین (ت)/تتر (ت)", - "TBTC/IRT": "بیتکوین (ت)/تومان", - "TETH/TUSDT": "اتر (ت)/تتر (ت)", - "LTC/BTC": "لایت کوین/بیتکوین", - "DOGE/BTC": "دوج کوین/بیتکوین", - "BCH/BTC": "بیتکوین کش/بیتکوین", - "LTC/IRT": "لایت کوین/تومان", - "LTC/USDT": "لایت کوین/تتر", - "DOGE/IRT": "دوج کوین/تومان", - "BCH/IRT": "بیتکوین کش/تومان", - "ETH/USDT": "اتر/تتر", - "BNB/IRT": "بایننس/تومان", - "BNB/USDT": "بایننس/تتر", - "BUSD/IRT": "دلار بایننس/تومان", - "DOGE/USDT": "دوج کوین/تتر", - "BCH/USDT": "بیتکوین کش/تتر", - "NLN/BTC": "اپکس/بیتکوین", - "BTC/BUSD": "بیتکوین/دلار بایننس", - "ETH/BUSD": "اتر/دلار بایننس", - "BNB/BUSD": "بایننس/دلار بایننس", - "NLN/USDT": "اپکس/تتر" - }, - "header": { "lastPrice": "آخرین قیمت", "availableBalance": "موجودی قابل معامله", @@ -591,10 +561,8 @@ "tooManyFiles": "آپلود بیشتر از یک عکس مجاز نیست!", "errorMsgDefault": "عکس آپلود شده معتبر نیست!" }, - - "junk": { - "t": "ت", - "billionT": "میلیارد ت", - "vol": "ح" + "errorPage" : { + "reload" : "تلاش مجدد", + "errorText" : "خطا در ارتباط با سرور" } } \ No newline at end of file diff --git a/src/index.css b/src/index.css index dee992b5..7f2b5bfb 100644 --- a/src/index.css +++ b/src/index.css @@ -1459,4 +1459,10 @@ table th { transform: translateY(0); -moz-transform: translateY(0) rotate(.2deg); } +} + +.reload-btn { + background: var(--bgGreen); + padding: 10px 20px; + text-align: center; } \ No newline at end of file diff --git a/src/main/Browser/Browser.js b/src/main/Browser/Browser.js index 8eeb038a..c612c1ae 100644 --- a/src/main/Browser/Browser.js +++ b/src/main/Browser/Browser.js @@ -1,6 +1,6 @@ import React, {useEffect} from "react"; import {useDispatch, useSelector} from "react-redux"; -import {Route, Switch, useHistory} from "react-router-dom"; +import {Route, Switch} from "react-router-dom"; import i18n from "i18next"; import ReactTooltip from "react-tooltip"; import * as Routes from "../../routes/routes"; @@ -13,39 +13,30 @@ import SubMenu from "./Sections/SubMenu/SubMenu"; import Header from "./Sections/Header/Header"; import Content from "./Sections/Content/Content"; import FullWidthLoading from "../../components/FullWidthLoading/FullWidthLoading"; -import { - loadConfig, - loadImpersonate, - setInfoMessage, - setLoading, - setUserAccountInfoInitiate, - setUserInfo -} from "../../store/actions"; +import {loadConfig, setInfoMessage, setUserAccountInfoInitiate} from "../../store/actions"; import TechnicalChart from "./Sections/Content/components/TechnicalChart/TechnicalChart"; import "./Browser.css" import useQuery from "../../Hooks/useQuery"; import useInterval from "../../Hooks/useInterval"; -import {setImpersonateTokens} from "../../store/actions/auth"; -import jwtDecode from "jwt-decode"; import {setLastPriceInitiate} from "../../store/actions/exchange"; import Info from "../../components/Info/Info"; +import FullWidthError from "../../components/FullWidthError/FullWidthError"; const Browser = () => { const dispatch = useDispatch(); - const history = useHistory(); const query = useQuery(); const isDark = useSelector((state) => state.global.isDark) const isLoading = useSelector((state) => state.global.isLoading) + const hasError = useSelector((state) => state.global.hasError) const isLogin = useSelector((state) => state.auth.isLogin) isDark ? document.body.classList.add('dark') : document.body.classList.remove('dark'); useEffect(() => { const impersonate = query.get("impersonate"); - if (impersonate) getLoginByAdminToken(impersonate).catch((err) => console.log(err)) - impersonate ? dispatch(loadImpersonate()) : dispatch(loadConfig()) + dispatch(loadConfig(impersonate)) i18n.language !== "fa" ? document.body.classList.add('ltr') : document.body.classList.remove('ltr'); i18n.on("languageChanged", (lng) => { lng !== "fa" ? document.body.classList.add('ltr') : document.body.classList.remove('ltr'); @@ -57,15 +48,8 @@ const Browser = () => { window.removeEventListener('offline', () => dispatch(setInfoMessage(null, "offline"))); window.removeEventListener('online', () => dispatch(setInfoMessage(null, null))); } - }, []); - const getLoginByAdminToken = async (token) => { - await dispatch(setImpersonateTokens(token)) - const jwt = jwtDecode(token) - dispatch(setUserInfo(jwt)); - dispatch(setUserAccountInfoInitiate()) - } useInterval(() => { dispatch(setUserAccountInfoInitiate()); @@ -73,7 +57,7 @@ const Browser = () => { useInterval(() => { dispatch(setLastPriceInitiate()); - }, 3000) + }, 3000) const Toast = () => { }, }} containerStyle={{}}/> + if (isLoading) { + return + } + if (hasError) { + return + } return ( @@ -118,21 +108,19 @@ const Browser = () => { path={Routes.Technical} /> - {isLoading ? () : ( -
- - -
-
- -
- -
+
+ + +
+
+ +
+
- -
- )} + + +
); diff --git a/src/main/Browser/Sections/Header/components/MarketHeader/MarketHeader.js b/src/main/Browser/Sections/Header/components/MarketHeader/MarketHeader.js index 81766557..0e310416 100644 --- a/src/main/Browser/Sections/Header/components/MarketHeader/MarketHeader.js +++ b/src/main/Browser/Sections/Header/components/MarketHeader/MarketHeader.js @@ -1,4 +1,4 @@ -import React, {Fragment, useEffect, useState} from "react"; +import React, {useEffect, useState} from "react"; import classes from "./MarketHeader.module.css"; import {useTranslation} from "react-i18next"; import {useSelector} from "react-redux"; @@ -37,9 +37,9 @@ const MarketHeader = () => { } return ( - + <>
-

{t(`pair.${activePair.name}`)}

+

{t("currency." + activePair.baseAsset)}/{t("currency." + activePair.quoteAsset)}

{t("header.lastPrice")}:{" "}{" "}{!lastTradePrice ? "---" : lastTradePrice.toLocaleString()+" "+t("currency." + activePair.quoteAsset)}

@@ -58,10 +58,8 @@ const MarketHeader = () => {
- {showPopUp ? : ""} - - + ); }; diff --git a/src/main/Browser/Sections/SubMenu/components/Market/Market.js b/src/main/Browser/Sections/SubMenu/components/Market/Market.js index fbf02104..7ceefd14 100644 --- a/src/main/Browser/Sections/SubMenu/components/Market/Market.js +++ b/src/main/Browser/Sections/SubMenu/components/Market/Market.js @@ -8,7 +8,7 @@ import AccordionBox from "../../../../../../components/AccordionBox/AccordionBox const Market = () => { const {t} = useTranslation(); - const [activeTab] = useState(JSON.parse(localStorage.getItem("activeMarketTab")) || 0); + const [activeTab] = useState(JSON.parse(localStorage.getItem("activeMarketTab")) || 1); const [fav, setFav] = useState(JSON.parse(localStorage.getItem("favPair")) || []); useEffect(() => { diff --git a/src/store/actions/actionTypes.js b/src/store/actions/actionTypes.js index 8ba8dd9d..7eab9d85 100644 --- a/src/store/actions/actionTypes.js +++ b/src/store/actions/actionTypes.js @@ -1,6 +1,7 @@ //main reducer actions export const SET_THEME = "SET_THEME"; export const SET_LOADING = "SET_LOADING"; +export const SET_ERROR = "SET_ERROR"; export const SET_THEME_INITIATE = "SET_THEME_INITIATE"; export const SET_IPG = "SET_IPG"; @@ -12,7 +13,6 @@ export const SET_ACTIVE_PAIR = "SET_ACTIVE_PAIR"; export const SET_ACTIVE_PAIR_INITIATE = "SET_ACTIVE_PAIR_INITIATE"; export const LOAD_CONFIG = "LOAD_CONFIG"; -export const LOAD_IMPERSONATE_CONFIG = "LOAD_IMPERSONATE_CONFIG"; export const SET_BUY_ORDERS = "SET_BUY_ORDERS"; export const SET_SELL_ORDERS = "SET_SELL_ORDERS"; @@ -34,7 +34,6 @@ export const SET_USER_ACCOUNT_INFO = "SET_USER_ACCOUNT_INFO"; export const SET_USER_ACCOUNT_INFO_INITIATE = "SET_USER_ACCOUNT_INFO_INITIATE"; export const SET_USER_TOKENS = "SET_USER_TOKENS"; -export const SET_IMPERSONATE_TOKENS = "SET_IMPERSONATE_TOKENS"; export const SET_USER_TOKENS_INITIATE = "SET_USER_TOKENS_INITIATE"; export const SET_USER_INFO = "SET_USER_INFO"; diff --git a/src/store/actions/auth.js b/src/store/actions/auth.js index 8f733075..fc69fcca 100644 --- a/src/store/actions/auth.js +++ b/src/store/actions/auth.js @@ -9,13 +9,6 @@ export const setUserTokens = (token) => { }; }; -export const setImpersonateTokens = (token) => { - return { - type: actionTypes.SET_IMPERSONATE_TOKENS, - accessToken: token, - }; -}; - export const setUserAccountInfo = (info) => { return { type: actionTypes.SET_USER_ACCOUNT_INFO, @@ -86,9 +79,3 @@ export const setLogoutInitiate = () => { type: actionTypes.LOGOUT_INITIATE, }; }; - -export const loadImpersonate = () => { - return { - type: actionTypes.LOAD_IMPERSONATE_CONFIG, - }; -}; \ No newline at end of file diff --git a/src/store/actions/exchange.js b/src/store/actions/exchange.js index 8049f0f4..422d526f 100644 --- a/src/store/actions/exchange.js +++ b/src/store/actions/exchange.js @@ -8,10 +8,9 @@ export const setActivePairInitiate = (pair, activeTab) => { }; }; -export const setActivePair = (pair , activeTab) => { +export const setActivePair = (pair) => { return { type: actionTypes.SET_ACTIVE_PAIR, - activeTab: activeTab, pair: pair, }; }; diff --git a/src/store/actions/global.js b/src/store/actions/global.js index 7718a51d..844b0417 100644 --- a/src/store/actions/global.js +++ b/src/store/actions/global.js @@ -3,27 +3,35 @@ import * as actionTypes from "./actionTypes"; export const setThemeInitiate = (isDark) => { return { type: actionTypes.SET_THEME_INITIATE, - isDark: isDark, + isDark, }; }; export const setTheme = (isDark) => { return { type: actionTypes.SET_THEME, - isDark: isDark, + isDark, }; }; export const setLoading = (isLoading) => { return { type: actionTypes.SET_LOADING, - isLoading: isLoading, + isLoading, }; }; -export const loadConfig = () => { +export const setError = (error) => { + return { + type: actionTypes.SET_ERROR, + error, + }; +}; + +export const loadConfig = (token) => { return { type: actionTypes.LOAD_CONFIG, + token }; }; diff --git a/src/store/actions/index.js b/src/store/actions/index.js index 70a32f1e..4f13ef66 100644 --- a/src/store/actions/index.js +++ b/src/store/actions/index.js @@ -3,6 +3,7 @@ export { setLoading, setThemeInitiate, setTheme, + setError, setInfoMessage, } from "./global"; @@ -30,7 +31,6 @@ export { changeUserInfo, setUserAccountInfo, setUserAccountInfoInitiate, - loadImpersonate, setKYCStatus } from "./auth"; diff --git a/src/store/reducers/authReducer.js b/src/store/reducers/authReducer.js index 3f80dc5c..67ec21bf 100644 --- a/src/store/reducers/authReducer.js +++ b/src/store/reducers/authReducer.js @@ -58,12 +58,6 @@ const reducer = (state = initialState, action) => { kyc: action.status, kycReason: action.reason }; - case actionTypes.SET_IMPERSONATE_TOKENS: - return { - ...state, - accessToken: action.accessToken, - isLogin: true, - } case actionTypes.SET_USER_TOKENS: return { ...state, diff --git a/src/store/reducers/exchangeReducer.js b/src/store/reducers/exchangeReducer.js index bb8e3453..d43b5130 100644 --- a/src/store/reducers/exchangeReducer.js +++ b/src/store/reducers/exchangeReducer.js @@ -43,7 +43,6 @@ const exchangeReducer = (state = initialState, action) => { bestSellPrice: 0, lastTradePrice: 0, }, - activeMarketTab: action.activeTab, }; case actionTypes.SET_BEST_BUY_PRICE: return { diff --git a/src/store/reducers/globalReducer.js b/src/store/reducers/globalReducer.js index e715713c..8d1f5539 100644 --- a/src/store/reducers/globalReducer.js +++ b/src/store/reducers/globalReducer.js @@ -1,9 +1,9 @@ import * as actionTypes from "../actions/actionTypes"; const initialState = { - activeMarketTab: 0, - isLoading: true, isDark: true, + isLoading: true, + hasError: false, info: { type: null, message: null, @@ -30,6 +30,11 @@ const globalReducer = (state = initialState, action) => { ...state, isLoading: action.isLoading, }; + case actionTypes.SET_ERROR: + return { + ...state, + hasError: action.error, + }; default: return state; } diff --git a/src/store/sagas/global.js b/src/store/sagas/global.js index 8a49d4ae..a35f4bd3 100644 --- a/src/store/sagas/global.js +++ b/src/store/sagas/global.js @@ -1,4 +1,4 @@ -import {put, call} from "redux-saga/effects"; +import {call, put} from "redux-saga/effects"; import * as actions from "../actions/index"; import jwtDecode from "jwt-decode"; import axios from "axios"; @@ -34,48 +34,64 @@ export function* getExchangeLastPrice() { } } -export function* loadConfig() { +export function* loadConfig(action) { + + yield put(actions.setLoading(true)) + yield put(actions.setError(false)) + const pairs = []; const assets = []; const wallets = {}; const tradeFee = {}; const lastPrice = {}; - const {data: {symbols}} = yield call(axios.get, '/api/v3/exchangeInfo') - - for (const symbol of symbols) { - if (symbol.symbol.toUpperCase().includes("NLN")) continue - if (!assets.includes(symbol.baseAsset)) { - assets.push(symbol.baseAsset) - wallets[symbol.baseAsset] = {free: 0.0, locked: 0.0, withdraw: 0.0} - tradeFee[symbol.baseAsset] = 0.01 - } - if (!assets.includes(symbol.quoteAsset)) { - assets.push(symbol.quoteAsset) - wallets[symbol.quoteAsset] = {free: 0.0, locked: 0.0, withdraw: 0.0} - tradeFee[symbol.quoteAsset] = 0.01 + try { + const {data: {symbols}} = yield call(axios.get, '/api/v3/exchangeInfo') + for (const symbol of symbols) { + if (symbol.symbol.toUpperCase().includes("NLN")) continue + if (!assets.includes(symbol.baseAsset)) { + assets.push(symbol.baseAsset) + wallets[symbol.baseAsset] = {free: 0.0, locked: 0.0, withdraw: 0.0} + tradeFee[symbol.baseAsset] = 0.01 + } + if (!assets.includes(symbol.quoteAsset)) { + assets.push(symbol.quoteAsset) + wallets[symbol.quoteAsset] = {free: 0.0, locked: 0.0, withdraw: 0.0} + tradeFee[symbol.quoteAsset] = 0.01 + } + if (!pairs.includes(symbol.symbol)) pairs.push(symbol.symbol) + symbol.baseRange = {min: 0.000001, max: 100000, step: 0.00001} + symbol.quoteRange = {min: 0.000001, max: 100000, step: 0.00001} + symbol.name = symbol.baseAsset+"/"+symbol.quoteAsset + lastPrice[symbol.symbol] = 0 } - if (!pairs.includes(symbol.symbol)) pairs.push(symbol.symbol) - symbol.baseRange = {min: 0.000001, max: 100000, step: 0.00001} - symbol.quoteRange = {min: 0.000001, max: 100000, step: 0.00001} - symbol.name = symbol.baseAsset+"/"+symbol.quoteAsset - lastPrice[symbol.symbol] = 0 - } - yield put(actions.setExchange({pairs, assets, symbols, lastPrice})); - yield put(actions.setUserAccountInfo({wallets, tradeFee})); + yield put(actions.setExchange({pairs, assets, symbols, lastPrice})); + yield put(actions.setUserAccountInfo({wallets, tradeFee})); - const isDark = yield call([localStorage, 'getItem'], 'isDark') - const lockTime = yield call([localStorage, 'getItem'], 'lockTime') + const activePair = yield call([localStorage, 'getItem'], 'activePair') + const lastActivePair = symbols.find(symbol => symbol.symbol === activePair) + yield put(actions.setActivePair(lastActivePair || symbols[0])); - const activePair = yield call([localStorage, 'getItem'], 'activePair') - const activeMarketTab = yield call([localStorage, 'getItem'], 'activeMarketTab') + } catch (e) { + yield put(actions.setError(true)) + return yield put(actions.setLoading(false)); + } - if (lockTime) yield put(actions.setIPG(lockTime)); + const isDark = yield call([localStorage, 'getItem'], 'isDark') if (isDark) yield put(actions.setTheme(JSON.parse(isDark))); - const lastActivePair = symbols.find(symbol => symbol.symbol === activePair) - yield put(actions.setActivePair(lastActivePair || symbols[0], activeMarketTab)); + if (action.token) { + yield put(actions.setUserTokens({refreshToken : null, accessToken: action.token})); + yield call([localStorage, 'removeItem'], "refreshToken") + const jwt = jwtDecode(action.token) + yield put(actions.setUserInfo(jwt)); + yield getUserAccount(); + return yield put(actions.setLoading(false)); + } + + const lockTime = yield call([localStorage, 'getItem'], 'lockTime') + if (lockTime) yield put(actions.setIPG(lockTime)); const refreshToken = localStorage.getItem("refreshToken") @@ -89,6 +105,7 @@ export function* loadConfig() { try { const {data: {access_token}} = yield call(axios.post, '/auth/realms/opex/protocol/openid-connect/token', params) const jwt = jwtDecode(access_token) + yield call([localStorage, 'setItem'], "refreshToken", refreshToken) yield put(actions.setUserTokens({refreshToken, accessToken: access_token})); yield put(actions.setUserInfo(jwt)); yield getUserAccount(); @@ -99,49 +116,3 @@ export function* loadConfig() { yield put(actions.setLoading(false)); } - -export function* load_impersonate() { - const pairs = []; - const assets = []; - const wallets = {}; - const tradeFee = {}; - const lastPrice = {}; - - const {data: {symbols}} = yield call(axios.get, '/api/v3/exchangeInfo') - - for (const symbol of symbols) { - if (symbol.symbol.toUpperCase().includes("NLN")) continue - if (!assets.includes(symbol.baseAsset)) { - assets.push(symbol.baseAsset) - wallets[symbol.baseAsset] = {free: 0.0, locked: 0.0, withdraw: 0.0} - tradeFee[symbol.baseAsset] = 0.01 - } - if (!assets.includes(symbol.quoteAsset)) { - assets.push(symbol.quoteAsset) - wallets[symbol.quoteAsset] = {free: 0.0, locked: 0.0, withdraw: 0.0} - tradeFee[symbol.quoteAsset] = 0.01 - } - if (!pairs.includes(symbol.symbol)) pairs.push(symbol.symbol) - symbol.baseRange = {min: 0.000001, max: 100000, step: 0.00001} - symbol.quoteRange = {min: 0.000001, max: 100000, step: 0.00001} - symbol.name = symbol.baseAsset+"/"+symbol.quoteAsset - lastPrice[symbol.symbol] = 0 - } - yield put(actions.setExchange({pairs, assets, symbols, lastPrice})); - yield put(actions.setUserAccountInfo({wallets, tradeFee})); - - const isDark = yield call([localStorage, 'getItem'], 'isDark') - const lockTime = yield call([localStorage, 'getItem'], 'lockTime') - - const activePair = yield call([localStorage, 'getItem'], 'activePair') - const activeMarketTab = yield call([localStorage, 'getItem'], 'activeMarketTab') - - if (lockTime) yield put(actions.setIPG(lockTime)); - if (isDark) yield put(actions.setTheme(JSON.parse(isDark))); - - const lastActivePair = symbols.find(symbol => symbol.symbol === activePair) - - yield put(actions.setActivePair(lastActivePair || symbols[0], activeMarketTab)); - - yield put(actions.setLoading(false)); -} diff --git a/src/store/sagas/index.js b/src/store/sagas/index.js index 7650f15e..c6fe9a8b 100644 --- a/src/store/sagas/index.js +++ b/src/store/sagas/index.js @@ -1,7 +1,7 @@ import {takeEvery} from "redux-saga/effects"; import * as actionTypes from "../actions/actionTypes"; -import {setThemeSaga, loadConfig, setActivePair, setIPGLock, getExchangeLastPrice, load_impersonate} from "./global"; +import {getExchangeLastPrice, loadConfig, setActivePair, setIPGLock, setThemeSaga} from "./global"; import {getUserAccount, getUserKYCStatus, logout, setUserTokens} from "./auth"; @@ -15,6 +15,4 @@ export function* watchGlobal() { yield takeEvery(actionTypes.SET_KYC_STATUS_INITIATE, getUserKYCStatus); yield takeEvery(actionTypes.SET_USER_ACCOUNT_INFO_INITIATE, getUserAccount); yield takeEvery(actionTypes.SET_LAST_PRICE_INITIATE, getExchangeLastPrice); - yield takeEvery(actionTypes.LOAD_IMPERSONATE_CONFIG, load_impersonate); - } From 0b4fd46422ccc6fa6cf126c8c501428ef335624b Mon Sep 17 00:00:00 2001 From: Benyamin001 <23664159+Benyamin001@users.noreply.github.com> Date: Sun, 22 May 2022 17:16:58 +0430 Subject: [PATCH 02/42] add Error Component --- .../FullWidthError/FullWidthError.js | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/components/FullWidthError/FullWidthError.js diff --git a/src/components/FullWidthError/FullWidthError.js b/src/components/FullWidthError/FullWidthError.js new file mode 100644 index 00000000..40eab33b --- /dev/null +++ b/src/components/FullWidthError/FullWidthError.js @@ -0,0 +1,24 @@ +import {useDispatch} from "react-redux"; +import useQuery from "../../Hooks/useQuery"; +import {loadConfig} from "../../store/actions"; +import {useTranslation} from "react-i18next"; + +const FullWidthError = () => { + const dispatch = useDispatch(); + const {t} = useTranslation(); + const query = useQuery(); + + const tryLoadConfig = () => { + const impersonate = query.get("impersonate"); + dispatch(loadConfig(impersonate)) + } + return ( +
+
+

{t("errorPage.errorText")}

+ +
+
+ ); +}; +export default FullWidthError; From 46b53f217fdbc9b7cbc38c19e2482978a70992c0 Mon Sep 17 00:00:00 2001 From: Benyamin001 <23664159+Benyamin001@users.noreply.github.com> Date: Sun, 29 May 2022 13:30:50 +0430 Subject: [PATCH 03/42] add en translation --- public/locales/en/translation.json | 487 +++++++++++++----- public/locales/fa/translation.json | 238 ++++----- src/index.css | 29 +- src/main/Browser/Browser.css | 9 - .../components/OrdersHistory/OrdersHistory.js | 4 +- .../Authentication/Authentication.js | 6 +- .../SendToAdminStep.js} | 22 +- .../SendToAdminStep.module.css} | 0 .../PersonalizationForm.js | 11 +- .../ActiveSessions/ActiveSessions.js | 2 +- .../ChangePassword/ChangePassword.js | 22 +- .../components/Deposit/components/IRT/IRT.js | 16 +- .../DepositWithdrawTx/DepositWithdrawTx.js | 22 +- .../components/OrdersTrades/OrdersTrades.js | 4 +- .../OrdersTradesFilter/OrdersTradesFilter.js | 2 +- src/main/Browser/Sections/Footer/Footer.js | 3 +- .../MessagesSubMenu/MessagesSubMenu.js | 9 +- .../SettingsSubMenu/SettingsSubMenu.js | 2 +- 18 files changed, 508 insertions(+), 380 deletions(-) rename src/main/Browser/Sections/Content/components/Settings/components/Authentication/components/{SendToExpertStep/SendToExpertStep.js => SendToAdminStep/SendToAdminStep.js} (78%) rename src/main/Browser/Sections/Content/components/Settings/components/Authentication/components/{SendToExpertStep/SendToExpertStep.module.css => SendToAdminStep/SendToAdminStep.module.css} (100%) diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index d5a5bf52..660b3a2c 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -1,30 +1,55 @@ { - "title": "Opex", - "signIn":"Sign in", - "signOut":"Sing out", - "min": "Min", - "max": "Max", - "buy": "Buy", + "title": "OPEX", + "signIn":"Sign In", + "signUp": "Sign Up", + "signOut":"Sign Out", "date": "Date", "time": "Time", - "sell": "Sell", - "totalPrice": "Total Price", - "averagePrice": "Average Price", - "pricePerUnit": "Price Per Unit", "volume": "Volume", "totalVolume": "Total Volume", "price": "Price", + "pricePerUnit": "Price Per Unit", + "totalPrice": "Total Price", + "averagePrice": "Average Price", + "min": "Min", + "max": "Max", + "buy": "Buy", + "sell": "Sell", "all": "All", "orderType": "Order Type", "status" : "Status", - "pleaseLogin" : "Please Login!", - "comingSoon" : "Coming Soon :)", + "pleaseLogin" : "Please Log In!", + "comingSoon" : "Coming Soon!", + "deposit": "Deposit", + "withdrawal": "Withdrawal", + "transfer": "Transfer", + "destination": "Destination", + "details": "Details", + "commission": "Commission", "nextStep": "Next Step", "prevStep": "Prev Step", "submit": "Submit", - "commission": "Commission", - "error": "Something wrong happened !", - "loading": "Loading....", + "username": "Username", + "password": "Password", + "otp": "OTP", + "firstName": "First Name", + "lastName": "Last Name", + "email": "Email", + "captchaAnswer": "Captcha", + "desktopSupport": "Mobile view not available!", + "error": "Something Wrong Happened!", + "loading": "Loading...", + "noData": "No content to show!", + "noTx": "There is no transaction!", + "close": "Close", + "unit": "Unit", + "offline": "Check your connection!", + "country": { + "iran" : "I. R. IRAN", + "germany" : "Germany", + "uk": "United Kingdom", + "turkey" : "Turkey" + }, "currency": { "IRT" : "IRT", "Euro" : "Euro", @@ -39,54 +64,66 @@ "BUSD": "BUSD", "DOGE": "DOGE", "LTC": "LTC", - "BCH": "BCH", - "NLN": "NLN" - }, - "ordersStatus": { - "live": "Live", - "reject": "Reject", - "done": "Done", - "cancel": "Canceled", - "doing": "Processing" + "BCH": "BCH" + }, + "routes": { + "/settings/profile": "User Profile", + "/settings/security": "Security", + "/settings/personalization": "Customize", + "/settings/authentication": "Identity Verification" + }, + "orderStatus": { + "NEW": "New Order", + "REJECTED": "Rejected", + "FILLED": "Filled", + "CANCELED": "Canceled", + "PENDING_CANCEL": "Pending Cancel", + "EXPIRED": "Expired", + "PARTIALLY_FILLED": "Partially Filled" + }, + "paymentStatus": { + "Open": "Open", + "Canceled": "Canceled", + "Expired": "Expired", + "Done": "Done", + "Failed": "Failed", + "Undefined": "Undefined" + }, + "messagesTitle": { + "successful": "successful", + "login": "Successful login", + "cancel": "cancel order", + "done": "done", + "inCompleted": "inCompleted" }, "orderTypes": { - "stopLimit" : "Stop Limit", - "stopMarket" : "Stop Market" - }, - "pair": { - "BTC/IRT" : "BTC/IRT", - "ETH/IRT" : "ETH/IRT", - "ETH/BTC": "ETH/BTC", - "BTC/USDT": "BTC/USDT", - "TBTC/TUSDT": "TBTC/TUSDT", - "TETH/TUSDT": "TETH/TUSDT", - "LTC/BTC": "LTC/BTC", - "DOGE/BTC": "DOGE/BTC", - "BCH/BTC": "BCH/BTC", - "LTC/IRT": "LTC/IRT", - "LTC/USDT": "LTC/USDT", - "DOGE/IRT": "DOGE/IRT", - "BCH/IRT": "BCH/IRT", - "ETH/USDT": "ETH/USDT", - "BNB/IRT": "BNB/IRT", - "BNB/USDT": "BNB/USDT", - "BUSD/IRT": "BUSD/IRT", - "DOGE/USDT": "DOGE/USDT", - "BCH/USDT": "BCH/USDT", - "NLN/BTC": "NLN/BTC", - "NLN/USDT": "NLN/USDT" + "LIMIT": "Limit", + "MARKET": "Market", + "STOP_LOSS": "Stop Loss", + "STOP_LOSS_LIMIT": "Stop Loss Limit", + "TAKE_PROFIT": "Take Profit", + "TAKE_PROFIT_LIMIT": "Take Profit Limit", + "LIMIT_MAKER": "Limit Maker" }, "header": { "lastPrice" : "Last Price", - "availableBalance" : "Available Balance" + "availableBalance" : "Available Balance", + "free": "Available", + "locked": "Locked", + "inWithdrawalProcess": "Pending Withdrawal", + "logOutSuccess": "Successfully logged out.", + "logOutError": "An error occurred. please try again!" }, "overview": { "title": "Overview", "change": "Change", "volume": "Volume", - "lastDay": "24 Hour", - "lastWeek": "7 Week", - "lastMonth": "30 Day" + "lastDay": "24 Hours", + "lastWeek": "1 Week", + "lastMonth": "30 Days" + }, + "market": { + "title": "Market" }, "wallet": { "title": "Wallet" @@ -100,11 +137,29 @@ "settings": { "title": "Settings" }, + "Languages": { + "Persian": "فارسی", + "English": "English", + "Arabic": "عربي" + }, + "Theme": { + "Light": "Light", + "Dark": "Dark" + }, + "Calendar": { + "IRCalender": "Iranian Calender", + "GCCalender": "Gregorian Calender" + }, + "TimeZone": { + "THR": "Asia / Tehran / UTC+3:30", + "UTC" : "UTC" + }, "orders": { "title": "Order", "minOrder": "Minimum allowed order is {{min}} {{currency}}", "maxOrder": "Maximum allowed order is {{max}} {{currency}}", "divisibility": "Divisibility !", + "notEnoughBalance": "Insufficient Balance ", "availableAmount": "Available Amount", "bestOffer": "Best Offer", "stopLimit": "Stop Limit", @@ -115,25 +170,27 @@ "marketSellPrice": "Market Sell", "totalPrice": "Total Price", "tradeFee": "Exchange Fee", - "getAmount": "Received Amount" + "getAmount": "Received Amount", + "error": "Error!", + "success": "The {{type}} order of {{reqAmount}} {{base}} is registered at the price of {{pricePerUnit}} {{quote}}." }, "LastTrades": { - "title": "Last Trades", - "date": "Date", - "time": "Time", - "volume": "Amount", - "price": "Price", - "totalPrice": "Total Price" + "title": "Recent Trades" + }, + "charts": { + "title": "Charts", + "globalChart": "Global", + "opexChart": "Opex" }, "orderBook": { "title": "Order Book" }, "myOrders": { "title": "My Orders", + "donePercentage": "% done", + "stoppedPrice": "Stopped Price", "orderId": "Order ID", "tradeId": "Trade ID", - "stoppedPrice": "Stopped Price", - "donePercentage": "% done", "tradedAmount": "Traded", "avgTradedAmount": "Avg Traded Amount", "tradedPrice": "Traded Price", @@ -142,25 +199,81 @@ "orderHistory": "History", "stopOrderTime": "Stop Order Time", "startOrderTime": "Start Order Time", - "orders": "Orders" - }, - "Deposit": { - "title": "Deposit/Withdrawal", - "deposit": "Deposit", - "withdrawal": "Withdrawal", - "transfer": "Transfer" - }, - "DepositTransactions": { - "title": "Deposit/Withdrawal Transactions", - "depositWithdrawal": "Deposit/Withdrawal", - "withdrawalSend": "Withdrawal/Send", + "cancelOrder": "Cancel Order", + "orders": "Orders", + "cancelSuccess": "Order successfully canceled!", + "cancelError": "Order not canceled" + }, + "WalletSubMenu": { + "title": "Wallet", + "totalValue": "Total Value", + "approximate": "Approximate", + "equivalent": "Equivalent", + "showZeroBalance": "Do not show zero balance." + }, + "DepositWithdraw": { + "title": "Deposit / Withdraw", + "success": "The Address is copied.", + "copy": "Copied!", + "IRTAllowable": "The minimum amount must be {{min}} IRT and the maximum {{max}} IRT.", + "emptyInput": "Enter the required value.", + "IRTText": "The invoice with the amount of {{amount}} IRT is created on {{date}}, {{time}. you will be directed to the payment portal through the green button below. To create a new invoice, pay or cancel the previous invoice.", + "IRTFormText": "To deposit, first, create an invoice, the allowed amount of the deposit is at least {{min}} IRT and at most {{max}} IRT.", + "pay": "Pay", + "cancel": "Cancel", + "seconds": "Seconds", + "submitPaymentReq": "Submit Payment Request", + "noInventory": "Your balance is not enough.", + "allowableWithdraw": "Minimum allowable withdrawal amount has not been observed.", + "fillAddress": "You must enter an address.", + "important": "Important", + "DepositTETHContentBefore": "فقط ETH تستی شبکه Ropsten مورد قبول قرار می گیرد! برای دریافت رایگان به ", + "DepositTETHContentAfter": " بروید. برای ارسال ETH تستی به این آدرس، باید شبکه اتریومی کیف پول خود را به Ropsten تغییر دهید. این شبکه به طور پیش فرض در فهرست شبکه های کیف پول Metamask وجود دارد. هر تراکنشی با مقدار مساوی یا بیشتر از ۰.۰۰۱ ETH به آدرس بالا، به حساب شما افزوده می شود.", + "minDeposit": "حداقل میزان قابل قبول {{min}} {{currency}}", + "minDepositText": "هر تراکنشی با مقدار بیشتر از {{min}} {{currency}} به آدرس زیر ، به حساب شما افزوده می شود.", + "DepositTBTCContentBefore": "فقط BTC تستی مورد قبول قرار می گیرد! برای دریافت رایگان به ", + "DepositTBTCContentAfter": " بروید. هر تراکنشی با مقدار مساوی یا بیشتر از ۰.۰۰۱ BTC به آدرس بالا، به حساب شما افزوده می شود.", + "DepositTUSDTContentBefore": "فقط USDT تستی شبکه Ropsten مورد قبول قرار می گیرد! برای آشنایی با روش دریافت رایگان به ", + "DepositTUSDTContentAfter": " بروید. برای ارسال USDT تستی به این آدرس، باید شبکه اتریومی کیف پول خود را به Ropsten تغییر دهید. این شبکه به طور پیش فرض در فهرست شبکه های کیف پول Metamask وجود دارد. هر تراکنشی با مقدار مساوی یا بیشتر از ۱۰ USDT به آدرس بالا، به حساب شما افزوده می شود.", + "depositTime": "* موجودی شما {{time}} دقیقه بعد از واریز به آدرس بالا، افزایش پیدا می کند.", + "securityConsiderations": "باتوجه به ملاحضات امنیتی ممکن است انتقال به حساب با کمی تاخیر صورت بگیرد. می توانید وضعیت برداشت را در همین صفحه از بخش ترکنش های واریز/برداشت ببینید." + }, + "CallbackPage": { + "ok": "The deposit was successful.", + "failed": "Deposit failed.", + "noData": "No content to show!", + "errorMessage": "Error Message" + }, + "IPGErrorCode": { + "13003": "You are not allowed to pay.", + "13004":"You have an unpaid request.", + "13005": "Request locked.", + "13007": "Unknown Error" + }, + "DepositWithdrawTx": { + "title": "Deposit / Withdraw Transactions", + "depositWithdrawal": "Deposit / Withdrawal", + "withdrawalSend": "Withdrawal / Send", "transactionType": "Transaction Type", "transactionId": "Transaction ID", - "blockchainTransactionId": "Transaction Hash", + "blockchainTransactionId": "Blockchain Transaction ID", "price": "Price", - "destination": "Sender/Recipient", - "details": "Details", - "inventory": "Account Balance" + "destination": "Origin / Destination", + "inventory": "Inventory after transaction", + "freeWallet": "Free Asset", + "minWithdraw": "Minimum withdrawal amount", + "minDeposit": "Minimum Deposit Amount", + "maxWithdraw": "Your daily withdrawal limit", + "maxMonthWithdraw": "Your monthly withdrawal limit", + "withdrawWarn": "Please note! Incorrect entry of address can result in loss of capital.", + "withdrawReqSubmit": "withdraw withdrawal request", + "destAddress": "Receive Address", + "reqAmount": "Your Receipt", + "network": "Network", + "success": "{{amount}} {{asset}} withdrawal request is successfully registered", + "IRTsuccess": "Deposit request {{amount}} Tomans is successfully registered", + "cancel": "cancel", + "cancelPayment": "Payment operation canceled!" }, "transactionType": { "deposit": "Deposit", @@ -169,20 +282,22 @@ "send": "Send" }, "OrdersTrades": { - "title": "Orders/Trades", - "aliveOrder": "Alive Order", + "title": "Orders and Transactions", + "aliveOrder": "Current Orders", "stop": "Stop", - "cancelClose": "Canceled/Close", + "cancelClose": "Canceled and closed", "trades": "Trades", - "market": "Market", "side": "Side", "order": "Order", "done": "Done", - "donePercentage": "Done %" + "donePercentage": "% done", + "stoppedPrice": "Stop price", + "ordersHistory": "Order History", + "type": "type", + "market": "Market", + "limit": "Limited", + "paid": "Paid" }, - - - "MessagesSubMenu": { "title": "Notifications", "myMessages": "My Messages", @@ -195,21 +310,32 @@ "personalization": "Personalization", "authentication": "Authentication" }, - "UserAccountStatus": { - "title": "وضعیت حساب کاربری" + "title": "Account Status", + "userAccountLevel1": "User Level 1", + "minInput": "{{name}} must be at least {{min}} characters.", + "dailyWithdrawal": "Daily currency withdrawal: equivalent to {{amount}} Tomans from 20,000,000 Tomans", + "dailyDeposit": "Daily foreign currency deposit: equivalent to {{amount}} Tomans from 20,000,000 Tomans", + "dailyWithdrawalCryptoCurrency": "Daily cryptocurrency withdrawal: equivalent to {{amount}} of 20,000,000 Tomans", + "dailyDepositCryptoCurrency": "Daily cryptocurrency deposit: equivalent to {{amount}} of 20,000,000 Tomans", + "monthlyWithdrawal": "Monthly currency withdrawal: equivalent to {{amount}} Tomans from 20,000,000 Tomans", + "monthlyDeposit": "Monthly deposit: equivalent to {{amount}} of 20,000,000 Tomans", + "monthlyWithdrawalCryptoCurrency": "Monthly cryptocurrency withdrawal: equivalent to {{amount}} of 20,000,000 Tomans", + "monthlyDepositCryptoCurrency": "Monthly deposit deposit: equivalent to {{amount}} Tomans from 20,000,000 Tomans", + "tradesCommission": "Trading fee: {{amount}} taker, {{num}}" }, "PersonalProfile": { "title": "Personal Profile", - "userLevel/fee": "سطح کاربری/کارمزدها", + "cantEdit": "Your authentication is complete. Your cannot edit your profile.", + "userLevel / fee": "User Level / Fees", "firstNameEn": "Firstname (English)", "lastNameEn": "Lastname (English)", "firstNameMain": "Firstname (Main Language)", "lastNameMain": "Lastname (Main Language)", "nationality": "Nationality", "residence": "Residence", - "dateOfBirth": "Date Of Birth ( )", - "dateOfBirthAlt": "Date Of Birth ( )", + "birthdayG": "Date of birth", + "birthdayJ": "Date of birth (Hijri)", "nationalID": "National ID", "passportNumber": "Passport Number", "phoneNumber": "Phone Number", @@ -220,76 +346,171 @@ "selectNationality": "Select your nationality", "selectResidence": "Select your country of residence" }, - "LoginReports": { "title": "Login Reports" }, "ActiveSessions": { - "title": "Active Sessions" + "title": "Active Sessions", + "ip": "IP", + "LOGGED_IN": "Logged in", + "LOGGING_OUT": "Logging out", + "LOGGED_OUT": "Logged out", + "details": "Details", + "closeSession": "Close Session", + "success": "{{location}} session closed successfully.", + "logOutAllSuccess": "Other sessions closed successfully.", + "logOutAllError": "Server error, please try again.", + "noData": "Item not found!", + "thisSession": "Current Session", + "otherSession": "Other Sessions", + "closeOtherSessions": "Close all other sessions." }, "ChangePassword": { - "title": "Change Password" + "title": "Change Password", + "newPassword": "New Password", + "confirmation": "New Password Confirmation", + "currentPassword": "Current Password", + "success": "Password changed successfully.", + "error": "Password change failed.", + "minInput": "{{name}} must be at least {{min}} characters.", + "emptyInput": "You must enter the {{name}} field.", + "confirmationError": "New password and confirm password don't match.", + "currentPasswordError": "Current password has been entered incorrectly." }, "SetTwoStepVerification": { - "title": "Set Two Step Verification" + "title": "Set Two Step Verification", + "!title": "Disable 2-Step Login", + "code": "Code", + "active": "Activate", + "isActive": "Two-step login is enabled.", + "deActive": "Deactivate", + "success": "Two-step login enabled successfully.", + "error": "Two-step login has been disabled.", + "initialCodeMin": "The code must be 6 digits long.", + "initialCodeError": "Entered code is incorrect.", + "serverError": "Server error, please try again.", + "description": "If two-step login is enabled, a two-step password will be requested for each login to the user panel.", + "QRdescription": "Scan the QR code using the Google Authenticator software (or similar), enter the 6-digit number and register." }, "HelpStep": { - "title": "Step 1 of 4: Help" + "title": "Step 1 of 4: User's Guide", + "content": "In order to use all services of this exchange and activate withdrawing option, your identity must be verified. The authentication process is simple and online. In the next steps, you will be asked to enter your personal information in the relevant form. Enter and send the pictures, ID card and the agreement letter." }, "PersonalProfileStep": { - "title": "Step 2 of 4: Enter Personal Information" + "title": "Step 2 of 4: Enter Your Personal Information.", + "serverError": "Error retrieving information, please try again.", + "minInput": "{{name}} must be at least {{min}} characters.", + "wrongDateG": "Wrong date format!", + "wrongDateJ": "Wrong date format!", + "wrongNationalId": "You personal ID number is incorrect!", + "wrongPassportNumber": "Passport number is incorrect!", + "emptyInput": "{{name}} field is required.", + "yy/mm//dd": "Day/Month/Year" }, "SendPhotosStep": { - "title": "Step 3 of 4: Send Photos" - }, - "SendToExpertStep": { - "title": "Step 4 of 4: Send To Expert" + "title": "Step 3 of 4: Send Pictures", + "content": "To complete the authentication, please follow the steps below:", + "acceptForm": "1) Write the agreement letter to use the services on an A4 paper, sign and take a photo of it.", + "selfie": "2) Take a selfie of yourself holding the agreement letter in front of your chest.", + "idCard": "3) Take a selfie of yourself holding a birth certificate or ID card in front of your chest.", + "acceptFormLink": "(Agreement Letter Sample)", + "selfieLink": "(Sample)", + "idCardLink": "(Sample)", + "acceptFormDropzone": "Agreement Letter:", + "selfieDropzone": "Selfie with Agreement Letter:", + "idCardDropzone": "Selfie with a birth certificate or ID card", + "sendingData": "Sending Data...", + "imageAcceptedFormat": "- Please upload photos in JPEG and PNG format only!", + "imageAcceptedSize": "- The maximum acceptable size for uploading the photos is 1 MB!", + "acceptFormEmpty": "Upload a photo of the agreement letter!", + "selfieEmpty": "Upload a selfie with the print of your agreement letter in your hands!", + "idCardEmpty": "Upload a selfie with your ID card!", + "serverError": "Error sending pictures, try again!" + }, + "SendToAdminStep": { + "title": "Step 4 of 4: Send to Admin", + "content": "Profile registered successfully. Your authentication status is as follows:", + "pending": "Pending", + "accepted": "Authentication has been completed successfully.", + "rejected": "Authentication failed, please try again!", + "blocked": "Authentication failed!", + "noData": "No Data!", + "errorMessage": "Error Message" + }, + "Authentication": { + "HelpStep": "User's Guide", + "PersonalProfileStep": "Personal Profile", + "SendPhotosStep": "Send Photos", + "SendToAdminStep": "Send to Admin" + }, + "PersonalizationForm": { + "title": "Personalization", + "placeholder": "Select", + "defaultLang": "Default Language", + "defaultTheme": "Default Theme", + "defaultCalendarSystem": "Default Calendar System", + "defaultTimeZone": "Time Zone", + "defaultReferenceCurrency": "Reference Currency", + "defaultReferenceCryptoCurrency": "Reference Cryptocurrency", + "save": "Save" }, "login": { "title": "Login/Register", - "wrongPassword": "نام کاربری یا رمز عبور صحیح نمی باشد!", + "wrongPassword": "Username or password is incorrect!", + "wrongOTP": "Entered OTP is incorrect!", "forgetPassword": "Forget Password", - "accountNotActive": "اکانت شما هنوز فعال نشده است", + "accountNotActive": "Your account has not been activated yet.", "enter": "Enter", "resetPassword": "Reset Password", - "inputError": "تعداد کاراکتر نام کاربری یا رمز ورود مجاز نیست.", - "loginError": "خطا در ارتباط با سرور", - "registerFinished": "ثبت نام با موفقیت انجام شد :)", - "forgetPasswordFinished": "درخواست بازیابی رمز عبور با موفقیت ارسال شد :)", - "registerFinishedGoToMail": "برای تکمیل ثبت نام به ایمیل ثبت شده مراجعه فرمایید.", - "registerFinishedSpamMail": "ایمیل دریافتی از آدرس for.demo.purpose.only@opex.dev ممکن است در بخش spam باشد.", + "inputError": "Password / Username characters input not valid.", + "loginError": "Server connection error!", + "registerFinished": "Registration completed successfully!", + "forgetPasswordFinished": "Password recovery request sent successfully!", + "registerFinishedGoToMail": "Please go to your registered email to complete the registration.", + "registerFinishedSpamMail": "Email sent from for.demo.purpose.only@opex.dev may be in your spam folder!", "register": "Register", - "wrongEmail": "ایمیل وارد شده معتبر نیست.", - "notFoundEmail": "ایمیل وارد شده یافت نشد.", - "emptyEmail": "ایمیل را وارد کنید.", - "emptyInput": "وارد کردن فیلد {{name}} الزامی است.", - "emptyCredentialError": "وارد کردن فیلد نام کاربری و رمز ورود الزامی است.", - "minInput": "{{name}} حداقل باید {{min}} کاراکتر باشد.", - "finishedWithError": "خطا در ایجاد کاربر جدید.", - "back": "Back" - }, - - - - "market": { - "title": "Market" - }, - "footer" : { - "changeColor": "Change Color", + "wrongEmail": "The entered email is invalid!", + "emptyEmail": "Enter your email.", + "emptyInput": "Username and Password field is required.", + "emptyCredentialError": "Entering username and password is required.", + "minInput": "{{name}} must be at least {{min}} characters.", + "finishedWithError": "Error creating new user!", + "back": "Back", + "description": "OPen source EXchange", + "OTPRequired": "A two-factor password (OTP) is required!", + "otpLength": "The two-factor code must be 6 characters.", + "refreshCaptcha": "Show captcha again!", + "captchaServerError": "Server error to get Captcha!", + "InvalidCaptcha": "Captcha entered incorrectly!", + "minCaptcha": "Captcha must be 5 characters!", + "emptyCaptcha": "Captcha required!", + "forgetPassServerError": "Error recovering password, try again!", + "forgetPassEmailForgetError": "Email format is incorrect!" + }, + "footer": { + "darkMode": "Dark Mode", "aboutUs" : "About Us", "contactUS" : "Contact Us", "blog" : "Blog", "guide": "Guide", "rules": "Rules", - "api": "Api", + "api": "API", "addCoin": "Add Coin", "demo": "Market Demo", "errorReport": "Error Report", - "copyright": "© 2021 Opex All rights reserved" - }, - "junk": { - "t": "T", - "billionT": "Billion T", - "vol": "Vol" + "copyright": "© 2021 OPEX. All rights reserved." + }, + "ImageInput": { + "title": "", + "dropText": "Upload by drag and drop / browsing.", + "iconErrorText": "The uploaded photo is not valid, please try again!", + "fileTooLarge": "The uploaded file size is larger than the maximum allowed!", + "fileInvalidType": "Uploaded file format is not acceptable!", + "tooManyFiles": "Uploading more than one photo is not allowed!", + "errorMsgDefault": "Uploaded photo is not valid!" + }, + "errorPage" : { + "reload" : "Try Again", + "errorText" : "خطا در ارتباط با سرور" } } \ No newline at end of file diff --git a/public/locales/fa/translation.json b/public/locales/fa/translation.json index 0e931e5e..5f4c8b44 100644 --- a/public/locales/fa/translation.json +++ b/public/locales/fa/translation.json @@ -15,13 +15,11 @@ "max": "حداکثر", "buy": "خرید", "sell": "فروش", - "BUY": "خرید", - "SELL": "فروش", "all": "همه", "orderType": "نوع سفارش", "status": "وضعیت", - "pleaseLogin": "لطفا وارد شوید!", - "comingSoon": "به زودی :)", + "pleaseLogin": "لطفاً وارد شوید!", + "comingSoon": "به زودی!", "deposit": "واریز", "withdrawal": "برداشت", "transfer": "انتقال", @@ -33,26 +31,25 @@ "submit": "ثبت", "username": "نام کاربری", "password": "رمز ورود", - "otp": "رمز دو عاملی", + "otp": "رمز دو مرحله‌ای", "firstName": "نام", "lastName": "نام خانوادگی", "email": "ایمیل", "captchaAnswer": "Captcha", - "desktopSupport": "اوپکس فعلاً برای نمایش در موبایل بهینه نشده است. لطفاً لینک را در کامپیوتر باز کنید! :)", - "error": "خطا در دریافت اطلاعات ... !", - "loading": "در حال دریافت اطلاعات ...", + "desktopSupport": "اوپکس فعلاً برای نمایش در موبایل بهینه نشده است. لطفاً لینک را در کامپیوتر باز کنید!", + "error": "خطا در دریافت اطلاعات!", + "loading": "در حال دریافت اطلاعات...", "noData": "موردی برای نمایش وجود ندارد!", - "noTx": "تراکنشی وجود ندارد", + "noTx": "تراکنشی وجود ندارد.", "close": "بستن", "unit": "واحد", - "offline": "اتصال اینترنت را برسی کنید!", + "offline": "اتصال اینترنت را بررسی کنید!", "country": { "iran" : "جمهوری اسلامی ایران", "germany" : "آلمان", "uk": "انگلستان", "turkey" : "ترکیه" }, - "currency": { "IRT": "تومان", "Euro": "یورو", @@ -67,18 +64,15 @@ "BUSD": "دلار بایننس", "DOGE": "دوج کوین", "LTC": "لایت کوین", - "BCH": "بیتکوین کش", - "NLN": "اپکس" + "BCH": "بیتکوین کش" }, - "routes": { "/settings/profile": "مشخصات کاربری", "/settings/security": "امنیت", - "/settings/personalization": "شخصی سازی", + "/settings/personalization": "سفارشی‌سازی", "/settings/authentication": "احراز هویت کاربری" }, - - "ordersStatus": { + "orderStatus": { "NEW": "جاری شده", "REJECTED": "رد شده", "FILLED": "انجام شده", @@ -87,7 +81,6 @@ "EXPIRED": "منقضی شده", "PARTIALLY_FILLED": "کامل نشده" }, - "paymentStatus": { "Open": "جاری شده", "Canceled": "لغو شده", @@ -96,13 +89,12 @@ "Failed": "رد شده", "Undefined": "تعریف نشده" }, - "messagesTitle": { - "successful": "عدم تائید معامله", + "successful": "تائید معامله", "login": "ورود موفق", "cancel": "لغو سفارش", "done": "سفارش موفق", - "incompleted": "سفارش نیمه تمام" + "inCompleted": "سفارش نیمه تمام" }, "orderTypes": { "LIMIT": "محدود", @@ -120,63 +112,53 @@ "locked": "درگیر معامله", "inWithdrawalProcess": "منتظر تسویه", "logOutSuccess": "خروج با موفقیت انجام شد.", - "logOutError": "خطایی رخ داده است، لطفا دوباره تلاش کنید!" + "logOutError": "خطایی رخ داده است. لطفاً دوباره تلاش کنید!" + }, + "overview": { + "title": "نمای کلی", + "change": "تغییر", + "volume": "حجم معاملات", + "lastDay": "24 ساعته", + "lastWeek": "7 روزه", + "lastMonth": "30 روزه" }, - "market": { "title": "بازار" }, - "wallet": { "title": "دارایی ها" }, - "technical": { "title": "تکنیکال" }, - "messages": { "title": "پیام ها" }, - "settings": { "title": "تنظیمات" }, - "Languages": { "Persian": "فارسی", "English": "English", - "Arabic": "عربی" + "Arabic": "عربي" }, - "Theme": { "Light": "روشن", "Dark": "تاریک" }, - "Calendar": { - "1": "هجری شمسی", - "2": "میلادی" + "IRCalender": "هجری خورشیدی", + "GCCalender": "میلادی" }, - "TimeZone": { - "1": "آسیا/تهران/03:30+" + "THR": "آسیا / تهران / UTC+3:30", + "UTC" : 0 }, - - "overview": { - "title": "نمای کلی", - "change": "تغییر", - "volume": "حجم معاملات", - "lastDay": "24ساعت", - "lastWeek": "7روز", - "lastMonth": "30روز" - }, - "orders": { "title": "سفارش", - "minOrder": "حداقل مقدار سفارش {{min}} {{currency}} میباشد", - "maxOrder": "حداکثر مقدار سفارش {{max}} {{currency}} میباشد", - "divisibility": "مقدار وارد شده باید بر {{mod}} بخشپذیر باشند‍!", + "minOrder": "حداقل مقدار سفارش {{min}} {{currency}} می‌باشد.", + "maxOrder": "حداکثر مقدار سفارش {{max}} {{currency}} می‌باشد.", + "divisibility": "مقدار وارد شده باید بر {{mod}} بخش‌پذیر باشد‍!", "notEnoughBalance": "موجودی کافی نیست!", "availableAmount": "موجودی قابل معامله", "bestOffer": "بهترین پیشنهاد", @@ -189,26 +171,22 @@ "totalPrice": "قیمت کل", "tradeFee": "کارمزد", "getAmount": "دریافتی شما", - "error": "خطایی در ثبت سفارش رخ داده‌ است", - "success": "ثبت سفارش {{type}} {{reqAmount}} {{base}} با قیمت {{pricePerUnit}} {{quote}} با موفقیت انجام شد" + "error": "خطایی در ثبت سفارش رخ داده‌است.", + "success": "ثبت سفارش {{type}} {{reqAmount}} {{base}} با قیمت {{pricePerUnit}} {{quote}} با موفقیت انجام شد." }, - "LastTrades": { "title": "معامله های اخیر" }, - "charts": { "title": "نمودار قیمت", "globalChart": "جهانی", "opexChart": "داخلی" }, - "orderBook": { "title": "دفتر پیشنهادها" }, - "myOrders": { - "title": "سفارش ها و معامله های من", + "title": "سفارش‌ها و معامله‌های من", "donePercentage": "درصد انجام", "stoppedPrice": "قیمت توقف", "orderId": "شناسه سفارش", @@ -216,32 +194,30 @@ "tradedAmount": "مقدار معامله شده", "avgTradedAmount": "میانگین قیمت معامله", "tradedPrice": "مبلغ معامله شده", - "aliveOrder": "سفارش های جاری", + "aliveOrder": "سفارش‌های جاری", "stoppedOrder": "متوقف", - "orderHistory": "تاریخچه سفارش ها", + "orderHistory": "تاریخچه سفارش‌ها", "stopOrderTime": "زمان آخرین معامله", "startOrderTime": "زمان ثبت سفارش", "cancelOrder": "لغو سفارش", + "orders": "معامله‌ها", "cancelSuccess": "سفارش با موفقیت لغو شد!", - "cancelError": "خطا در لغو سفارش", - "orders": "معامله ها" + "cancelError": "خطا در لغو سفارش" }, - "WalletSubMenu": { - "title": "دارایی ها ", + "title": "دارایی‌ها", "totalValue": "ارزش کل", "approximate": "تقریبی", "equivalent": "معادل", "showZeroBalance": "عدم نمایش موجودی صفر" }, - "DepositWithdraw": { "title": "واریز/برداشت", "success": "آدرس کپی شد", "copy": "کپی شد", - "allowable": "مقدار حداقل باید {{min}} تومان و حداکثر {{max}} تومان باشد.", + "IRTAllowable": "مقدار حداقل باید {{min}} تومان و حداکثر {{max}} تومان باشد.", "emptyInput": "وارد کردن مقدار الزامی است.", - "irtText": "صورتحساب با مبلغ {{amount}} تومان در تاریخ {{date}}، ساعت {{time}} ایجاد شده است، از طریق دکمه سبز رنگ زیر به درگاه پرداخت هدایت میشوید. برای ایجاد صورتحساب جدید، صورتحساب قبلی را پرداخت و یا لغو کنید.", + "IRTText": "صورتحساب با مبلغ {{amount}} تومان در تاریخ {{date}} ، ساعت {{time}} ایجاد شده است. از طریق دکمه سبز رنگ زیر به درگاه پرداخت هدایت می شوید. برای ایجاد صورتحساب جدید، صورتحساب قبلی را پرداخت و یا لغو کنید.", "IRTFormText": "برای واریز وجه ابتدا صورتحساب را ایجاد کنید، مبلغ مجاز واریز حداقل {{min}} تومان و حداکثر {{max}} تومان است.", "pay": "پرداخت", "cancel": "لغو", @@ -262,31 +238,28 @@ "depositTime": "* موجودی شما {{time}} دقیقه بعد از واریز به آدرس بالا، افزایش پیدا می کند.", "securityConsiderations": "باتوجه به ملاحضات امنیتی ممکن است انتقال به حساب با کمی تاخیر صورت بگیرد. می توانید وضعیت برداشت را در همین صفحه از بخش ترکنش های واریز/برداشت ببینید." }, - "CallbackPage": { "ok": "واریز وجه با موفقیت انجام شد.", "failed": "واریز وجه با خطا مواجه شد.", "noData": "موردی برای نمایش وجود ندارد.", "errorMessage": "متن خطا" }, - "IPGErrorCode": { "13003": "اجازه پرداخت ندارید.", "13004": "یک درخواست پرداخت نشده دارید.", "13005": "درخواست قفل شده.", "13007": "خطای ناشناخته" }, - "DepositWithdrawTx": { - "title": "تراکنش های واریز/برداشت", - "depositWithdrawal": "واریز/دریافت", - "withdrawalSend": "برداشت/ارسال", + "title": "تراکنش‌های واریز / برداشت", + "depositWithdrawal": "واریز / دریافت", + "withdrawalSend": "برداشت / ارسال", "transactionType": "نوع تراکنش", "transactionId": "شناسه تراکنش", "blockchainTransactionId": "شناسه بلاکچینی تراکنش", "price": "مبلغ", "destination": "مبدا/مقصد", - "inventory": "موجودی بعد تراکنش", + "inventory": "موجودی بعد از تراکنش", "freeWallet": "موجودی قابل برداشت", "minWithdraw": "حداقل مقدار برداشت", "minDeposit": "حداقل مقدار واریز", @@ -301,40 +274,35 @@ "IRTsuccess": "درخواست واریز {{amount}} تومان با موفقیت ثبت شد", "cancel": "لغو", "cancelPayment": "عملیات واریز لغو شد!" - }, - "transactionType": { "deposit": "واریز", "withdrawal": "برداشت", "Received": "دریافت", "send": "ارسال" }, - "OrdersTrades": { - "title": "سفارش ها و معامله ها", + "title": "سفارش‌ها و معامله‌ها", "aliveOrder": "سفارش های جاری", "stop": "متوقف", "cancelClose": "لغو و بسته شده", - "trades": "معامله ها", + "trades": "معامله‌ها", "side": "سمت", "order": "سفارش", "done": "اجراشده", "donePercentage": "% انجام", "stoppedPrice": "قیمت توقف", - "ordersHistory": "تاریخچه سفارش ها", + "ordersHistory": "تاریخچه سفارش‌ها", "type": "نوع", "market": "بازار", "limit": "محدود", "paid": "پرداخت شده" }, - "MessagesSubMenu": { "title": "اطلاع رسانی", "myMessages": "پیام های من", "news": "اطلاعیه ها" }, - "SettingsSubMenu": { "title": "تنظیمات", "userProfile": "مشخصات کاربری", @@ -342,7 +310,6 @@ "personalization": "شخصی سازی", "authentication": "احراز هویت کاربری" }, - "UserAccountStatus": { "title": "وضعیت حساب کاربری", "userAccountLevel1": "سطح کاربری 1", @@ -351,14 +318,12 @@ "dailyDeposit": "واریز روزانه ارزی: معادل {{amount}} تومان از 20،000،000 تومان", "dailyWithdrawalCryptoCurrency": "برداشت روزانه رمزارزی: معادل {{amount}} تومان از 20،000،000 تومان", "dailyDepositCryptoCurrency": "واریز روزانه رمزارزی: معادل {{amount}} تومان از 20،000،000 تومان", - "monthlyWithdrawal": "برداشت ماهانه ارزی: معادل {{amount}} تومان از 20،000،000 تومان", "monthlyDeposit": "واریز ماهانه ارزی: معادل {{amount}} تومان از 20،000،000 تومان", "monthlyWithdrawalCryptoCurrency": "برداشت ماهانه رمزارزی: معادل {{amount}} تومان از 20،000،000 تومان", "monthlyDepositCryptoCurrency": "واریز ماهانه رمزارزی: معادل {{amount}} تومان از 20،000،000 تومان", "tradesCommission": "کارمزد معاملات: {{amount}} تیکر، {{num}}" }, - "PersonalProfile": { "title": "مشخصات فردی", "cantEdit": "احراز هویت شما انجام شده است، مشخصات فردی قابل ویرایش نیست.", @@ -381,28 +346,25 @@ "selectNationality": "ملیت خود را انتخاب کنید", "selectResidence": "کشور محل اقامت خود را انتخاب کنید" }, - "LoginReports": { "title": "گزارش ورودها" }, - "ActiveSessions": { - "title": "نشست های فعال", - "ip": "ip", + "title": "نشست‌های فعال", + "ip": "IP", "LOGGED_IN": "ورود", "LOGGING_OUT": "خروج", "LOGGED_OUT": "خروج", "details": "جزئیات", "closeSession": "بستن نشست", "success": "نشست {{location}} با موفقیت بسته شد.", - "logOutAllSuccess": "سایر نشست ها با موفقیت بسته شدند.", + "logOutAllSuccess": "سایر نشست‌ها با موفقیت بسته شد.", "logOutAllError": "خطا در سرور، دوباره تلاش کنید.", - "noData": "موردی یافت نشد !", + "noData": "موردی یافت نشد!", "thisSession": "نشست فعلی", - "otherSession": "سایر نشست ها", - "closeAllInusableSessions": "بستن سایر نشست ها" + "otherSession": "سایر نشست‌ها", + "closeOtherSessions": "بستن سایر نشست‌ها" }, - "ChangePassword": { "title": "تغییر رمز ورود", "newPassword": "رمز ورود جدید", @@ -412,68 +374,62 @@ "error": "تغییر رمز انجام نشد.", "minInput": "{{name}} حداقل باید {{min}} کاراکتر باشد.", "emptyInput": "وارد کردن فیلد {{name}} الزامی است.", - "confirmationError": "رمز ورود جدید و تکرار آن باهم مطابقت نداردن.", + "confirmationError": "رمز ورود جدید و تکرار آن باهم مطابقت ندارند.", "currentPasswordError": "رمز ورود فعلی اشتباه وارد شده است." }, - "SetTwoStepVerification": { - "title": "فعال سازی ورود دو مرحله ای", - "!title": "غیرفعال سازی ورود دو مرحله ای", + "title": "فعال سازی ورود دو مرحله‌ای", + "!title": "غیرفعال سازی ورود دو مرحله‌ای", "code": "کد", - "active": "فعال سازی", - "isActive": "ورود دو مرحله ای فعال است.", - "deActive": "غیر فعال سازی", - "success": "ورود دو مرحله ای با موفقیت فعال شد.", - "error": "ورود دو مرحله ای غیرفعال شد.", + "active": "فعال‌سازی", + "isActive": "ورود دو مرحله‌ای فعال است.", + "deActive": "غیر فعال‌سازی", + "success": "ورود دو مرحله‌ای با موفقیت فعال شد.", + "error": "ورود دو مرحله‌ای غیرفعال شد.", "initialCodeMin": "کد باید 6 رقم باشد.", "initialCodeError": "کد وارد شده صحیح نیست.", - "serverError": "خطا در سرور، لطفا دوباره تلاش کنید.", - "description": "در صورت فعال سازی ورود دو مرحله ای، برای هر بار ورود به پنل کاربری، رمز دو مرحله ای درخواست می شود.", + "serverError": "خطا در سرور، لطفاً دوباره تلاش کنید.", + "description": "در صورت فعال‌سازی ورود دو مرحله‌ای، برای هر بار ورود به پنل کاربری، رمز دو مرحله‌ای درخواست می‌شود.", "QRdescription": "پس از اسکن کد QR رو به رو با نرم افزار Google Authenticator (یا نرم افزار مشابه) عدد 6 رقمی درج شده را وارد و ثبت کنید ." }, - "HelpStep": { "title": "گام 1 از 4: راهنمای کاربر", - "content": "به منظور استفاده از تمامی خدمات این صرافی و فعال شدن امکان برداشت دارایی ها، باید احراز هویت شوید. فرایند احراز هویت ساده و آنلاین است. در مراحل بعد از شما درخواست خواهد شد تا اطلاعات فردی خود را در فرم مربوطه وارد کرده و تصاویر پرتره، کارت ملی و رضایت نامه استفاده از خدمات را ارسال بفرمایید." + "content": "به منظور استفاده از خدمات این صرافی و فعال شدن امکان برداشت دارایی ها، باید احراز هویت شوید. فرایند احراز هویت ساده و آنلاین است. در مراحل بعد از شما درخواست خواهد شد تا اطلاعات فردی خود را در فرم مربوطه وارد کرده و عکس شخصی، تصویر کارت ملی و توافقنامه استفاده از خدمات را ارسال فرمایید." }, - "PersonalProfileStep": { "title": "گام 2 از 4: ورود اطلاعات فردی", "serverError": "خطا در دریافت اطلاعات، دوباره تلاش کنید.", "minInput": "{{name}} حداقل باید {{min}} کاراکتر باشد.", - "wrongDateG": "فرمت تاریخ صحیح نیست", - "wrongDateJ": "فرمت تاریخ صحیح نیست", - "wrongNationalId": "کد ملی صحیح نیست", - "wrongPassportNumber": "شماره پاس‍پورت صحیح نیست", - "emptyInput": "وارد کردن فیلد {{name}} الزامی است.", + "wrongDateG": "فرمت تاریخ صحیح نیست!", + "wrongDateJ": "فرمت تاریخ صحیح نیست!", + "wrongNationalId": "کد ملی صحیح نیست!", + "wrongPassportNumber": "شماره پاس‍پورت صحیح نیست!", + "emptyInput": "وارد کردن {{name}} الزامی است.", "yy/mm//dd": "روز/ماه/سال" }, - "SendPhotosStep": { "title": "گام 3 از 4: ارسال تصاویر", - "content": "برای تکمیل احراز هویت لطفا مراحل زیر را انجام دهید!", - "acceptForm": "1) متن اعلام رضایت به استفاده از خدمات را بر روی یک کاغذ A4 نوشته، امضا کنید و از آن عکس بگیرید.", - "selfie": "2) یک سلفی از خودتان در حالتی که برگه اعلام رضایت را در مقابل خود نگه داشته اید بگیرید.", - "idCard": "3) یک سلفی از خودتان در حالتی که شناسنامه یا کارت ملی را در مقابل خود نگه داشته اید بگیرید.", - "acceptFormLink": "(متن اعلام رضایت...)", - "selfieLink": "(مطابق تصویر نمونه...)", - "idCardLink": "(مطابق تصویر نمونه...)", + "content": "برای تکمیل احراز هویت لطفاً مراحل زیر را انجام دهید:", + "acceptForm": "1) متن توافقنامه برای استفاده از خدمات را بر روی یک کاغذ A4 نوشته، امضا کنید و از آن عکس بگیرید.", + "selfie": "2) یک سلفی از خودتان در حالتی که برگه اعلام رضایت را در مقابل خود نگه داشته‌اید بگیرید.", + "idCard": "3) یک سلفی از خودتان در حالتی که شناسنامه یا کارت ملی را در مقابل خود نگه داشته‌اید بگیرید.", + "acceptFormLink": "(دانلود نمونه متن اعلام رضایت)", + "selfieLink": "(مطابق تصویر نمونه)", + "idCardLink": "(مطابق تصویر نمونه)", "acceptFormDropzone": "متن اعلام رضایت", "selfieDropzone": "سلفی همراه با متن اعلام رضایت", "idCardDropzone": "سلفی همراه با کارت ملی یا شناسنامه", "sendingData": "در حال ارسال اطلاعات...", - "imageAcceptedFormat": "- لطفا عکس ها را فقط با فرمت JPEG و PNG آپلود کنید!", + "imageAcceptedFormat": "- لطفاً عکس‌ها را فقط با فرمت JPEG و PNG آپلود کنید!", "imageAcceptedSize": "- حداکثر حجم قابل قبول برای آپلود عکس ها، 1 مگابایت است!", - - "acceptFormEmpty": "عکس متن اعلام رضایت را آپلود کنید!", - "selfieEmpty": "عکس سلفی همراه با متن رضایت را آپلود کنید!", + "acceptFormEmpty": "عکس متن توافقنامه را آپلود کنید!", + "selfieEmpty": "عکس سلفی همراه با متن توافقنامه را آپلود کنید!", "idCardEmpty": "عکس سلفی همراه کارت ملی یا شناسنامه را آپلود کنید!", "serverError": "خطا در ارسال تصاویر، دوباره تلاش کنید!" }, - - "SendToExpertStep": { + "SendToAdminStep": { "title": "گام 4 از 4: ارسال به کارشناس", - "content": "اطلاعات با موفقیت ثبت شد. وضعیت احراز هویت شما به صورت زیر می باشد.", + "content": "اطلاعات با موفقیت ثبت شد. وضعیت احراز هویت شما به صورت زیر می باشد:", "pending": "در حال برسی...", "accepted": "احراز هویت شما با موفقیت انجام شده است.", "rejected": "احراز هویت انجام نشد، دوباره تلاش کنید.", @@ -481,27 +437,23 @@ "noData": "ثبت نشده!", "errorMessage": "متن خطا" }, - "Authentication": { - "title": "", "HelpStep": "راهنمای کاربر", "PersonalProfileStep": "اطلاعات فردی", "SendPhotosStep": "ارسال تصاویر", - "SendToExpertStep": "ارسال به کارشناس" + "SendToAdminStep": "ارجاع به کارشناس" }, - "PersonalizationForm": { - "title": "شخصی سازی", + "title": "شخصی‌سازی", "placeholder": "انتخاب", - "defaultLang": "زبان پیش فرض", - "defaultTheme": "تم پیش فرض", + "defaultLang": "زبان پیش‌فرض", + "defaultTheme": "تم پیش‌فرض", "defaultCalendarSystem": "سیستم روزشماری", - "defaultTimeZon": "منطقه زمانی", + "defaultTimeZone": "منطقه زمانی", "defaultReferenceCurrency": "ارز مرجع", "defaultReferenceCryptoCurrency": "رمز ارز مرجع", "save": "ذخیره" }, - "login": { "title": "ورود/ثبت نام", "wrongPassword": "ایمیل یا رمز عبور صحیح نمی باشد!", @@ -518,16 +470,14 @@ "registerFinishedSpamMail": "ایمیل دریافتی از آدرس for.demo.purpose.only@opex.dev ممکن است در بخش spam باشد.", "register": "ثبت نام", "wrongEmail": "ایمیل وارد شده معتبر نیست.", - "notFoundEmail": "ایمیل وارد شده یافت نشد.", "emptyEmail": "ایمیل را وارد کنید.", "emptyInput": "وارد کردن فیلد {{name}} الزامی است.", - "emptyCredentialError": "وارد کردن فیلد ایمیل و رمز ورود الزامی است.", + "emptyCredentialError": "وارد کردن ایمیل و رمز ورود الزامی است.", "minInput": "{{name}} حداقل باید {{min}} کاراکتر باشد.", "finishedWithError": "خطا در ایجاد کاربر جدید.", "back": "بازگشت", "description": "OPen source EXchange", - "OTPRequired": "وارد کردن رمز دوعاملی (OTP) الزامی است.", - "networkError": "خطا در ارتباط با سرور", + "OTPRequired": "وارد کردن رمز در مرحله‌ای (OTP) الزامی است.", "otpLength": "رمز دوعاملی 6 کاراکتر است.", "refreshCaptcha": "نمایش دوباره captcha", "captchaServerError": "خطا در سرور برای گرفتن Captcha", @@ -537,25 +487,23 @@ "forgetPassServerError": "خطا در بازیابی رمز، دوباره تلاش کنید", "forgetPassEmailForgetError": "فرمت ایمیل صحیح نیست." }, - "footer": { - "changeColor": "تغییر رنگ", + "darkMode": "تم تاریک", "aboutUs": "درباره ما", - "contactUS": "تماس باما", + "contactUS": "تماس با ما", "blog": "بلاگ", "guide": "راهنمای استفاده", - "rules": "قوانین استفاده", - "api": "وب سرویس ها", + "rules": "قوانین سایت", + "api": "وب سرویس‌ها", "addCoin": "درخواست افزودن سکه یا توکن", "demo": "بازار نمایشی (ویژه تمرین رایگان)", "errorReport": "گزارش خطا و مشکل", "copyright": "1400 - کلیه حقوق برای شرکت تجربه کاربری متن باز (در شرف تاُسیس) محفوظ است." }, - "ImageInput": { "title": "", "dropText": "را با کشیدن روی کادر یا کلیک کردن و انتخاب فایل آپلود کنید!", - "iconErrorText": "عکس آپلود شده معتبر نمی باشد ، لطفا دوباره تلاش کنید!", + "iconErrorText": "عکس آپلود شده معتبر نیست، لطفاً دوباره تلاش کنید!", "fileTooLarge": "حجم فایل آپلود شده بیشتر از حد مجاز است!", "fileInvalidType": "فرمت فایل آپلود شده قابل قبول نیست!", "tooManyFiles": "آپلود بیشتر از یک عکس مجاز نیست!", diff --git a/src/index.css b/src/index.css index 7f2b5bfb..ea13d75c 100644 --- a/src/index.css +++ b/src/index.css @@ -1120,9 +1120,22 @@ h6 { } .ltr { direction: ltr; - font-family: 'Roboto', sans-serif; + font-family: 'Roboto', sans-serif !important; + font-weight: 300; +} + +.button { + font-family: "IRANYekan", sans-serif; + border: none; + border-radius: 7px; + color: #f2f2f2; +} + +.ltr .button { + font-family: "Roboto", sans-serif !important; } + input { direction: rtl; } @@ -1130,20 +1143,6 @@ input { direction: ltr; } - - -/* -.ltr html,body{ - font-family: 'Segoe UI', serif !important; -} -*/ - -/* -.ltr .row{ - flex-direction: row-reverse; - -}*/ - /* Table Style */ diff --git a/src/main/Browser/Browser.css b/src/main/Browser/Browser.css index 0625b336..30037f94 100644 --- a/src/main/Browser/Browser.css +++ b/src/main/Browser/Browser.css @@ -25,19 +25,10 @@ .font-size-lg { font-size: 2.2vw; } - - - .button{ height: 4.5vh; - border: none; - border-radius: 7px; - font-family: "IRANYekan", serif; font-size: 0.8vw; - color: #f2f2f2; } - - tr { position: relative; line-height: 3.4vh; diff --git a/src/main/Browser/Sections/Content/components/Dashboard/components/MyOrders/components/OrdersHistory/OrdersHistory.js b/src/main/Browser/Sections/Content/components/Dashboard/components/MyOrders/components/OrdersHistory/OrdersHistory.js index de75b8a4..fccea478 100644 --- a/src/main/Browser/Sections/Content/components/Dashboard/components/MyOrders/components/OrdersHistory/OrdersHistory.js +++ b/src/main/Browser/Sections/Content/components/Dashboard/components/MyOrders/components/OrdersHistory/OrdersHistory.js @@ -66,7 +66,7 @@ const OrdersHistory = (props) => { {tr.origQty} {tr.price.toLocaleString()} {(tr.origQty * tr.price).toLocaleString()} - {t("ordersStatus." + tr.status)} + {t("orderStatus." + tr.status)} {openOrder === index ? ( setOpenOrder(null)}> {

{t("orderType")} :{" "} - {t(tr.side) + " " + t("orderTypes." + tr.type)} + {t(tr.side.toLowerCase()) + " " + t("orderTypes." + tr.type)}

diff --git a/src/main/Browser/Sections/Content/components/Settings/components/Authentication/Authentication.js b/src/main/Browser/Sections/Content/components/Settings/components/Authentication/Authentication.js index 642cab54..57da7fc3 100644 --- a/src/main/Browser/Sections/Content/components/Settings/components/Authentication/Authentication.js +++ b/src/main/Browser/Sections/Content/components/Settings/components/Authentication/Authentication.js @@ -4,7 +4,7 @@ import classes from "./Authentication.module.css"; import HelpStep from "./components/HelpStep/HelpStep"; import PersonalProfileStep from "./components/PersonalProfileStep/PersonalProfileStep"; import SendPhotosStep from "./components/SendPhotosStep/SendPhotosStep"; -import SendToExpertStep from "./components/SendToExpertStep/SendToExpertStep"; +import SendToAdminStep from "./components/SendToAdminStep/SendToAdminStep"; import {useTranslation} from "react-i18next"; const Authentication = () => { @@ -39,7 +39,7 @@ const Authentication = () => { /> ); case 4: - return setStep(3)}/>; + return setStep(3)}/>; default: return ; } @@ -53,7 +53,7 @@ const Authentication = () => {
  • {t("Authentication.HelpStep")}
  • {t("Authentication.PersonalProfileStep")}
  • {t("Authentication.SendPhotosStep")}
  • -
  • {t("Authentication.SendToExpertStep")}
  • +
  • {t("Authentication.SendToAdminStep")}
  • diff --git a/src/main/Browser/Sections/Content/components/Settings/components/Authentication/components/SendToExpertStep/SendToExpertStep.js b/src/main/Browser/Sections/Content/components/Settings/components/Authentication/components/SendToAdminStep/SendToAdminStep.js similarity index 78% rename from src/main/Browser/Sections/Content/components/Settings/components/Authentication/components/SendToExpertStep/SendToExpertStep.js rename to src/main/Browser/Sections/Content/components/Settings/components/Authentication/components/SendToAdminStep/SendToAdminStep.js index 74150193..8f83387e 100644 --- a/src/main/Browser/Sections/Content/components/Settings/components/Authentication/components/SendToExpertStep/SendToExpertStep.js +++ b/src/main/Browser/Sections/Content/components/Settings/components/Authentication/components/SendToAdminStep/SendToAdminStep.js @@ -1,5 +1,5 @@ import React, {useEffect} from "react"; -import classes from "./SendToExpertStep.module.css"; +import classes from "./SendToAdminStep.module.css"; import {useTranslation} from "react-i18next"; import Button from "../../../../../../../../../../components/Button/Button"; import {useDispatch, useSelector} from "react-redux"; @@ -7,7 +7,7 @@ import {images} from "../../../../../../../../../../assets/images"; import {setKYCStatusInitiate} from "../../../../../../../../../../store/actions/auth"; -const SendToExpertStep = (props) => { +const SendToAdminStep = (props) => { const {t} = useTranslation(); const dispatch = useDispatch(); const KYCStatus = useSelector(state => state.auth.kyc); @@ -25,28 +25,28 @@ const SendToExpertStep = (props) => { if (KYCStatus === "REQUESTED") { return
    kyc-pending - {t("SendToExpertStep.pending")} + {t("SendToAdminStep.pending")}
    } if (KYCStatus === "ACCEPTED") { return
    kyc-accepted - {t("SendToExpertStep.accepted")} + {t("SendToAdminStep.accepted")}
    } if (KYCStatus === "REJECTED") { return
    kyc-rejected - {t("SendToExpertStep.rejected")} - {t("SendToExpertStep.errorMessage")}: {KYCReason === undefined ? t("SendToExpertStep.noData") : KYCReason} + {t("SendToAdminStep.rejected")} + {t("SendToAdminStep.errorMessage")}: {KYCReason === undefined ? t("SendToAdminStep.noData") : KYCReason}
    } if (KYCStatus === "BLOCKED") { return
    kyc-rejected - {t("SendToExpertStep.blocked")} - {t("SendToExpertStep.errorMessage")}: {KYCReason} + {t("SendToAdminStep.blocked")} + {t("SendToAdminStep.errorMessage")}: {KYCReason}
    } @@ -59,12 +59,12 @@ const SendToExpertStep = (props) => {
    -

    {t("SendToExpertStep.title")}

    +

    {t("SendToAdminStep.title")}

    - {t("SendToExpertStep.content")} + {t("SendToAdminStep.content")}
    {content()}
    @@ -80,4 +80,4 @@ const SendToExpertStep = (props) => { ); }; -export default SendToExpertStep; +export default SendToAdminStep; diff --git a/src/main/Browser/Sections/Content/components/Settings/components/Authentication/components/SendToExpertStep/SendToExpertStep.module.css b/src/main/Browser/Sections/Content/components/Settings/components/Authentication/components/SendToAdminStep/SendToAdminStep.module.css similarity index 100% rename from src/main/Browser/Sections/Content/components/Settings/components/Authentication/components/SendToExpertStep/SendToExpertStep.module.css rename to src/main/Browser/Sections/Content/components/Settings/components/Authentication/components/SendToAdminStep/SendToAdminStep.module.css diff --git a/src/main/Browser/Sections/Content/components/Settings/components/Personalization/components/PersonalizationForm/PersonalizationForm.js b/src/main/Browser/Sections/Content/components/Settings/components/Personalization/components/PersonalizationForm/PersonalizationForm.js index 5d247ebc..b7e19fe4 100644 --- a/src/main/Browser/Sections/Content/components/Settings/components/Personalization/components/PersonalizationForm/PersonalizationForm.js +++ b/src/main/Browser/Sections/Content/components/Settings/components/Personalization/components/PersonalizationForm/PersonalizationForm.js @@ -26,13 +26,12 @@ const PersonalizationForm = () => { {value: "dark", label: t("Theme.Dark")}, ]; const calendarSystemOptions = [ - {value: "1", label: t("Calendar.1")}, - {value: "2", label: t("Calendar.2")}, + {value: "IRCalender", label: t("Calendar.IRCalender")}, + {value: "GCCalender", label: t("Calendar.GCCalender")}, ]; const timeZoneOptions = [ - {value: "1", label: t("TimeZone.1")}, - {value: "2", label: "..."}, - {value: "3", label: "..."}, + {value: "THR", label: t("TimeZone.THR")}, + {value: "UTC", label: t("TimeZone.UTC")}, ]; const referenceCurrencyOptions = [ {value: "IRT", label: t("currency.IRT")}, @@ -113,7 +112,7 @@ const PersonalizationForm = () => { diff --git a/src/main/Browser/Sections/Content/components/Settings/components/Security/components/ActiveSessions/ActiveSessions.js b/src/main/Browser/Sections/Content/components/Settings/components/Security/components/ActiveSessions/ActiveSessions.js index 5eb29c6a..53ef9835 100644 --- a/src/main/Browser/Sections/Content/components/Settings/components/Security/components/ActiveSessions/ActiveSessions.js +++ b/src/main/Browser/Sections/Content/components/Settings/components/Security/components/ActiveSessions/ActiveSessions.js @@ -95,7 +95,7 @@ const ActiveSessions = () => {
    {moment(currentSession?.started * 1000).format("HH:mm:ss , jYY/jMM/jDD")} {sessions.length > 0 ? {t("ActiveSessions.closeAllInusableSessions")} : ""} + onClick={clickHandler}>{t("ActiveSessions.closeOtherSessions")} : ""}
    diff --git a/src/main/Browser/Sections/Content/components/Settings/components/Security/components/ChangePassword/ChangePassword.js b/src/main/Browser/Sections/Content/components/Settings/components/Security/components/ChangePassword/ChangePassword.js index 3915ca6d..3654cf35 100644 --- a/src/main/Browser/Sections/Content/components/Settings/components/Security/components/ChangePassword/ChangePassword.js +++ b/src/main/Browser/Sections/Content/components/Settings/components/Security/components/ChangePassword/ChangePassword.js @@ -1,17 +1,13 @@ -import React, {useState, useEffect, useRef} from "react"; +import React, {useState} from "react"; import classes from "./ChangePassword.module.css"; import {Trans, useTranslation} from "react-i18next"; import TextInput from "../../../../../../../../../../components/TextInput/TextInput"; import Icon from "../../../../../../../../../../components/Icon/Icon"; import Button from "../../../../../../../../../../components/Button/Button"; -import {useSelector} from "react-redux"; -import {sendActivateOTP, sendChangePassword} from "../../../../api/settings"; +import {sendChangePassword} from "../../../../api/settings"; import {toast} from "react-hot-toast"; import Error from "../../../../../../../../../../components/Error/Error"; import Loading from "../../../../../../../../../../components/Loading/Loading"; -import DisableOTP from "../SetTwoStepVerification/components/DisableOTP"; -import ActivateOTP from "../SetTwoStepVerification/components/ActivateOTP"; -import {validateEmail} from "../../../../../../../../../../utils/utils"; const ChangePassword = () => { @@ -19,7 +15,6 @@ const ChangePassword = () => { const [error, setError] = useState(false); const [loading, setLoading] = useState(false); - const [req, setReq] = useState(undefined); const [changePassword, setChangePassword] = useState({ @@ -34,7 +29,6 @@ const ChangePassword = () => { currentPassword: false, }); - const inputHandler = (e) => { let errorMessage = [] if( typeof e.target.dataset.min !== undefined && e.target.value.length < e.target.dataset.min ) { @@ -81,8 +75,6 @@ const ChangePassword = () => { return !isEmpty; } - - const buttonClickHandler = async (e) => { e.preventDefault(); @@ -129,9 +121,6 @@ const ChangePassword = () => { setError(true) setLoading(false) } - - - } const content = () => { @@ -152,7 +141,7 @@ const ChangePassword = () => { onClick={() => setIsInputVisible({ ...isInputVisible, currentPassword: !isInputVisible.currentPassword })} /> } - autocomplete="off" + autoComplete="off" type={isInputVisible.currentPassword ? "text" : "password"} value={changePassword.currentPassword.value} data-name="currentPassword" @@ -171,7 +160,7 @@ const ChangePassword = () => { onClick={() => setIsInputVisible({ ...isInputVisible, newPassword: !isInputVisible.newPassword })} /> } - autocomplete="off" + autoComplete="off" type={isInputVisible.newPassword ? "text" : "password"} value={changePassword.newPassword.value} data-name="newPassword" @@ -190,7 +179,7 @@ const ChangePassword = () => { onClick={() => setIsInputVisible({ ...isInputVisible, confirmation: !isInputVisible.confirmation })} /> } - autocomplete="off" + autoComplete="off" type={isInputVisible.confirmation ? "text" : "password"} value={changePassword.confirmation.value} data-name="confirmation" @@ -207,7 +196,6 @@ const ChangePassword = () => { buttonTitle={t("submit")} />
    - } diff --git a/src/main/Browser/Sections/Content/components/Wallet/components/DepositWithdraw/components/Deposit/components/IRT/IRT.js b/src/main/Browser/Sections/Content/components/Wallet/components/DepositWithdraw/components/Deposit/components/IRT/IRT.js index 2af4acc2..7fe6c8a0 100644 --- a/src/main/Browser/Sections/Content/components/Wallet/components/DepositWithdraw/components/Deposit/components/IRT/IRT.js +++ b/src/main/Browser/Sections/Content/components/Wallet/components/DepositWithdraw/components/Deposit/components/IRT/IRT.js @@ -1,7 +1,7 @@ import React, {useEffect, useState} from "react"; import classes from "../../../../DepositWithdraw.module.css"; import {useLocation, useParams} from "react-router-dom"; -import {connect, useSelector} from "react-redux"; +import {connect} from "react-redux"; import {Trans, useTranslation} from "react-i18next"; import NumberInput from "../../../../../../../../../../../../components/NumberInput/NumberInput"; import {BN, parsePriceString} from "../../../../../../../../../../../../utils/utils"; @@ -120,24 +120,18 @@ const IRT = (props) => { const value = parsePriceString(e.target.value) const amountValidator = () => { - if (typeof min === undefined) { - return false; - } - if (typeof max === undefined) { + if (typeof min === undefined || typeof max === undefined) { return false; } if (value < min) { return false; } - if (value > max) { - return false; - } - return true; + return value <= max; } if (!amountValidator()) { errorMessage.push( {
    { +const DepositWithdrawTx = () => { const {t} = useTranslation(); const [filterOpen, setFilterOpen] = useState(null); const [openItem, setOpenItem] = useState(false); @@ -106,26 +106,16 @@ const DepositWithdrawTx = (props) => { await getTx(); }, id ? 3000 : null); - - const addressRef = useRef(null); - - /*const copyToClipboard = () => { - addressRef.current.select(); - document.execCommand("copy"); - };*/ - - - const txStatus = (status) => { switch (status) { case 0: - return t("ordersStatus.NEW"); + return t("orderStatus.NEW"); case 1: - return t("ordersStatus.FILLED"); + return t("orderStatus.FILLED"); case 2: - return t("ordersStatus.REJECTED"); + return t("orderStatus.REJECTED"); default: - return t("ordersStatus.NEW"); + return t("orderStatus.NEW"); } }; diff --git a/src/main/Browser/Sections/Content/components/Wallet/components/OrdersTrades/OrdersTrades.js b/src/main/Browser/Sections/Content/components/Wallet/components/OrdersTrades/OrdersTrades.js index 2c9defc4..328c50fe 100644 --- a/src/main/Browser/Sections/Content/components/Wallet/components/OrdersTrades/OrdersTrades.js +++ b/src/main/Browser/Sections/Content/components/Wallet/components/OrdersTrades/OrdersTrades.js @@ -13,7 +13,7 @@ import Icon from "../../../../../../../../components/Icon/Icon"; import AccordionBox from "../../../../../../../../components/AccordionBox/AccordionBox"; -const OrdersTrades = (props) => { +const OrdersTrades = () => { const {t} = useTranslation(); const [openItem, setOpenItem] = useState({ aliveOrder: null, @@ -241,7 +241,7 @@ const OrdersTrades = (props) => { : "USDT"} {tr.paid.toLocaleString()} - {t("ordersStatus." + tr.status)} + {t("orderStatus." + tr.status)} {openItem.ordersHistory === index ? ( diff --git a/src/main/Browser/Sections/Content/components/Wallet/components/OrdersTradesFilter/OrdersTradesFilter.js b/src/main/Browser/Sections/Content/components/Wallet/components/OrdersTradesFilter/OrdersTradesFilter.js index c890cd54..b1f14286 100644 --- a/src/main/Browser/Sections/Content/components/Wallet/components/OrdersTradesFilter/OrdersTradesFilter.js +++ b/src/main/Browser/Sections/Content/components/Wallet/components/OrdersTradesFilter/OrdersTradesFilter.js @@ -311,7 +311,7 @@ const OrdersTradesFilter = (props) => { : "USDT"} {tr.paid.toLocaleString()} - {t("ordersStatus." + tr.status)} + {t("orderStatus." + tr.status)} {openItem.ordersHistory === index ? ( diff --git a/src/main/Browser/Sections/Footer/Footer.js b/src/main/Browser/Sections/Footer/Footer.js index bca1ab83..1a228126 100644 --- a/src/main/Browser/Sections/Footer/Footer.js +++ b/src/main/Browser/Sections/Footer/Footer.js @@ -54,10 +54,9 @@ const Footer = (props) => {
    - {t("footer.changeColor")}: + {t("footer.darkMode")}: props.onThemeChange(e.target.checked)} checked={props.isDark}/>
    -
    { +const MessagesSubMenu = () => { const {t} = useTranslation(); const [openItem, setOpenItem] = useState({ myMessages: null, @@ -40,7 +39,7 @@ const MessagesSubMenu = (props) => { - {t("ordersStatus." + tr.title)} + {t("orderStatus." + tr.title)} {moment(tr.timestamp).format("HH:mm:ss - jYY/jMM/jDD")} @@ -104,7 +103,7 @@ const MessagesSubMenu = (props) => { className="text-center triplet-striped font-size-sm-plus mt-05" cellSpacing="0" cellPadding="0"> - + {customData.news.map((tr, index) => ( diff --git a/src/main/Browser/Sections/SubMenu/components/SettingsSubMenu/SettingsSubMenu.js b/src/main/Browser/Sections/SubMenu/components/SettingsSubMenu/SettingsSubMenu.js index caf11714..fb73f773 100644 --- a/src/main/Browser/Sections/SubMenu/components/SettingsSubMenu/SettingsSubMenu.js +++ b/src/main/Browser/Sections/SubMenu/components/SettingsSubMenu/SettingsSubMenu.js @@ -113,7 +113,7 @@ const SettingsSubMenu = () => { {t("SendPhotosStep.title")} - {t("SendToExpertStep.title")} + {t("SendToAdminStep.title")}
    From 34d730ec7f00f4ab79de05f265b8d7904123ce49 Mon Sep 17 00:00:00 2001 From: Benyamin001 <23664159+Benyamin001@users.noreply.github.com> Date: Sun, 29 May 2022 18:32:36 +0430 Subject: [PATCH 04/42] Fix wallet bug --- .../Sections/Header/components/WalletHeader/WalletHeader.js | 6 +++--- .../components/WalletListItem/WalletListItem.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/Browser/Sections/Header/components/WalletHeader/WalletHeader.js b/src/main/Browser/Sections/Header/components/WalletHeader/WalletHeader.js index dd510d3c..c68bc68d 100644 --- a/src/main/Browser/Sections/Header/components/WalletHeader/WalletHeader.js +++ b/src/main/Browser/Sections/Header/components/WalletHeader/WalletHeader.js @@ -21,15 +21,15 @@ const WalletHeader = () => {
    {t("header.free")} - {free.toLocaleString()}{/* ( --- {t("currency.IRT")} )*/} + {free}{/* ( --- {t("currency.IRT")} )*/}
    {t("header.locked")} - {locked.toLocaleString()} {/*( --- {t("currency.IRT")} )*/} + {locked} {/*( --- {t("currency.IRT")} )*/}
    {t("header.inWithdrawalProcess")} - {withdraw.toLocaleString()} {/*( --- {t("currency.IRT")} )*/} + {withdraw} {/*( --- {t("currency.IRT")} )*/}
    ); diff --git a/src/main/Browser/Sections/SubMenu/components/WalletSubMenu/components/WalletListItem/WalletListItem.js b/src/main/Browser/Sections/SubMenu/components/WalletSubMenu/components/WalletListItem/WalletListItem.js index f514030a..9fc9c48d 100644 --- a/src/main/Browser/Sections/SubMenu/components/WalletSubMenu/components/WalletListItem/WalletListItem.js +++ b/src/main/Browser/Sections/SubMenu/components/WalletSubMenu/components/WalletListItem/WalletListItem.js @@ -33,7 +33,7 @@ const WalletListItem = ({name , showZero}) => {
    - {free.toLocaleString() + " "} + {free + " "} {t("currency." + name)} {/* From 77ea9182ee3bb6007b0e3d4365585ed6c633a3bf Mon Sep 17 00:00:00 2001 From: Benyamin001 <23664159+Benyamin001@users.noreply.github.com> Date: Tue, 31 May 2022 16:21:18 +0430 Subject: [PATCH 05/42] upgrade react router dom to 6 --- package.json | 4 +- public/locales/en/translation.json | 20 +-- src/components/ActionSheet/ActionSheet.js | 19 +-- src/components/Popup/Popup.js | 6 +- .../ProtectedRoute/ProtectedRoute.js | 19 +-- src/main/Browser/Browser.js | 47 +++--- src/main/Browser/Sections/Content/Content.js | 51 ++---- .../Content/components/Dashboard/Dashboard.js | 14 +- .../Order/components/BuyOrder/BuyOrder.js | 4 - .../Order/components/SellOrder/SellOrder.js | 4 - .../Content/components/Settings/Settings.js | 35 +--- .../Content/components/Wallet/Wallet.js | 28 ++-- .../components/Deposit/Deposit.js | 91 +++++----- .../components/CallbackPage/CallbackPage.js | 59 +++---- src/main/Browser/Sections/Header/Header.js | 59 +++---- .../Browser/Sections/MainMenu/MainMenu.js | 25 +-- src/main/Browser/Sections/SubMenu/SubMenu.js | 23 ++- .../MessagesSubMenu/MessagesSubMenu.js | 7 +- .../SettingsSubMenu/SettingsSubMenu.js | 15 +- .../WalletListItem/WalletListItem.js | 5 +- src/main/Mobile/Mobile.js | 62 +++---- .../Mobile/Secttions/TheContent/TheContent.js | 42 ++--- .../components/TheDashboard/TheDashboard.js | 62 +++---- .../components/TheNavMenu/TheNavMenu.js | 28 ++-- .../components/TheBuyOrder/TheBuyOrder.js | 6 +- src/pages/Guide/Guide.js | 69 ++++---- src/pages/Login/Login.js | 6 +- src/pages/Login/api/auth.js | 11 +- .../Login/components/LoginForm/LoginForm.js | 6 +- src/routes/routes.js | 11 +- src/store/sagas/global.js | 1 - yarn.lock | 158 +++++------------- 32 files changed, 386 insertions(+), 611 deletions(-) diff --git a/package.json b/package.json index f454fd32..27685e81 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "rc-scrollbars": "^1.1.3", "react": "^17.0.1", "react-countdown": "^2.3.2", - "react-device-detect": "^1.15.0", + "react-device-detect": "^2.2.2", "react-dom": "^17.0.1", "react-dropzone": "^11.3.1", "react-hot-toast": "^2.2.0", @@ -28,7 +28,7 @@ "react-number-format": "^4.9.3", "react-qr-code": "^2.0.7", "react-redux": "^7.2.2", - "react-router-dom": "^5.2.0", + "react-router-dom": "6.0.2", "react-router-hash-link": "^2.4.3", "react-scripts": "4.0.1", "react-select": "^5.3.2", diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index 660b3a2c..e36661e3 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -227,16 +227,16 @@ "allowableWithdraw": "Minimum allowable withdrawal amount has not been observed.", "fillAddress": "You must enter an address.", "important": "Important", - "DepositTETHContentBefore": "فقط ETH تستی شبکه Ropsten مورد قبول قرار می گیرد! برای دریافت رایگان به ", - "DepositTETHContentAfter": " بروید. برای ارسال ETH تستی به این آدرس، باید شبکه اتریومی کیف پول خود را به Ropsten تغییر دهید. این شبکه به طور پیش فرض در فهرست شبکه های کیف پول Metamask وجود دارد. هر تراکنشی با مقدار مساوی یا بیشتر از ۰.۰۰۱ ETH به آدرس بالا، به حساب شما افزوده می شود.", - "minDeposit": "حداقل میزان قابل قبول {{min}} {{currency}}", - "minDepositText": "هر تراکنشی با مقدار بیشتر از {{min}} {{currency}} به آدرس زیر ، به حساب شما افزوده می شود.", - "DepositTBTCContentBefore": "فقط BTC تستی مورد قبول قرار می گیرد! برای دریافت رایگان به ", - "DepositTBTCContentAfter": " بروید. هر تراکنشی با مقدار مساوی یا بیشتر از ۰.۰۰۱ BTC به آدرس بالا، به حساب شما افزوده می شود.", - "DepositTUSDTContentBefore": "فقط USDT تستی شبکه Ropsten مورد قبول قرار می گیرد! برای آشنایی با روش دریافت رایگان به ", - "DepositTUSDTContentAfter": " بروید. برای ارسال USDT تستی به این آدرس، باید شبکه اتریومی کیف پول خود را به Ropsten تغییر دهید. این شبکه به طور پیش فرض در فهرست شبکه های کیف پول Metamask وجود دارد. هر تراکنشی با مقدار مساوی یا بیشتر از ۱۰ USDT به آدرس بالا، به حساب شما افزوده می شود.", - "depositTime": "* موجودی شما {{time}} دقیقه بعد از واریز به آدرس بالا، افزایش پیدا می کند.", - "securityConsiderations": "باتوجه به ملاحضات امنیتی ممکن است انتقال به حساب با کمی تاخیر صورت بگیرد. می توانید وضعیت برداشت را در همین صفحه از بخش ترکنش های واریز/برداشت ببینید." + "DepositTETHContentBefore": "Ropsten network ETH test Only accepted! For free download", + "DepositTETHContentAfter": "go to send a test ETH to this address. You must change your wallet Etherium network to Ropsten. This network is on the Metamask wallet network list by default. Any transaction with an amount equal to or greater than 0.001 ETH to the above address will be added to your account.", + "minDeposit": "The minimum acceptable amount {{min}} {{currency}}", + "minDepositText": "Any transaction with a value greater than {{min}} {{currency}} will be added to your account at the following address.", + "DepositTBTCContentBefore": "Only BTC test accepted! For free download", + "DepositTBTCContentAfter": "go to any transaction with an amount equal to or greater than 0.001 BTC to the above address will be added to your account.", + "DepositTUSDTContentBefore": "Only USDT Ropsten Network Test is accepted! To learn how to get free,", + "DepositTUSDTContentAfter": "Go. To send a USDT test to this address, you must change your wallet atrium network to Ropsten. This network is on the Metamask wallet network list by default. Any transaction with an amount equal to or greater than From 10 USDT to the above address will be added to your account.", + "depositTime": "* Your balance will increase {{time}} minutes after depositing to the above address.", + "securityConsiderations": "Due to security considerations, the transfer to the account may be delayed slightly. You can see the withdrawal status on the same page in the Deposit / Withdrawal Transactions section." }, "CallbackPage": { "ok": "The deposit was successful.", diff --git a/src/components/ActionSheet/ActionSheet.js b/src/components/ActionSheet/ActionSheet.js index f0ace224..a5678a05 100644 --- a/src/components/ActionSheet/ActionSheet.js +++ b/src/components/ActionSheet/ActionSheet.js @@ -1,10 +1,10 @@ -import React, {Fragment, useEffect, useState} from "react"; +import React, {useEffect, useState} from "react"; import classes from "./ActionSheet.module.css"; -import {useHistory} from "react-router-dom"; +import {useNavigate} from "react-router-dom"; -const ActionSheet = (props) => { +const ActionSheet = ({children , show , onChangeShow}) => { - const {children , show , onChangeShow} = props; + const navigate = useNavigate(); const [showAction, setShowAction] = useState(show); const [isFirst, setIsFirst] = useState(false); @@ -17,13 +17,12 @@ const ActionSheet = (props) => { onChangeShow(showAction) }, [showAction]); - const history = useHistory() useEffect(() => { - return history.listen(() => { + return navigate.listen(() => { setShowAction(false) }) - },[history]) + },[navigate]) const onClickHandler = ()=> { setShowAction(false) @@ -39,17 +38,15 @@ const ActionSheet = (props) => { } } - return ( - + <>
    {children}
    - + ); }; - export default ActionSheet; \ No newline at end of file diff --git a/src/components/Popup/Popup.js b/src/components/Popup/Popup.js index 507a46aa..e148a52f 100644 --- a/src/components/Popup/Popup.js +++ b/src/components/Popup/Popup.js @@ -1,8 +1,8 @@ import React, {Fragment, useEffect, useRef, useState} from "react"; import classes from "./Popup.module.css"; import {Trans, useTranslation} from "react-i18next"; -import {connect, useSelector} from "react-redux"; -import {setUserAccountInfo} from "../../store/actions/auth"; +import {connect} from "react-redux"; +import {setUserAccountInfo} from "../../store/actions"; import Button from "../Button/Button"; import {Link} from "react-router-dom"; import * as Routes from "../../routes/routes"; @@ -14,8 +14,6 @@ import {toast} from "react-hot-toast"; import {Login} from "../../routes/routes"; - - const Popup = (props) => { const {t} = useTranslation(); const {currency, isLogin, closePopup,} = props diff --git a/src/components/ProtectedRoute/ProtectedRoute.js b/src/components/ProtectedRoute/ProtectedRoute.js index ad39fae0..9ae17f0d 100644 --- a/src/components/ProtectedRoute/ProtectedRoute.js +++ b/src/components/ProtectedRoute/ProtectedRoute.js @@ -1,15 +1,14 @@ import React from "react"; import {Login} from "../../routes/routes"; -import {Route, Redirect} from "react-router-dom"; +import {Navigate, Outlet, useLocation} from "react-router-dom"; +import {useSelector} from "react-redux"; -const ProtectedRoute = ({component: Component, isLogin, ...rest}) => { - return ( - - isLogin === true ? : - } - /> - ); +const ProtectedRoute = () => { + let location = useLocation(); + const isLogin = useSelector((state) => state.auth.isLogin) + + if (!isLogin) return + + return ; }; export default ProtectedRoute; diff --git a/src/main/Browser/Browser.js b/src/main/Browser/Browser.js index c612c1ae..116341cd 100644 --- a/src/main/Browser/Browser.js +++ b/src/main/Browser/Browser.js @@ -1,9 +1,9 @@ import React, {useEffect} from "react"; import {useDispatch, useSelector} from "react-redux"; -import {Route, Switch} from "react-router-dom"; +import {Route,Routes} from "react-router-dom"; import i18n from "i18next"; import ReactTooltip from "react-tooltip"; -import * as Routes from "../../routes/routes"; +import {Technical} from "../../routes/routes"; import {Toaster} from "react-hot-toast"; import Login from "../../pages/Login/Login"; import Guide from "../../pages/Guide/Guide"; @@ -94,35 +94,26 @@ const Browser = () => { return } return ( - - - + + }/> + }/> + }> + }/> - - - - - -
    - - -
    -
    - -
    - -
    + + + +
    +
    + +
    +
    - -
    -
    - + + +
    }/> + ); }; diff --git a/src/main/Browser/Sections/Content/Content.js b/src/main/Browser/Sections/Content/Content.js index cf506d88..ad1b5bdd 100644 --- a/src/main/Browser/Sections/Content/Content.js +++ b/src/main/Browser/Sections/Content/Content.js @@ -1,53 +1,32 @@ import React from "react"; -import {connect} from "react-redux"; -import {Switch, Route} from "react-router-dom"; -import * as Routes from "../../../../routes/routes"; -import {useTranslation} from "react-i18next"; +import {Navigate, Route, Routes} from "react-router-dom"; +import * as RoutesName from "../../../../routes/routes"; import ScrollBar from "../../../../components/ScrollBar"; import ProtectedRoute from "../../../../components/ProtectedRoute/ProtectedRoute"; import Dashboard from "./components/Dashboard/Dashboard"; import Wallet from "./components/Wallet/Wallet"; import Footer from "../Footer/Footer"; import Settings from "./components/Settings/Settings"; +import {useSelector} from "react-redux"; - -const Content = ({isLogin}) => { - const {t} = useTranslation(); - +const Content = () => { + const defaultWallet = useSelector((state) => state.exchange.assets[0]) return ( - - - + + }/> + }> + }/> + }/> - } /> - - -
    -

    {t("comingSoon")}

    -
    -
    -
    +