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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions public/assets/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -392,11 +392,11 @@
"cancelPayment": "Payment operation canceled!"
},
"DepositTx": {
"title": "Last 10 {{currency}} deposit transactions.",
"title": "Last 10 {{currency}} deposit transactions",
"showAll": "Show All"
},
"WithdrawTx": {
"title": "Last 10 {{currency}} withdraw transactions.",
"title": "Last 10 {{currency}} withdraw transactions",
"cancelWithdrawReq": "Cancel withdrawal request",
"cancelWithdrawReqSuccess": "Withdrawal request has been successfully canceled"
},
Expand Down
13 changes: 13 additions & 0 deletions src/setup/configs/configs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export const defaultConfigs = {
"logoUrl": "logo/url",
"title": "Title",
"description": "Description text",
"defaultLanguage": "en",
"supportedLanguages": [
"en"
],
"defaultTheme": "DARK",
"supportEmail": "supportEmail@gmail.com",
"baseCurrency": "TUSDT",
"dateType": "Hijri"
}
13 changes: 12 additions & 1 deletion src/store/sagas/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import * as actions from "../actions/index";
import jwtDecode from "jwt-decode";
import axios from "axios";
import i18n from "i18next";
import {defaultConfigs} from "../../setup/configs/configs";


export function* setThemeSaga(action) {
try {
Expand Down Expand Up @@ -81,14 +83,23 @@ export function* loadConfig(action) {
const {
data: {
defaultTheme,
language,
...configs
}
} = yield call(axios.get, '/config/web/v1')

yield put(actions.setExchangeConfigs(configs));

i18n.changeLanguage(language)
appTheme = defaultTheme;

} catch (e) {
i18n.changeLanguage(defaultConfigs?.defaultLanguage)
appTheme = defaultConfigs?.defaultTheme;
yield put(actions.setExchangeConfigs(defaultConfigs));
}

try {

const localTheme = yield call([localStorage, 'getItem'], 'theme')
if (localTheme) appTheme = localTheme;

Expand Down