From 88b0bee640122458081780947e7236d8ea6fc094 Mon Sep 17 00:00:00 2001 From: Hossein Date: Sat, 24 Sep 2022 12:14:37 +0330 Subject: [PATCH 1/7] #114, Add env file --- .env.example | 14 +++++++++++++- public/index.html | 4 ++-- src/i18n/i18n.js | 4 ++-- .../Pages/UserPanel/Sections/Footer/Footer.js | 13 +++++++++---- src/store/reducers/globalReducer.js | 2 +- 5 files changed, 27 insertions(+), 10 deletions(-) diff --git a/.env.example b/.env.example index 6a529f70..e4e48798 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,16 @@ +#UI ENV +REACT_APP_TITLE= +REACT_APP_DESCRIPTION_CONTENT= +#MANIFEST +REACT_APP_MANIFEST_FILE= +#API CONFIG REACT_APP_API_BASE_URL= REACT_APP_CLIENT_ID= REACT_APP_LOGIN_CLIENT_ID= -REACT_APP_CLIENT_SECRET= \ No newline at end of file +REACT_APP_CLIENT_SECRET= +#LANGUAGES +REACT_APP_MULTI_LANGS_SUPPORT= +REACT_APP_PRELOAD_LANG= +REACT_APP_LANGS_SUPPORT= +#DEFAULT THEME +REACT_APP_DEFAULT_THEME= diff --git a/public/index.html b/public/index.html index e5d9c664..a7cd2876 100644 --- a/public/index.html +++ b/public/index.html @@ -5,7 +5,7 @@ - + @@ -33,7 +33,7 @@ - Opex + %REACT_APP_TITLE% diff --git a/src/i18n/i18n.js b/src/i18n/i18n.js index aa260c3e..130cdacc 100644 --- a/src/i18n/i18n.js +++ b/src/i18n/i18n.js @@ -9,8 +9,8 @@ i18n .use(Backend) .use(initReactI18next) .init({ - preload: ["fa"], - fallbackLng: "fa", + preload: [process.env.REACT_APP_PRELOAD_LANG], + fallbackLng: process.env.REACT_APP_PRELOAD_LANG, debug: process.env.NODE_ENV === "development", detection: { order: ["localStorage"], diff --git a/src/main/Browser/Pages/UserPanel/Sections/Footer/Footer.js b/src/main/Browser/Pages/UserPanel/Sections/Footer/Footer.js index 1483ee19..e1978ba8 100644 --- a/src/main/Browser/Pages/UserPanel/Sections/Footer/Footer.js +++ b/src/main/Browser/Pages/UserPanel/Sections/Footer/Footer.js @@ -61,12 +61,17 @@ const Footer = () => { {t("footer.darkMode")}: dispatch(setThemeInitiate(e.target.checked))} checked={isDark}/> +
- i18n.changeLanguage("fa")}>{t("Languages.Persian")} - i18n.changeLanguage("en")}>{t("Languages.English")} + { + process.env.REACT_APP_MULTI_LANGS_SUPPORT === 'TRUE' && <> + i18n.changeLanguage("fa")}>{t("Languages.Persian")} + i18n.changeLanguage("en")}>{t("Languages.English")} + + }
diff --git a/src/store/reducers/globalReducer.js b/src/store/reducers/globalReducer.js index a8b7c7c7..ac0eb6e3 100644 --- a/src/store/reducers/globalReducer.js +++ b/src/store/reducers/globalReducer.js @@ -1,7 +1,7 @@ import * as actionTypes from "../actions/actionTypes"; const initialState = { - isDark: true, + isDark: process.env.REACT_APP_DEFAULT_THEME === 'DARK', isLoading: true, hasError: false, marketInterval: "24h", From 7242d056e6d3ebc3ec493d2b5ff46bc147d11e4f Mon Sep 17 00:00:00 2001 From: Hossein Date: Mon, 26 Sep 2022 09:09:45 +0330 Subject: [PATCH 2/7] #115, Remove unnecessary styles --- src/components/Error/Error.js | 2 +- .../FullWidthError/FullWidthError.js | 2 +- src/components/ImageInput/ImageInput.js | 6 +- src/components/Info/Info.js | 2 +- src/components/Loading/Loading.js | 2 +- src/components/NumberInput/NumberInput.js | 6 +- .../NumberInput/NumberInput.module.css | 6 +- src/components/Popup/Popup.js | 2 +- src/components/Popup/Popup.module.css | 2 +- src/components/TextInput/TextInput.js | 2 +- src/components/TextInput/TextInput.module.css | 6 +- .../ToggleSwitch/ToggleSwitch.module.css | 4 +- .../VerticalTextInput/VerticalNumberInput.js | 2 +- .../VerticalNumberInput.module.css | 6 +- src/index.css | 3268 ++++++++++++----- src/main/Browser/Browser.js | 6 +- src/main/Browser/Pages/AllMarket/AllMarket.js | 2 +- .../AllMarketContent/AllMarketContent.js | 2 +- .../components/AllMarketInfo/AllMarketInfo.js | 16 +- .../AllMarketInfoCard/AllMarketInfoCard.js | 22 +- .../AllMarketInfoCard.module.css | 2 +- .../AllMarketInfoTable/AllMarketInfoTable.js | 8 +- .../AllMarketInfoTable.module.css | 2 +- .../components/PriceInfo/PriceInfo.js | 4 +- .../MostDecreasedPrice/MostDecreasedPrice.js | 4 +- .../MostIncreasedPrice/MostIncreasedPrice.js | 4 +- .../components/VolumeInfo/VolumeInfo.js | 4 +- .../components/MostTrades/MostTrades.js | 2 +- .../components/MostVolume/MostVolume.js | 4 +- .../AllMarketHeader/AllMarketHeader.js | 2 +- src/main/Browser/Pages/Guide/Guide.js | 2 +- .../components/HashContent/HashContent.js | 4 +- src/main/Browser/Pages/Landing/Landing.js | 2 +- .../Sections/LandingContent/LandingContent.js | 2 +- .../components/GeneralInfo/GeneralInfo.js | 14 +- .../components/MarketInfo/MarketInfo.js | 12 +- .../MarketInfo/MarketInfo.module.css | 3 +- .../MarketInfoCard/MarketInfoCard.js | 14 +- .../MarketInfoCard/MarketInfoCard.module.css | 2 +- .../MarketInfoTable/MarketInfoTable.js | 8 +- .../MarketInfoTable.module.css | 2 +- .../components/MarketTitle/MarketTitle.js | 8 +- .../MarketTitle/MarketTitle.module.css | 2 +- .../components/MarketView/MarketView.js | 4 +- .../MostDecreasedPrice/MostDecreasedPrice.js | 2 +- .../MostIncreasedPrice/MostIncreasedPrice.js | 2 +- .../components/MostVolume/MostVolume.js | 2 +- src/main/Browser/Pages/Login/Login.js | 2 +- src/main/Browser/Pages/Login/Login.module.css | 8 +- .../ForgetPassword/ForgetPassword.js | 6 +- .../Login/components/LoginForm/LoginForm.js | 12 +- .../components/RegisterForm/RegisterForm.js | 8 +- src/main/Browser/Pages/User/User.js | 2 +- src/main/Browser/Pages/User/User.module.css | 2 +- .../ForgetPassword/ForgetPassword.js | 6 +- .../components/LastTrades/LastTrades.js | 6 +- .../LastTradesTable/LastTradesTable.js | 4 +- .../Market/components/MyOrders/MyOrders.js | 2 +- .../components/OpenOrders/OpenOrders.js | 6 +- .../components/OrdersHistory/OrdersHistory.js | 4 +- .../components/StopMarket/StopMarket.js | 2 +- .../MyOrders/components/Trades/Trades.js | 4 +- .../Market/components/Order/Order.js | 2 +- .../Market/components/Order/Order.module.css | 4 +- .../Market/components/OrderBook/OrderBook.js | 4 +- .../OrderBookTable/OrderBookTable.js | 6 +- .../OrderBookTableSafari.js | 6 +- .../Market/components/Overview/Overview.js | 2 +- .../components/TradingView/TradingView.js | 2 +- .../TradingView/TradingView.module.css | 8 +- .../Authentication/Authentication.js | 4 +- .../components/HelpStep/HelpStep.js | 2 +- .../components/HelpStep/HelpStep.module.css | 2 +- .../PersonalProfileStep.js | 4 +- .../PersonalProfileStep.module.css | 2 +- .../SendPhotosStep/SendPhotosStep.js | 2 +- .../SendPhotosStep/SendPhotosStep.module.css | 4 +- .../SendToAdminStep/SendToAdminStep.js | 6 +- .../SendToAdminStep.module.css | 2 +- .../PersonalizationForm.js | 2 +- .../PersonalizationForm.module.css | 2 +- .../PersonalProfile/PersonalProfile.js | 4 +- .../PersonalProfile.module.css | 2 +- .../UserAccountStatus/UserAccountStatus.js | 6 +- .../ActiveSessions/ActiveSessions.js | 18 +- .../components/Details/Details.module.css | 2 +- .../components/Session/Session.js | 12 +- .../ChangePassword/ChangePassword.js | 8 +- .../ChangePassword/ChangePassword.module.css | 2 +- .../components/LoginReports/LoginReports.js | 4 +- .../SetTwoStepVerification.js | 6 +- .../SetTwoStepVerification.module.css | 4 +- .../components/ActivateOTP.js | 8 +- .../components/DisableOTP.js | 4 +- .../Content/components/Wallet/Wallet.js | 2 +- .../DepositWithdraw/DepositWithdraw.js | 2 +- .../DepositWithdraw.module.css | 6 +- .../components/Deposit/Deposit.js | 2 +- .../components/CallbackPage/CallbackPage.js | 2 +- .../components/Deposit/components/Transfer.js | 2 +- .../DepositWithdraw/components/Withdrawal.js | 4 +- .../DepositWithdrawTx/DepositWithdrawTx.js | 2 +- .../DepositWithdrawTx.module.css | 8 +- .../DepositWithdrawTxTables.js | 8 +- .../components/IRTTx/IRTTx.js | 2 +- .../components/OrdersTrades/OrdersTrades.js | 18 +- .../OrdersTradesFilter/OrdersTradesFilter.js | 24 +- .../OrdersTradesFilter.module.css | 4 +- .../Pages/UserPanel/Sections/Footer/Footer.js | 6 +- .../Sections/Footer/Footer.module.css | 22 +- .../Pages/UserPanel/Sections/Header/Header.js | 2 +- .../Sections/Header/Header.module.css | 2 +- .../components/MarketHeader/MarketHeader.js | 6 +- .../MarketHeader/MarketHeader.module.css | 2 +- .../components/WalletHeader/WalletHeader.js | 12 +- .../UserPanel/Sections/MainMenu/MainMenu.js | 12 +- .../Sections/MainMenu/MainMenu.module.css | 6 +- .../UserPanel/Sections/SubMenu/SubMenu.js | 2 +- .../Sections/SubMenu/SubMenu.module.css | 2 +- .../components/MarketSubMenu/MarketSubMenu.js | 4 +- .../MarketPairCard/MarketPairCard.js | 4 +- .../MessagesSubMenu/MessagesSubMenu.js | 24 +- .../components/MessagesCard/MessagesCard.js | 4 +- .../components/NotifCard/NotifCard.js | 4 +- .../components/NotifCard/NotifCard.module.css | 2 +- .../SettingsSubMenu/SettingsSubMenu.js | 8 +- .../components/WalletSubMenu/WalletSubMenu.js | 10 +- .../components/WalletBalance/WalletBalance.js | 4 +- .../components/WalletList/WalletList.js | 12 +- .../WalletListItem/WalletListItem.js | 8 +- .../components/WalletLoading/WalletLoading.js | 4 +- src/main/Browser/Styles/Browser.css | 96 +- src/main/Mobile/Mobille.css | 2 +- 133 files changed, 2697 insertions(+), 1356 deletions(-) diff --git a/src/components/Error/Error.js b/src/components/Error/Error.js index 3339c629..7de46d91 100644 --- a/src/components/Error/Error.js +++ b/src/components/Error/Error.js @@ -10,7 +10,7 @@ const Error = ({errorMsg, retryFunc}) => { { retryFunc ?