From 6bcf6cf3adc572a181a9d89c2fd6611d7f039314 Mon Sep 17 00:00:00 2001 From: john Date: Thu, 12 May 2022 16:06:08 +0700 Subject: [PATCH] fix multi-lang --- .env.sample | 3 ++- src/AppContext.js | 16 +++++++++------- src/config.js | 2 +- src/lang/fr.js | 2 +- src/lang/tw.js | 2 +- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.env.sample b/.env.sample index 54f610c..7ca14d9 100644 --- a/.env.sample +++ b/.env.sample @@ -1,2 +1,3 @@ REACT_APP_NAME = CoinWind -REACT_APP_I18N_ENABLED = true \ No newline at end of file +REACT_APP_I18N_ENABLED = true +REACT_APP_DEV_ENDPOINT = http://coinwind.test/ \ No newline at end of file diff --git a/src/AppContext.js b/src/AppContext.js index a71e12a..ed23e3e 100644 --- a/src/AppContext.js +++ b/src/AppContext.js @@ -36,20 +36,22 @@ export const AppContextProvider = ({ children }) => { const [appKey, setAppKey] = React.useState('') const [kefuUrl, setKefuUrl] = React.useState('') - const [menuItems, setMenuItems] = React.useState([ + const menuItems = [ { name: t('home'), icon: FiHome, path: '/home', enabled: true }, { name: t('farm'), icon: FiTrendingUp, path: '/farm', enabled: true }, { name: t('staking'), icon: FiLock, path: '/staking', enabled: true }, - ]) - const [docItems, setDocItems] = React.useState([ - { name: t('announcement'), icon: '', path: '/ann', enabled: true }, - { name: t('faq'), icon: '', path: '/faq', enabled: true }, - { name: t('tutorial'), icon: '', path: '/tut', enabled: true }, - ]) + ] + + const docItems = [ + { name: t('announcement'), icon: '', path: '', enabled: true }, + { name: t('faq'), icon: '', path: '', enabled: true }, + { name: t('tutorial'), icon: '', path: '', enabled: true }, + ] React.useEffect(() => { console.debug('should be once') + get_settings().then((res) => { const o = res.data.other const s = res.data.system diff --git a/src/config.js b/src/config.js index 7d267c9..6f1d791 100644 --- a/src/config.js +++ b/src/config.js @@ -1,7 +1,7 @@ const items = { development: { - ENDPOINT: 'http://coinwind.local.com/' + ENDPOINT: process.env.REACT_APP_DEV_ENDPOINT }, production: { ENDPOINT: 'https://gdb.01a01.com/' diff --git a/src/lang/fr.js b/src/lang/fr.js index 2f0c4d9..deb609b 100644 --- a/src/lang/fr.js +++ b/src/lang/fr.js @@ -2,7 +2,7 @@ export const fr = { home: 'Domicile', farm: 'Ferme', - staking: 'Staking', + staking: 'Jalonnement', announcement: 'Annonce', faq: 'FAQ', tutorial: 'Didacticiel', diff --git a/src/lang/tw.js b/src/lang/tw.js index 7fc3eea..2a47531 100644 --- a/src/lang/tw.js +++ b/src/lang/tw.js @@ -2,7 +2,7 @@ export const tw = { home: '首頁', farm: '農場', - staking: 'Staking', + staking: '質押', announcement: '公告', faq: 'FAQ', tutorial: '教案',