From e4c88c6c12da645d90438bcf3a0828a6dfa241ac Mon Sep 17 00:00:00 2001 From: Wojciech Basiura Date: Tue, 24 Oct 2023 22:51:01 +0200 Subject: [PATCH 1/2] A0-3396: Hide proxy hint message --- packages/page-staking/src/Actions/partials/Bond.tsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/page-staking/src/Actions/partials/Bond.tsx b/packages/page-staking/src/Actions/partials/Bond.tsx index e1f9a11f9885..161a14dbc506 100644 --- a/packages/page-staking/src/Actions/partials/Bond.tsx +++ b/packages/page-staking/src/Actions/partials/Bond.tsx @@ -120,12 +120,13 @@ function Bond ({ className = '', isNominating, minNominated, minNominatorBond, m

{t('To ensure optimal fund security using the same stash/controller is strongly discouraged, but not forbidden.')}

) - : ( - <> -

{t('The stash should be treated as a cold wallet.')}

-

{t('As such it is recommended that you setup a proxy to control operations via the stash.')}

- - ) + : null + // : ( + // <> + //

{t('The stash should be treated as a cold wallet.')}

+ //

{t('As such it is recommended that you setup a proxy to control operations via the stash.')}

+ // + // ) } > Date: Wed, 25 Oct 2023 10:52:39 +0200 Subject: [PATCH 2/2] A0-3396: Hide & show message base on pallet proxy --- .../src/Actions/partials/Bond.tsx | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/packages/page-staking/src/Actions/partials/Bond.tsx b/packages/page-staking/src/Actions/partials/Bond.tsx index 161a14dbc506..0fe4221e14bd 100644 --- a/packages/page-staking/src/Actions/partials/Bond.tsx +++ b/packages/page-staking/src/Actions/partials/Bond.tsx @@ -11,7 +11,7 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react'; import { Dropdown, InputAddress, InputBalance, MarkError, Modal, Static } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import { BalanceFree, BlockToTime } from '@polkadot/react-query'; -import { BN_ZERO } from '@polkadot/util'; +import { BN_ZERO, isFunction } from '@polkadot/util'; import { useTranslation } from '../../translate.js'; import InputValidateAmount from '../Account/InputValidateAmount.js'; @@ -109,6 +109,15 @@ function Bond ({ className = '', isNominating, minNominated, minNominatorBond, m const isAccount = destination === 'Account'; const isDestError = isAccount && destBalance && destBalance.accountId.eq(destAccount) && destBalance.freeBalance.isZero(); + const hintForProxy = isFunction(api.query.proxy?.proxies) + ? ( + <> +

{t('The stash should be treated as a cold wallet.')}

+

{t('As such it is recommended that you setup a proxy to control operations via the stash.')}

+ + ) + : null; + return (
{t('To ensure optimal fund security using the same stash/controller is strongly discouraged, but not forbidden.')}

) - : null - // : ( - // <> - //

{t('The stash should be treated as a cold wallet.')}

- //

{t('As such it is recommended that you setup a proxy to control operations via the stash.')}

- // - // ) + : hintForProxy } >