From 2024dd676a93ee38970b09d5cd1eb6df01c06f59 Mon Sep 17 00:00:00 2001 From: Ali Beikverdi Date: Wed, 8 May 2024 18:33:43 +0900 Subject: [PATCH 01/10] 2fa disabled condition wrong message when its activated --- web/src/containers/UserSecurity/OTP.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/containers/UserSecurity/OTP.js b/web/src/containers/UserSecurity/OTP.js index c9e0d37664..a05f595691 100644 --- a/web/src/containers/UserSecurity/OTP.js +++ b/web/src/containers/UserSecurity/OTP.js @@ -355,8 +355,8 @@ export const OTP = ({ /> )} - - {STRINGS['ACCOUNT_SECURITY.OTP.2FA_DISABLED']} + + {STRINGS['ACCOUNT_SECURITY.OTP.2FA_ENABLED']} From abd59a585a6f0d0ccf6d7ba42c17b9ffb1f9fe53 Mon Sep 17 00:00:00 2001 From: ram Date: Thu, 9 May 2024 21:07:48 +0530 Subject: [PATCH 02/10] Displayed the digital assets orderly based on the pinned assets --- .../DigitalAssets/components/AssetsList.js | 40 ++++++++++++------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/web/src/containers/DigitalAssets/components/AssetsList.js b/web/src/containers/DigitalAssets/components/AssetsList.js index 40ed37f4d7..6f273e7763 100644 --- a/web/src/containers/DigitalAssets/components/AssetsList.js +++ b/web/src/containers/DigitalAssets/components/AssetsList.js @@ -35,6 +35,7 @@ const AssetsList = ({ icons, }) => { const [isOndDaySort, setIsOneDaySort] = useState(false); + let listData = []; const handleClickChange = () => { setIsOneDaySort(false); if (mode === SORT.CHANGESEVENDAY) { @@ -88,21 +89,32 @@ const AssetsList = ({ }; const getSortedList = () => { - return movePinnedItems( - coinsListData.sort((a, b) => { - const aVal = parseFloat( - isOndDaySort - ? a.oneDayPriceDifferencePercenVal - : a.priceDifferencePercentVal - ); - const bVal = parseFloat( - isOndDaySort - ? b.oneDayPriceDifferencePercenVal - : b.priceDifferencePercentVal - ); - return is_descending ? bVal - aVal : aVal - bVal; - }) + const topAssets = []; + + pinned_assets.forEach((pin) => { + const asset = coinsListData.find(({ symbol }) => symbol === pin); + if (asset) { + topAssets.push(asset); + } + }); + const restAssets = coinsListData.filter( + (item) => !pinned_assets.includes(item.symbol) ); + const sortedValues = restAssets.sort((a, b) => { + const aVal = parseFloat( + isOndDaySort + ? a.oneDayPriceDifferencePercenVal + : a.priceDifferencePercentVal + ); + const bVal = parseFloat( + isOndDaySort + ? b.oneDayPriceDifferencePercenVal + : b.priceDifferencePercentVal + ); + return is_descending ? bVal - aVal : aVal - bVal; + }); + listData = [...topAssets, ...sortedValues]; + return movePinnedItems(listData); }; const totalPages = Math.ceil(count / pageSize); From db1bc6043d8e73a582cdeab5cb946ffd958299d4 Mon Sep 17 00:00:00 2001 From: fetok12 Date: Fri, 10 May 2024 01:06:23 +0300 Subject: [PATCH 03/10] cefi-stake-add-mobile-tab --- web/src/containers/Wallet/MainWallet.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/containers/Wallet/MainWallet.js b/web/src/containers/Wallet/MainWallet.js index d3a7223d58..c1d5a662a1 100644 --- a/web/src/containers/Wallet/MainWallet.js +++ b/web/src/containers/Wallet/MainWallet.js @@ -149,7 +149,7 @@ class Wallet extends Component { pairs, total, oraclePrices, - { features: { stake_page = false } = {} } = {}, + { features: { stake_page = false, cefi_stake = false } = {} } = {}, contracts = {}, isFetching, assets @@ -231,7 +231,7 @@ class Wallet extends Component { }, ]; - if (stake_page) { + if (stake_page || cefi_stake) { mobileTabs.push({ title: STRINGS['ACCOUNTS.TAB_STAKE'], content: , From 18b3997fc0e1650b6dcb6bba84d9e77eff4a5382 Mon Sep 17 00:00:00 2001 From: fetok12 Date: Fri, 10 May 2024 11:55:13 +0300 Subject: [PATCH 04/10] limit-validation-issue-fiat --- .../containers/Deposit/Fiat/DepositForm.js | 2 +- web/src/containers/Deposit/Fiat/Form.js | 2 +- web/src/containers/Deposit/Fiat/utils.js | 28 +++++++++++++------ web/src/containers/Withdraw/Fiat/Form.js | 2 +- 4 files changed, 23 insertions(+), 11 deletions(-) diff --git a/web/src/containers/Deposit/Fiat/DepositForm.js b/web/src/containers/Deposit/Fiat/DepositForm.js index 4e5b1f0d7a..5ef7d2bcd0 100644 --- a/web/src/containers/Deposit/Fiat/DepositForm.js +++ b/web/src/containers/Deposit/Fiat/DepositForm.js @@ -46,7 +46,7 @@ const generateFormValues = ( let { rate: fee } = getFiatDepositFee(symbol); const customFee = fiat_fees?.[symbol]?.deposit_fee; - const limit = getFiatDepositLimit(); + const limit = getFiatDepositLimit(symbol); const MIN = math.max(fee, min); const MAX = limit && math.larger(limit, 0) ? math.min(limit, max) : max; diff --git a/web/src/containers/Deposit/Fiat/Form.js b/web/src/containers/Deposit/Fiat/Form.js index 4ce0a8d6b5..12cbab8a56 100644 --- a/web/src/containers/Deposit/Fiat/Form.js +++ b/web/src/containers/Deposit/Fiat/Form.js @@ -145,7 +145,7 @@ const Form = ({ const { type } = tabs[activeTab] || {}; const isManual = type === 'manual'; const { rate: fee } = getFiatDepositFee(currency); - const limit = getFiatDepositLimit(); + const limit = getFiatDepositLimit(currency); const { min, max, display_name } = coins[currency] || DEFAULT_COIN_DATA; diff --git a/web/src/containers/Deposit/Fiat/utils.js b/web/src/containers/Deposit/Fiat/utils.js index 3f500fead4..86c6adb361 100644 --- a/web/src/containers/Deposit/Fiat/utils.js +++ b/web/src/containers/Deposit/Fiat/utils.js @@ -38,7 +38,7 @@ export const getFiatWithdrawalFee = (currency, amount = 0, network) => export const getFiatDepositFee = (currency, amount = 0, network) => getFiatFee(currency, amount, network, DEPOSIT_FEES_KEY); -export const getFiatLimit = (type) => { +export const getFiatLimit = (type, currency) => { const transactionType = type === WITHDRAWAL_LIMIT_KEY ? 'withdrawal' : 'deposit'; const { @@ -46,16 +46,28 @@ export const getFiatLimit = (type) => { user: { verification_level }, } = store.getState(); - return ( - transaction_limits?.find( - (limit) => - limit.tier === verification_level && limit.type === transactionType - )?.amount || 0 + const independentLimit = transaction_limits?.find( + (limit) => + limit.limit_currency === currency && + limit.tier === verification_level && + limit.type === transactionType ); + const defaultLimit = transaction_limits?.find( + (limit) => + limit.limit_currency === 'default' && + limit.tier === verification_level && + limit.type === transactionType + ); + + const limit = independentLimit || defaultLimit; + + return limit?.amount || 0; }; -export const getFiatWithdrawalLimit = () => getFiatLimit(WITHDRAWAL_LIMIT_KEY); -export const getFiatDepositLimit = () => getFiatLimit(DEPOSIT_LIMIT_KEY); +export const getFiatWithdrawalLimit = (symbol) => + getFiatLimit(WITHDRAWAL_LIMIT_KEY, symbol); +export const getFiatDepositLimit = (symbol) => + getFiatLimit(DEPOSIT_LIMIT_KEY, symbol); export const getOnramp = (state, ownProps) => state.app.onramp[ownProps.currency][ownProps.method]; diff --git a/web/src/containers/Withdraw/Fiat/Form.js b/web/src/containers/Withdraw/Fiat/Form.js index 801a709bf0..6860cd1438 100644 --- a/web/src/containers/Withdraw/Fiat/Form.js +++ b/web/src/containers/Withdraw/Fiat/Form.js @@ -147,7 +147,7 @@ class Form extends Component { const { icons: ICONS, activeTheme, activeLanguage, constants } = this.props; const balanceAvailable = balance[`${currency}_available`]; - const withdrawal_limit = getFiatWithdrawalLimit(verification_level); + const withdrawal_limit = getFiatWithdrawalLimit(currency); const { rate: withdrawal_fee } = getFiatWithdrawalFee(currency); const formValues = generateFormValues( From 987db9aaefe2451a5043fde47531d4481c35ac74 Mon Sep 17 00:00:00 2001 From: Ali Beikverdi Date: Fri, 10 May 2024 17:58:59 +0900 Subject: [PATCH 05/10] version update --- server/api/swagger/swagger.js | 2 +- server/package.json | 2 +- version | 2 +- web/package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/api/swagger/swagger.js b/server/api/swagger/swagger.js index edc1b3929a..9eedc35427 100644 --- a/server/api/swagger/swagger.js +++ b/server/api/swagger/swagger.js @@ -4,7 +4,7 @@ const definition = { swagger: '2.0', info: { title: 'HollaEx Kit', - version: '2.10.3' + version: '2.10.4' }, host: 'api.hollaex.com', basePath: '/v2', diff --git a/server/package.json b/server/package.json index 3ccc48dc95..d2d2dbf2a8 100644 --- a/server/package.json +++ b/server/package.json @@ -1,5 +1,5 @@ { - "version": "2.10.3", + "version": "2.10.4", "private": false, "description": "HollaEx Kit", "keywords": [ diff --git a/version b/version index fe1824995d..55f001e46c 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.10.3 \ No newline at end of file +2.10.4 \ No newline at end of file diff --git a/web/package.json b/web/package.json index 63f94adf81..5cc72a85de 100644 --- a/web/package.json +++ b/web/package.json @@ -1,6 +1,6 @@ { "name": "hollaex-kit", - "version": "2.10.3", + "version": "2.10.4", "private": true, "dependencies": { "@ant-design/compatible": "1.0.5", From 359fd5374f58955ec41e910d2c94253adf7c4dad Mon Sep 17 00:00:00 2001 From: Ali Beikverdi Date: Sat, 11 May 2024 22:13:16 +0900 Subject: [PATCH 06/10] wallet deposit and withdrawal redirection logic fix based on d/w enabled or disabled --- web/src/containers/Wallet/CurrencyWallet.js | 31 +++++++++++---------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/web/src/containers/Wallet/CurrencyWallet.js b/web/src/containers/Wallet/CurrencyWallet.js index e963cdd18c..70ed489d42 100644 --- a/web/src/containers/Wallet/CurrencyWallet.js +++ b/web/src/containers/Wallet/CurrencyWallet.js @@ -327,20 +327,23 @@ class Wallet extends Component { currency.toUpperCase() )} - - {STRINGS.formatString( - STRINGS['CURRENCY_WALLET.WALLET_DEPOSIT'], - - {currency.toUpperCase()} - , - - here - - )} - + {coins[currency].allow_deposit && coins[currency].allow_withdrawal ? ( + + {STRINGS.formatString( + STRINGS['CURRENCY_WALLET.WALLET_DEPOSIT'], + + {currency.toUpperCase()} + , + + here + + )} + + ) : null + } ) : chartData.length ? ( Date: Tue, 14 May 2024 13:35:18 +0900 Subject: [PATCH 07/10] updated string --- web/package-lock.json | 2 +- web/src/config/lang/de.json | 3 +-- web/src/config/lang/en.json | 2 +- web/src/config/lang/nl.json | 3 +-- web/src/config/lang/pt.json | 3 +-- web/src/config/lang/ur.json | 3 +-- web/yarn.lock | 7 +------ 7 files changed, 7 insertions(+), 16 deletions(-) diff --git a/web/package-lock.json b/web/package-lock.json index 3a40aebdc1..4a7de95ff4 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -1,6 +1,6 @@ { "name": "hollaex-kit", - "version": "2.10.3", + "version": "2.10.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/web/src/config/lang/de.json b/web/src/config/lang/de.json index 2e9fae05d0..c1b44efd25 100644 --- a/web/src/config/lang/de.json +++ b/web/src/config/lang/de.json @@ -626,8 +626,7 @@ "INTERNAL": "intern", "BLOCKCHAIN": "Blockchain", "STAKE": "Einsatz", - "REFERRAL": "Verweisung", - "QUICK_TRADE_TOOLTIP": "Order executed through convert system" + "REFERRAL": "Verweisung" }, "ACCOUNT_SECURITY": { "OTP": { diff --git a/web/src/config/lang/en.json b/web/src/config/lang/en.json index b504854bdf..753c26bde9 100644 --- a/web/src/config/lang/en.json +++ b/web/src/config/lang/en.json @@ -609,7 +609,7 @@ "BLOCKCHAIN": "blockchain", "STAKE": "stake", "REFERRAL": "referral", - "QUICK_TRADE_TOOLTIP": "Order executed through convert system" + "QUICK_TRADE_TOOLTIP": "Order executed through OTC" }, "ACCOUNT_SECURITY": { "TITLE_TEXT": "Adjust the security settings for your account. From Two-factor authentication, password, API keys and other security related functions.", diff --git a/web/src/config/lang/nl.json b/web/src/config/lang/nl.json index c051e960dc..57196a0e84 100644 --- a/web/src/config/lang/nl.json +++ b/web/src/config/lang/nl.json @@ -596,8 +596,7 @@ "INTERNAL": "intern", "BLOCKCHAIN": "blockchain", "STAKE": "inzet", - "REFERRAL": "verwijzing", - "QUICK_TRADE_TOOLTIP": "Order executed through convert system" + "REFERRAL": "verwijzing" }, "ACCOUNT_SECURITY": { "TITLE_TEXT": "Pas de beveiligingsinstellingen voor uw account aan. Van tweefactorauthenticatie, wachtwoord, API-sleutels en andere beveiligingsgerelateerde functies.", diff --git a/web/src/config/lang/pt.json b/web/src/config/lang/pt.json index bc65d927db..4fffbe6626 100644 --- a/web/src/config/lang/pt.json +++ b/web/src/config/lang/pt.json @@ -625,8 +625,7 @@ "INTERNAL": "interno", "BLOCKCHAIN": "blockchain", "STAKE": "estaca", - "REFERRAL": "referência", - "QUICK_TRADE_TOOLTIP": "Order executed through convert system" + "REFERRAL": "referência" }, "ACCOUNT_SECURITY": { "TITLE_TEXT": "Ajuste as configurações de segurança para sua conta: autenticação de dois fatores (2FA), senha, chaves API e outras funções relacionadas à segurança.", diff --git a/web/src/config/lang/ur.json b/web/src/config/lang/ur.json index c40d7462b5..9a3fba1478 100644 --- a/web/src/config/lang/ur.json +++ b/web/src/config/lang/ur.json @@ -584,8 +584,7 @@ "INTERNAL": "اندرونی", "BLOCKCHAIN": "بلاکچین", "STAKE": "داؤ", - "REFERRAL": "حوالہ", - "QUICK_TRADE_TOOLTIP": "Order executed through convert system" + "REFERRAL": "حوالہ" }, "ACCOUNT_SECURITY": { "TITLE_TEXT": "اپنے اکاؤنٹ کے لیے سیکیورٹی کی ترتیبات کو ایڈجسٹ کریں۔ دو عنصر کی توثیق، پاس ورڈ، اے پی ای کیز اور سیکیورٹی سے متعلق دیگر افعال سے۔", diff --git a/web/yarn.lock b/web/yarn.lock index 9503caf94b..f4800bb7e9 100644 --- a/web/yarn.lock +++ b/web/yarn.lock @@ -12960,11 +12960,6 @@ react-qr-barcode-scanner@1.0.6: "@zxing/library" "^0.17.0" react-webcam "^5.0.1" -react-recaptcha-v3@2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/react-recaptcha-v3/-/react-recaptcha-v3-2.0.1.tgz" - integrity sha512-ZQ+auotgu+E/6YAbPqk53sf9xgcp8TFvVVfL4bVR7PXj98nQmdaONugdLJEA7g1iTZ4yQqC4mZbcVUGZmwb25Q== - react-redux@^6.0.0, react-redux@6.0.1: version "6.0.1" resolved "https://registry.npmjs.org/react-redux/-/react-redux-6.0.1.tgz" @@ -13143,7 +13138,7 @@ react-with-styles@^3.0.0, react-with-styles@^3.2.0: prop-types "^15.6.2" react-with-direction "^1.3.0" -react@*, "react@^0.14 || ^15 || ^16", "react@^0.14 || ^15.0.0 || ^16.0.0-alpha", "react@^0.14 || ^15.5.4 || ^16.1.1", "react@^0.14 || >=15", "react@^0.14.0 || ^15.0.0 || ^16", "react@^0.14.0 || ^15.0.0 || ^16.0.0", "react@^0.14.0 || ^15.0.0-0 || ^16.0.0", "react@^0.14.0 || ^15.0.0-rc || ^16.0.0-rc || ^16.0.0", "react@^0.14.0 || ^15.0.1 || ^16.0.0 || ^17.0.0", "react@^15.0.0-0 || ^16.0.0-0 || ^17.0.0-0", "react@^15.3.0 || ^16.0.0", "react@^15.5.3 || ^16.0.0", "react@^15.5.4 || ^16.0.0 || ^17.0.0", "react@^15.6.0 || ^16.0.0", "react@^15.6.2 || ^16.0", "react@^15.6.2 || ^16.x", react@^16.0.0, react@^16.13.1, react@^16.3.0, "react@^16.3.0 || ^17.0.0", react@^16.4.0, react@^16.4.0-0, react@^16.8.0, "react@>= 16.3", "react@>= 16.3.0", react@>=0.14, react@>=0.14.0, react@>=15, react@>=15.0.0, react@>=15.3.0, react@>=15.4, react@>=15.x, react@>=16.0.0, react@>=16.3.0, react@>=16.6.0, react@>=16.8.0, react@>=16.9, react@>=16.9.0, "react@0.13.x || 0.14.x || ^15.0.0-0 || 15.x.x || ^16.0.0-0 || ^16.x.x", react@16.13.1, react@16.x: +react@*, "react@^0.14 || ^15 || ^16", "react@^0.14 || ^15.0.0 || ^16.0.0-alpha", "react@^0.14 || ^15.5.4 || ^16.1.1", "react@^0.14 || >=15", "react@^0.14.0 || ^15.0.0 || ^16", "react@^0.14.0 || ^15.0.0 || ^16.0.0", "react@^0.14.0 || ^15.0.0-0 || ^16.0.0", "react@^0.14.0 || ^15.0.0-rc || ^16.0.0-rc || ^16.0.0", "react@^0.14.0 || ^15.0.1 || ^16.0.0 || ^17.0.0", "react@^15.0.0-0 || ^16.0.0-0 || ^17.0.0-0", "react@^15.3.0 || ^16.0.0", "react@^15.5.3 || ^16.0.0", "react@^15.5.4 || ^16.0.0 || ^17.0.0", "react@^15.6.0 || ^16.0.0", "react@^15.6.2 || ^16.0", react@^16.0.0, react@^16.13.1, react@^16.3.0, "react@^16.3.0 || ^17.0.0", react@^16.4.0, react@^16.4.0-0, react@^16.8.0, "react@>= 16.3", "react@>= 16.3.0", react@>=0.14, react@>=0.14.0, react@>=15, react@>=15.0.0, react@>=15.3.0, react@>=15.4, react@>=15.x, react@>=16.0.0, react@>=16.3.0, react@>=16.6.0, react@>=16.8.0, react@>=16.9, react@>=16.9.0, "react@0.13.x || 0.14.x || ^15.0.0-0 || 15.x.x || ^16.0.0-0 || ^16.x.x", react@16.13.1, react@16.x: version "16.13.1" resolved "https://registry.npmjs.org/react/-/react-16.13.1.tgz" integrity sha512-YMZQQq32xHLX0bz5Mnibv1/LHb3Sqzngu7xstSM+vrkE5Kzr9xE0yMByK5kMoTK30YVJE61WfbxIFFvfeDKT1w== From a6c8ae544caa91b11caccf7feaa8d7d8b79ee39d Mon Sep 17 00:00:00 2001 From: fetok12 Date: Tue, 14 May 2024 12:24:29 +0300 Subject: [PATCH 08/10] init-captcha-in-kit --- web/package.json | 1 + web/src/components/ConfigProvider/index.js | 12 +++++++++++- web/src/config/constants.js | 3 +++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/web/package.json b/web/package.json index 5cc72a85de..c1296cdbc1 100644 --- a/web/package.json +++ b/web/package.json @@ -63,6 +63,7 @@ "react-modal": "3.8.1", "react-moment": "0.9.2", "react-qr-barcode-scanner": "1.0.6", + "react-recaptcha-v3": "^2.0.1", "react-redux": "6.0.1", "react-router": "3.2.1", "react-sortable-hoc": "1.10.1", diff --git a/web/src/components/ConfigProvider/index.js b/web/src/components/ConfigProvider/index.js index 27be6d1a7c..ac852b13ad 100644 --- a/web/src/components/ConfigProvider/index.js +++ b/web/src/components/ConfigProvider/index.js @@ -2,6 +2,8 @@ import React, { Component } from 'react'; import { connect } from 'react-redux'; import { getIconByKey, generateAllIcons, addDefaultLogo } from 'utils/icon'; import { calculateThemes } from 'utils/color'; +import { loadReCaptcha } from 'react-recaptcha-v3'; +import { DEFAULT_CAPTCHA_SITEKEY } from 'config/constants'; import merge from 'lodash.merge'; export const ProjectConfig = React.createContext('appConfig'); @@ -37,7 +39,15 @@ class ConfigProvider extends Component { sections, }; } - + componentDidMount() { + const { + initialConfig: { captcha = {} }, + } = this.props; + + // ReCaptcha Initialization + const siteKey = captcha.site_key || DEFAULT_CAPTCHA_SITEKEY; + loadReCaptcha(siteKey, () => {}); + } UNSAFE_componentWillUpdate(_, nextState) { const { color, icons } = this.state; if (JSON.stringify(color) !== JSON.stringify(nextState.color)) { diff --git a/web/src/config/constants.js b/web/src/config/constants.js index ef887c41b9..e00c370011 100644 --- a/web/src/config/constants.js +++ b/web/src/config/constants.js @@ -197,6 +197,9 @@ export const EXPLORERS_ENDPOINT = (currency) => { export const BALANCE_ERROR = 'Insufficient balance to perform the order'; +export const DEFAULT_CAPTCHA_SITEKEY = + '6LeuOKoUAAAAAGVoZcSWXJH60GHt4crvIaNXn1YA'; // default recaptcha v3; // default recaptcha v3 + export const TIME_ZONE = process.env.REACT_APP_TIMEZONE || 'GMT'; export const TOKEN_EMAIL = 'token::email'; export const TOKEN_MAX_AGE = 23 * 60 * 60; From 9ec93bc8b76983409b92c4b78a1a1f862a5dc423 Mon Sep 17 00:00:00 2001 From: fetok12 Date: Tue, 14 May 2024 12:25:01 +0300 Subject: [PATCH 09/10] init-captcha-in-kit --- web/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/package.json b/web/package.json index c1296cdbc1..941b9ac0a3 100644 --- a/web/package.json +++ b/web/package.json @@ -63,7 +63,7 @@ "react-modal": "3.8.1", "react-moment": "0.9.2", "react-qr-barcode-scanner": "1.0.6", - "react-recaptcha-v3": "^2.0.1", + "react-recaptcha-v3": "2.0.1", "react-redux": "6.0.1", "react-router": "3.2.1", "react-sortable-hoc": "1.10.1", From e19009df09454d63a8656dcc333003fbb5ba7c2f Mon Sep 17 00:00:00 2001 From: fetok12 Date: Tue, 14 May 2024 12:36:05 +0300 Subject: [PATCH 10/10] init-captcha-in-kit --- web/package.json | 1 - web/src/components/ConfigProvider/index.js | 13 +++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/web/package.json b/web/package.json index 941b9ac0a3..5cc72a85de 100644 --- a/web/package.json +++ b/web/package.json @@ -63,7 +63,6 @@ "react-modal": "3.8.1", "react-moment": "0.9.2", "react-qr-barcode-scanner": "1.0.6", - "react-recaptcha-v3": "2.0.1", "react-redux": "6.0.1", "react-router": "3.2.1", "react-sortable-hoc": "1.10.1", diff --git a/web/src/components/ConfigProvider/index.js b/web/src/components/ConfigProvider/index.js index ac852b13ad..fab12f0f5a 100644 --- a/web/src/components/ConfigProvider/index.js +++ b/web/src/components/ConfigProvider/index.js @@ -2,7 +2,6 @@ import React, { Component } from 'react'; import { connect } from 'react-redux'; import { getIconByKey, generateAllIcons, addDefaultLogo } from 'utils/icon'; import { calculateThemes } from 'utils/color'; -import { loadReCaptcha } from 'react-recaptcha-v3'; import { DEFAULT_CAPTCHA_SITEKEY } from 'config/constants'; import merge from 'lodash.merge'; @@ -40,14 +39,12 @@ class ConfigProvider extends Component { }; } componentDidMount() { - const { - initialConfig: { captcha = {} }, - } = this.props; - - // ReCaptcha Initialization - const siteKey = captcha.site_key || DEFAULT_CAPTCHA_SITEKEY; - loadReCaptcha(siteKey, () => {}); + const script = document.createElement('script'); + script.src = `https://www.google.com/recaptcha/api.js?render=${DEFAULT_CAPTCHA_SITEKEY}`; + document.body.appendChild(script); + } + UNSAFE_componentWillUpdate(_, nextState) { const { color, icons } = this.state; if (JSON.stringify(color) !== JSON.stringify(nextState.color)) {