Better visibility in unchecked weight (#3404)

This commit is contained in:
Jaco Greeff 2020-08-12 14:09:26 +02:00 committed by GitHub
parent b47e032a6a
commit 4f2c85b58a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,28 +44,28 @@ function Sudo ({ className, isMine, sudoKey }: Props): React.ReactElement<Props>
label={t<string>('submit the following change')}
onChange={_onChangeExtrinsic}
/>
<br />
{withWeight && (
{api.tx.sudo.sudoUncheckedWeight && (
<InputNumber
help={t<string>('The unchecked weight as specified for the sudoUncheckedWeight call.')}
isDisabled={!withWeight}
isError={weight.eq(BN_ZERO)}
isZeroable={false}
label={t<string>('unchecked weight for this call')}
onChange={_onChangeWeight}
value={weight}
/>
)}
{api.tx.sudo.sudoUncheckedWeight && (
<Toggle
className='sudoToggle'
label={
withWeight
? t<string>('sudo with unchecked weight parameter')
: t<string>('sudo without unchecked weight parameter')
}
onChange={toggleWithWeight}
value={withWeight}
/>
>
<Toggle
className='sudoToggle'
isOverlay
label={
withWeight
? t<string>('with unchecked weight')
: t<string>('without unchecked weight')
}
onChange={toggleWithWeight}
value={withWeight}
/>
</InputNumber>
)}
<Button.Group>
<TxButton