diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index d6fa0e8..78ae89f 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -17,7 +17,7 @@ jobs: - name: Build Docker images env: GENERATE_SOURCEMAP: '' - run: docker-compose -f docker-compose.build.yml build + run: docker compose -f docker-compose.build.yml build - name: Login to GitHub Container Registry uses: docker/login-action@v1 with: @@ -25,4 +25,4 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Push images to GitHub Container Registry - run: docker-compose -f docker-compose.build.yml push + run: docker compose -f docker-compose.build.yml push diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b5c42a8..a187093 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,4 +25,4 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Push images to GitHub Container Registry - run: docker-compose -f docker-compose.build.yml push + run: docker compose -f docker-compose.build.yml push diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index bc82cec..cee2136 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -15,4 +15,4 @@ jobs: env: TAG: latest GENERATE_SOURCEMAP: false - run: docker-compose -f docker-compose.build.yml build + run: docker compose -f docker-compose.build.yml build diff --git a/public/assets/locales/en/translation.json b/public/assets/locales/en/translation.json index f904ede..b66efbc 100644 --- a/public/assets/locales/en/translation.json +++ b/public/assets/locales/en/translation.json @@ -84,7 +84,9 @@ "TBNB": "TBNB", "TBUSD": "TBUSD", "BCH": "BCH", - "TRX": "TRX" + "TRX": "TRX", + "SOL": "SOL", + "TON": "TON" }, "marketInterval": { "24h": "24 hours", diff --git a/public/assets/locales/fa/translation.json b/public/assets/locales/fa/translation.json index b5292f0..c680dd9 100644 --- a/public/assets/locales/fa/translation.json +++ b/public/assets/locales/fa/translation.json @@ -84,7 +84,9 @@ "TBNB": "بایننس (ت)", "TBUSD": "دلار بایننس(ت)", "BCH": "بیتکوین کش", - "TRX": "ترون" + "TRX": "ترون", + "SOL": "سولانا", + "TON": "تون کوین" }, "marketInterval": { "24h": "24 ساعت", diff --git a/src/assets/images.js b/src/assets/images.js index 142659b..7857839 100644 --- a/src/assets/images.js +++ b/src/assets/images.js @@ -20,6 +20,8 @@ import tron from "./images/src/tron.svg"; import testTron from "./images/src/testTron.svg"; import ethereumLight from "./images/src/ethereumLight.svg"; import toman from "./images/src/toman.svg"; +import toncoin from "./images/src/toncoin.svg"; +import solana from "./images/src/solana.svg"; import spaceStar from "./images/src/spaceStar.png"; import astronaut from "./images/src/astronaut.svg"; import astronautAlone from "./images/src/astronautAlone.svg"; @@ -64,6 +66,8 @@ export const images = { TTRX: testTron, ETH: ethereumLight, IRT: toman, + TON: toncoin, + SOL: solana, spaceStar: spaceStar, astronaut: astronaut, astronautAlone: astronautAlone, diff --git a/src/assets/images/src/solana.svg b/src/assets/images/src/solana.svg new file mode 100644 index 0000000..d09ddb6 --- /dev/null +++ b/src/assets/images/src/solana.svg @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/images/src/tether.svg b/src/assets/images/src/tether.svg index d92d961..e15b43f 100644 --- a/src/assets/images/src/tether.svg +++ b/src/assets/images/src/tether.svg @@ -1 +1,19 @@ - \ No newline at end of file + + + + + + + + + diff --git a/src/assets/images/src/toncoin.svg b/src/assets/images/src/toncoin.svg new file mode 100644 index 0000000..7bc59ed --- /dev/null +++ b/src/assets/images/src/toncoin.svg @@ -0,0 +1,18 @@ + + + + + + + + + diff --git a/src/main/Mobile/Pages/UserPanel/Secttions/Content/components/Market/components/TradingView/components/MarketChart/MarketChart.js b/src/main/Mobile/Pages/UserPanel/Secttions/Content/components/Market/components/TradingView/components/MarketChart/MarketChart.js index 63ee7fe..89794e7 100644 --- a/src/main/Mobile/Pages/UserPanel/Secttions/Content/components/Market/components/TradingView/components/MarketChart/MarketChart.js +++ b/src/main/Mobile/Pages/UserPanel/Secttions/Content/components/Market/components/TradingView/components/MarketChart/MarketChart.js @@ -10,9 +10,13 @@ import { } from "../../../../../../../../../../../../constants/chart"; import i18n from "i18next"; import {useGetChartCandlesticks} from "../../../../../../../../../../../../queries"; +import {useTranslation} from "react-i18next"; const MarketChart = ({type}) => { + + const {t} = useTranslation(); + let chartProperties, candleSeries, volumeSeries; const chart = useRef(); @@ -159,7 +163,7 @@ const MarketChart = ({type}) => { return (
-

{error}

+

{error && t('charts.noChartData')}

); }; diff --git a/src/main/Mobile/Pages/UserPanel/Secttions/Content/components/TransactionHistory/TransactionHistory.js b/src/main/Mobile/Pages/UserPanel/Secttions/Content/components/TransactionHistory/TransactionHistory.js index 955d8ce..5fc8e46 100644 --- a/src/main/Mobile/Pages/UserPanel/Secttions/Content/components/TransactionHistory/TransactionHistory.js +++ b/src/main/Mobile/Pages/UserPanel/Secttions/Content/components/TransactionHistory/TransactionHistory.js @@ -154,7 +154,7 @@ const TransactionHistory = () => { value: query?.coin, label: query?.coin ? t('currency.'+ query?.coin) : t('all'), }} - onchange={(e) => setQuery({...query, coin: e.value})} + onchange={(e) => setQuery({...query, coin: e.value, offset:0})} customClass={`width-100 my-1 ${classes.thisInput}`} /> { value: query?.category, label: query?.category ? t('TransactionCategory.'+ query?.category) : t('all'), }} - onchange={(e) => setQuery({...query, category: e.value})} + onchange={(e) => setQuery({...query, category: e.value, offset:0})} customClass={`width-100 my-1 ${classes.thisInput}`} /> { - {assets.filter(asset => data.wallets[asset].free > 0) - .concat(assets.filter(asset => data.wallets[asset].free === 0)) + {assets.filter(asset => data?.wallets?.[asset]?.free > 0) + .concat(assets.filter(asset => data?.wallets?.[asset]?.free === 0)) .map((name) => )} diff --git a/src/setup/configs/configs.js b/src/setup/configs/configs.js new file mode 100644 index 0000000..2feded4 --- /dev/null +++ b/src/setup/configs/configs.js @@ -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" +} \ No newline at end of file diff --git a/src/store/sagas/global.js b/src/store/sagas/global.js index d798644..d359c11 100644 --- a/src/store/sagas/global.js +++ b/src/store/sagas/global.js @@ -3,6 +3,7 @@ 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 { @@ -81,14 +82,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;