Small cleanups, spinners & useInactives (#2550)
This commit is contained in:
parent
fde1bdcf2c
commit
0bcb0229f8
@ -66,7 +66,6 @@ function BondExtra ({ onClose, stashId }: Props): React.ReactElement<Props> {
|
||||
onStart={onClose}
|
||||
params={[maxAdditional]}
|
||||
tx='staking.bondExtra'
|
||||
withSpinner={false}
|
||||
/>
|
||||
</Modal.Actions>
|
||||
</Modal>
|
||||
|
||||
@ -55,13 +55,11 @@ function Nominate ({ className, controllerId, isOpen, next, nominees, onClose, s
|
||||
>
|
||||
<Modal.Content className='ui--signer-Signer-Content'>
|
||||
<InputAddress
|
||||
className='medium'
|
||||
defaultValue={controllerId}
|
||||
isDisabled
|
||||
label={t('controller account')}
|
||||
/>
|
||||
<InputAddress
|
||||
className='medium'
|
||||
defaultValue={stashId}
|
||||
isDisabled
|
||||
label={t('stash account')}
|
||||
@ -69,7 +67,6 @@ function Nominate ({ className, controllerId, isOpen, next, nominees, onClose, s
|
||||
<InputAddressMulti
|
||||
available={available}
|
||||
availableLabel={t('candidate accounts')}
|
||||
className='medium'
|
||||
defaultValue={nominees}
|
||||
help={t('Filter available candidates based on name, address or short account index.')}
|
||||
maxCount={MAX_NOMINEES}
|
||||
|
||||
@ -67,7 +67,6 @@ function SetControllerAccount ({ defaultControllerId, isValidating, onClose, sta
|
||||
onStart={onClose}
|
||||
params={[controllerId]}
|
||||
tx='staking.setController'
|
||||
withSpinner={false}
|
||||
/>
|
||||
</Modal.Actions>
|
||||
</Modal>
|
||||
|
||||
@ -52,7 +52,6 @@ function SetRewardDestination ({ controllerId, defaultDestination, onClose }: Pr
|
||||
onStart={onClose}
|
||||
params={[destination]}
|
||||
tx={'staking.setPayee'}
|
||||
withSpinner={false}
|
||||
/>
|
||||
</Modal.Actions>
|
||||
</Modal>
|
||||
|
||||
@ -75,7 +75,6 @@ function Unbond ({ className, controllerId, onClose, stakingLedger, stashId }: P
|
||||
onStart={onClose}
|
||||
params={[maxUnbond]}
|
||||
tx='staking.unbond'
|
||||
withSpinner={false}
|
||||
/>
|
||||
</Modal.Actions>
|
||||
</Modal>
|
||||
|
||||
@ -64,7 +64,6 @@ function Validate ({ controllerId, onClose, stashId }: Props): React.ReactElemen
|
||||
onStart={onClose}
|
||||
params={[prefs]}
|
||||
tx='staking.validate'
|
||||
withSpinner={false}
|
||||
/>
|
||||
</Modal.Actions>
|
||||
</Modal>
|
||||
|
||||
@ -24,15 +24,15 @@ export default function useInactives (stashId: string, nominees?: string[]): str
|
||||
? nominees.map((id) => [api.query.staking.erasStakers, [indexes.activeEra, id]])
|
||||
: nominees.map((id) => [api.query.staking.stakers, id]),
|
||||
(exposures: Exposure[]): void => {
|
||||
const inactives: string[] = [];
|
||||
|
||||
exposures.forEach((exposure, index): void => {
|
||||
if (!exposure.others.some((indv): boolean => indv.who.eq(stashId))) {
|
||||
inactives.push(nominees[index].toString());
|
||||
}
|
||||
});
|
||||
|
||||
mountedRef.current && setInactives(inactives);
|
||||
mountedRef.current && setInactives(
|
||||
exposures
|
||||
.map((exposure, index) =>
|
||||
exposure.others.some(({ who }) => who.eq(stashId))
|
||||
? null
|
||||
: nominees[index].toString()
|
||||
)
|
||||
.filter((inactiveId): inactiveId is string => !!inactiveId)
|
||||
);
|
||||
}
|
||||
)
|
||||
.then((_unsub): void => {
|
||||
|
||||
@ -90,7 +90,6 @@ function Stash ({ className, isDisabled, payout: { available, rewards, stashId }
|
||||
isDisabled={!extrinsic || isDisabled}
|
||||
isPrimary={false}
|
||||
label={t('Payout')}
|
||||
withSpinner={false}
|
||||
/>
|
||||
)}
|
||||
</td>
|
||||
|
||||
@ -39,7 +39,6 @@ function Propose ({ isMine, sudoKey }: Props): React.ReactElement<Props> {
|
||||
label={t('Submit Sudo')}
|
||||
params={[method]}
|
||||
tx='sudo.sudo'
|
||||
withSpinner={false}
|
||||
/>
|
||||
</Button.Group>
|
||||
</section>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user