Adapt owners inputs to new flow

This commit is contained in:
apanizo 2018-09-25 10:38:07 +02:00
parent 6a76217020
commit d8965b6304
2 changed files with 23 additions and 32 deletions

View File

@ -52,29 +52,27 @@ const Owners = (props: Props) => {
</Block> </Block>
{ renderOwners && [...Array(Number(numOwners))].map((x, index) => ( { renderOwners && [...Array(Number(numOwners))].map((x, index) => (
<Row key={`owner${(index)}`}> <Row key={`owner${(index)}`}>
<Col xs={11} xsOffset={1}> <Col xs={11} xsOffset={1} layout="column" margin="md">
<Paragraph weight="bold">Owner {index + 1}</Paragraph>
<Block margin="sm"> <Block margin="sm">
<Paragraph weight="bold">Owner {index + 1}</Paragraph> <Field
<Block margin="sm"> name={getOwnerNameBy(index)}
<Field component={TextField}
name={getOwnerNameBy(index)} type="text"
component={TextField} validate={required}
type="text" placeholder="Owner Name*"
validate={required} text="Owner Name"
placeholder="Owner Name*" />
text="Owner Name" </Block>
/> <Block margin="sm">
</Block> <Field
<Block margin="sm"> name={getOwnerAddressBy(index)}
<Field component={TextField}
name={getOwnerAddressBy(index)} type="text"
component={TextField} validate={getAddressValidators(otherAccounts, index)}
type="text" placeholder="Owner Address*"
validate={getAddressValidators(otherAccounts, index)} text="Owner Address"
placeholder="Owner Address*" />
text="Owner Address"
/>
</Block>
</Block> </Block>
</Col> </Col>
</Row> </Row>

View File

@ -7,7 +7,6 @@ import { required } from '~/components/forms/validator'
import Block from '~/components/layout/Block' import Block from '~/components/layout/Block'
import { FIELD_NAME } from '~/routes/open/components/fields' import { FIELD_NAME } from '~/routes/open/components/fields'
import Paragraph from '~/components/layout/Paragraph' import Paragraph from '~/components/layout/Paragraph'
import { lg } from '~/theme/variables'
import OpenPaper from '../OpenPaper' import OpenPaper from '../OpenPaper'
type Props = { type Props = {
@ -18,15 +17,10 @@ const styles = () => ({
root: { root: {
display: 'flex', display: 'flex',
}, },
container: {
maxWidth: '600px',
letterSpacing: '-0.5px',
padding: lg,
},
}) })
const SafeName = ({ classes }: Props) => ( const SafeName = ({ classes }: Props) => (
<Block className={classes.container}> <React.Fragment>
<Block margin="lg"> <Block margin="lg">
<Paragraph noMargin size="md" color="primary" weight="light"> <Paragraph noMargin size="md" color="primary" weight="light">
This setup will create a Safe with one or more owners. Optionally give the Safe a local name. This setup will create a Safe with one or more owners. Optionally give the Safe a local name.
@ -53,15 +47,14 @@ const SafeName = ({ classes }: Props) => (
text="Safe name" text="Safe name"
/> />
</Block> </Block>
</Block> </React.Fragment>
) )
const SafeNameForm = withStyles(styles)(SafeName) const SafeNameForm = withStyles(styles)(SafeName)
const SafeNamePage = () => (controls: React$Node) => ( const SafeNamePage = () => (controls: React$Node) => (
<OpenPaper> <OpenPaper controls={controls}>
<SafeNameForm /> <SafeNameForm />
{ controls }
</OpenPaper> </OpenPaper>
) )