Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A0-3396: update stashing text #89

Merged
merged 2 commits into from
Oct 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
</>
)
: (
<>
Marcin-Radecki marked this conversation as resolved.
Show resolved Hide resolved
<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