Set Modal default to open (#2157)

This commit is contained in:
Jaco Greeff 2020-01-20 15:30:25 +01:00 committed by GitHub
parent d4fbce559a
commit 18af907070
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
36 changed files with 8 additions and 51 deletions

View File

@ -68,7 +68,6 @@ export default function ({ address, onClose }: Props): React.ReactElement<Props>
<Modal
className='app--accounts-Modal'
header={t('Backup account')}
open
>
<Content
address={address}

View File

@ -38,7 +38,6 @@ class ChangePass extends TxComponent<Props, State> {
<Modal
className='app--accounts-Modal'
header={t('Change account password')}
open
>
{this.renderContent()}
{this.renderButtons()}

View File

@ -191,7 +191,6 @@ function Create ({ className, onClose, onStatusChange, seed: propsSeed, type: pr
<Modal
className={className}
header={t('Add an account via seed')}
open
>
{address && isConfirmationOpen && (
<CreateConfirmation

View File

@ -18,10 +18,7 @@ export default function CreateConfirmation ({ address, name, onClose, onCommit }
const { t } = useTranslation();
return (
<Modal
header={t('Important notice')}
open
>
<Modal header={t('Important notice')}>
<Modal.Content>
<AddressRow
defaultName={name}

View File

@ -138,7 +138,6 @@ export default function Derive ({ className, from, onClose }: Props): React.Reac
<Modal
className={className}
header={t('Derive account from pair')}
open
>
{address && isConfirmationOpen && (
<CreateConfirmation

View File

@ -105,7 +105,6 @@ function Identity ({ address, className, onClose }: Props): React.ReactElement<P
<Modal
className={className}
header={t('Register identity')}
open
>
<Modal.Content>
<Input

View File

@ -38,10 +38,7 @@ class Import extends TxComponent<Props, State> {
const { isFileValid, isPassValid } = this.state;
return (
<Modal
header={t('Add via backup file')}
open
>
<Modal header={t('Add via backup file')}>
{this.renderInput()}
<Modal.Actions>
<Button.Group>

View File

@ -50,7 +50,6 @@ function QrModal ({ className, onClose, onStatusChange }: Props): React.ReactEle
<Modal
className={className}
header={t('Add account via Qr')}
open
>
<Modal.Content>
{

View File

@ -87,7 +87,6 @@ function Transfer ({ className, onClose, recipientId: propRecipientId, senderId:
<Modal
className='app--accounts-Modal'
header={t('Send funds')}
open
>
<Modal.Content>
<div className={className}>

View File

@ -75,10 +75,7 @@ export default function Create ({ onClose, onStatusChange }: Props): React.React
};
return (
<Modal
header={t('Add an address')}
open
>
<Modal header={t('Add an address')}>
<Modal.Content>
<AddressRow
defaultName={name}

View File

@ -28,7 +28,6 @@ export default function RemoveABI ({ code, onClose, onRemove }: Props): React.Re
className='app--accounts-Modal'
header={t('Confirm ABI removal')}
onClose={onClose}
open
>
<Modal.Content>
<CodeRow

View File

@ -86,7 +86,6 @@ export default function Slashing ({ className, isMember }: Props): React.ReactEl
<Modal
className={className}
header={t('Revert pending slashes')}
open
>
<Modal.Content>
<InputAddress

View File

@ -38,7 +38,6 @@ function PreImage ({ className, onClose }: Props): React.ReactElement<Props> {
<Modal
className={className}
header={t('Submit preimage')}
open
>
<Modal.Content>
<InputAddress

View File

@ -30,7 +30,6 @@ export default function Propose ({ className, onClose }: Props): React.ReactElem
<Modal
className={className}
header={t('Submit proposal')}
open
>
<Modal.Content>
<InputAddress

View File

@ -35,7 +35,6 @@ export default function Seconding ({ depositors, proposalId }: Props): React.Rea
{isSecondingOpen && (
<Modal
header={t('Second proposal')}
open
size='small'
>
<Modal.Content>

View File

@ -33,7 +33,6 @@ export default function Voting ({ referendumId }: Props): React.ReactElement<Pro
{isVotingOpen && (
<Modal
header={t('Vote on proposal')}
open
size='small'
>
<Modal.Content>

View File

@ -28,10 +28,7 @@ function Create ({ onClose, onRegister, t }: Props): React.ReactElement<Props> {
};
return (
<Modal
header={t('Register an Asset')}
open
>
<Modal header={t('Register an Asset')}>
<Modal.Content>
<InputNumber
help={t('Enter the Asset ID of the token you want to manage.')}

View File

@ -68,7 +68,6 @@ class BondExtra extends TxComponent<Props, State> {
<Modal
className='staking--BondExtra'
header= {t('Bond more funds')}
open
size='small'
>
{this.renderContent()}

View File

@ -72,7 +72,6 @@ function InjectKeys ({ isOpen = true, onClose, t }: Props): React.ReactElement<P
return (
<Modal
header={t('Inject Keys')}
open
size='small'
>
<Modal.Content>

View File

@ -61,7 +61,6 @@ function Nominate ({ className, controllerId, nominees, onClose, next, stakingOv
<Modal
className={`staking--Nominating ${className}`}
header={t('Nominate Validators')}
open
>
<Modal.Content className='ui--signer-Signer-Content'>
<InputAddress

View File

@ -45,7 +45,6 @@ class SetControllerAccount extends TxComponent<Props, State> {
<Modal
className='staking--SetControllerAccount'
header={t('Change controller account')}
open
size='small'
>
<Modal.Content className='ui--signer-Signer-Content'>

View File

@ -39,7 +39,6 @@ class SetRewardDestination extends TxComponent<Props, State> {
<Modal
className='staking--Bonding'
header={t('Bonding Preferences')}
open
size='small'
>
{this.renderContent()}

View File

@ -42,7 +42,6 @@ function SetSessionKey ({ controllerId, isOpen, onClose, sessionIds, stashId, t
<Modal
className='staking--SetSessionAccount'
header={t('Set Session Key')}
open
size='small'
>
<Modal.Content className='ui--signer-Signer-Content'>

View File

@ -63,7 +63,6 @@ class Unbond extends TxComponent<Props, State> {
<Modal
className='staking--Unbond'
header={t('Unbond funds')}
open
size='small'
>
{this.renderContent()}

View File

@ -85,7 +85,6 @@ class Validate extends TxComponent<Props, State> {
<Modal
className='staking--Staking'
header={t('Set validator preferences')}
open
size='small'
>
{this.renderContent()}

View File

@ -59,7 +59,6 @@ class NewStake extends TxComponent<Props, State> {
<Modal
className='staking--Bonding'
header={t('Bonding Preferences')}
open
size='small'
>
<Modal.Content className='ui--signer-Signer-Content'>

View File

@ -35,7 +35,6 @@ function Voting ({ hash, proposalId, t }: Props): React.ReactElement<Props> | nu
{isVotingOpen && (
<Modal
header={t('Vote on proposal')}
open
size='small'
>
<Modal.Content>

View File

@ -46,7 +46,6 @@ class Unlock extends TxComponent<Props, State> {
<Modal
className='toolbox--Unlock'
header={t('Unlock account')}
open
>
{this.renderContent()}
{this.renderActions()}

View File

@ -35,7 +35,6 @@ export default function Propose ({ className }: Props): React.ReactElement<Props
<Modal
className={className}
header={t('Submit treasury proposal')}
open
size='small'
>
<Modal.Content>

View File

@ -47,7 +47,6 @@ export default function Submission ({ councilProposals, id, isDisabled }: Props)
{isOpen && (
<Modal
header={t('Submit to council')}
open
size='small'
>
<Modal.Content>

View File

@ -65,7 +65,6 @@ export default function Voting ({ councilProposals, isDisabled }: Props): React.
{isOpen && (
<Modal
header={t('Vote on proposal')}
open
size='small'
>
<Modal.Content>

View File

@ -20,7 +20,6 @@ export default function NetworkModal ({ className, onClose }: Props): React.Reac
<Modal
className={className}
header={t('Select Network')}
open
>
<Modal.Content>
<General

View File

@ -250,7 +250,6 @@ function AccountName ({ children, className, defaultName, label, onClick, overri
{isJudgementOpen && (
<Modal
header={t('Provide judgement')}
open
size='small'
>
<Modal.Content>

View File

@ -102,7 +102,6 @@ export default function Forget (props: Props): React.ReactElement<Props> {
className='app--accounts-Modal'
header={getHeaderText(mode, t)}
onClose={onClose}
open
>
<Modal.Content>{renderContent(props, t)}</Modal.Content>
<Modal.Actions>

View File

@ -12,11 +12,12 @@ import { classes } from './util';
interface Props extends BareProps {
children: React.ReactNode;
header?: React.ReactNode;
open?: boolean;
[index: string]: any;
}
function Modal (props: Props): React.ReactElement<Props> {
const { className, children, header } = props;
const { className, children, header, open = true } = props;
return (
<SUIModal
@ -24,6 +25,7 @@ function Modal (props: Props): React.ReactElement<Props> {
className={classes('theme--default', 'ui--Modal', className)}
dimmer='inverted'
header={undefined}
open={open}
>
{header && (
<SUIModal.Header>{header}</SUIModal.Header>

View File

@ -163,10 +163,7 @@ class Signer extends React.PureComponent<Props, State> {
}
return (
<Modal
className='ui--signer-Signer'
open
>
<Modal className='ui--signer-Signer'>
<ErrorBoundary onError={this.onRenderError}>
{this.renderContent()}
</ErrorBoundary>