Skip to content

Commit

Permalink
Merge pull request #89 from Cardinal-Cryptography/A0-3396-update-stas…
Browse files Browse the repository at this point in the history
…hing-text

A0-3396: update stashing text
  • Loading branch information
youPickItUp authored Oct 25, 2023
2 parents 1f0f7ed + afa9421 commit bc6d2ef
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions packages/page-staking/src/Actions/partials/Bond.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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)
? (
<>
<p>{t('The stash should be treated as a cold wallet.')}</p>
<p>{t('As such it is recommended that you setup a proxy to control operations via the stash.')}</p>
</>
)
: null;

return (
<div className={className}>
<Modal.Columns
Expand All @@ -120,12 +129,7 @@ function Bond ({ className = '', isNominating, minNominated, minNominatorBond, m
<p>{t('To ensure optimal fund security using the same stash/controller is strongly discouraged, but not forbidden.')}</p>
</>
)
: (
<>
<p>{t('The stash should be treated as a cold wallet.')}</p>
<p>{t('As such it is recommended that you setup a proxy to control operations via the stash.')}</p>
</>
)
: hintForProxy
}
>
<InputAddress
Expand Down

0 comments on commit bc6d2ef

Please sign in to comment.