Fix modal window form footers

This commit is contained in:
Germán Martínez 2019-09-09 11:31:42 +02:00
parent 277bbce179
commit efdba0fd57
2 changed files with 84 additions and 75 deletions

View File

@ -74,22 +74,27 @@ const SendCustomTx = ({
</IconButton> </IconButton>
</Row> </Row>
<Hairline /> <Hairline />
<Block className={classes.formContainer}> <GnoForm onSubmit={handleSubmit} formMutators={formMutators} initialValues={initialValues}>
<SafeInfo safeAddress={safeAddress} etherScanLink={etherScanLink} safeName={safeName} ethBalance={ethBalance} /> {(...args) => {
<Row margin="md"> const mutators = args[3]
<Col xs={1}>
<img src={ArrowDown} alt="Arrow Down" style={{ marginLeft: '8px' }} />
</Col>
<Col xs={11} center="xs" layout="column">
<Hairline />
</Col>
</Row>
<GnoForm onSubmit={handleSubmit} formMutators={formMutators} initialValues={initialValues}>
{(...args) => {
const mutators = args[3]
return ( return (
<> <>
<Block className={classes.formContainer}>
<SafeInfo
safeAddress={safeAddress}
etherScanLink={etherScanLink}
safeName={safeName}
ethBalance={ethBalance}
/>
<Row margin="md">
<Col xs={1}>
<img src={ArrowDown} alt="Arrow Down" style={{ marginLeft: '8px' }} />
</Col>
<Col xs={11} center="xs" layout="column">
<Hairline />
</Col>
</Row>
<Row margin="md"> <Row margin="md">
<Col xs={12}> <Col xs={12}>
<AddressInput <AddressInput
@ -143,27 +148,27 @@ const SendCustomTx = ({
/> />
</Col> </Col>
</Row> </Row>
<Hairline /> </Block>
<Row align="center" className={classes.buttonRow}> <Hairline />
<Button minWidth={140} minHeight={42} onClick={onClose}> <Row align="center" className={classes.buttonRow}>
Cancel <Button minWidth={140} minHeight={42} onClick={onClose}>
</Button> Cancel
<Button </Button>
type="submit" <Button
variant="contained" type="submit"
minHeight={42} variant="contained"
minWidth={140} minHeight={42}
color="primary" minWidth={140}
data-testid="review-tx-btn" color="primary"
> data-testid="review-tx-btn"
Review >
</Button> Review
</Row> </Button>
</> </Row>
) </>
}} )
</GnoForm> }}
</Block> </GnoForm>
</> </>
) )
} }

View File

@ -81,24 +81,28 @@ const SendFunds = ({
</IconButton> </IconButton>
</Row> </Row>
<Hairline /> <Hairline />
<Block className={classes.formContainer}> <GnoForm onSubmit={handleSubmit} formMutators={formMutators} initialValues={initialValues}>
<SafeInfo safeAddress={safeAddress} etherScanLink={etherScanLink} safeName={safeName} ethBalance={ethBalance} /> {(...args) => {
<Row margin="md"> const formState = args[2]
<Col xs={1}> const mutators = args[3]
<img src={ArrowDown} alt="Arrow Down" style={{ marginLeft: '8px' }} /> const { token } = formState.values
</Col> return (
<Col xs={11} center="xs" layout="column"> <>
<Hairline /> <Block className={classes.formContainer}>
</Col> <SafeInfo
</Row> safeAddress={safeAddress}
<GnoForm onSubmit={handleSubmit} formMutators={formMutators} initialValues={initialValues}> etherScanLink={etherScanLink}
{(...args) => { safeName={safeName}
const formState = args[2] ethBalance={ethBalance}
const mutators = args[3] />
const { token } = formState.values <Row margin="md">
<Col xs={1}>
return ( <img src={ArrowDown} alt="Arrow Down" style={{ marginLeft: '8px' }} />
<> </Col>
<Col xs={11} center="xs" layout="column">
<Hairline />
</Col>
</Row>
<Row margin="md"> <Row margin="md">
<Col xs={12}> <Col xs={12}>
<AddressInput <AddressInput
@ -154,27 +158,27 @@ const SendFunds = ({
</OnChange> </OnChange>
</Col> </Col>
</Row> </Row>
<Hairline /> </Block>
<Row align="center" className={classes.buttonRow}> <Hairline />
<Button minWidth={140} minHeight={42} onClick={onClose}> <Row align="center" className={classes.buttonRow}>
Cancel <Button minWidth={140} minHeight={42} onClick={onClose}>
</Button> Cancel
<Button </Button>
type="submit" <Button
variant="contained" type="submit"
minHeight={42} variant="contained"
minWidth={140} minHeight={42}
color="primary" minWidth={140}
data-testid="review-tx-btn" color="primary"
> data-testid="review-tx-btn"
Review >
</Button> Review
</Row> </Button>
</> </Row>
) </>
}} )
</GnoForm> }}
</Block> </GnoForm>
</> </>
) )
} }