Refactor OpenSafe container

This commit is contained in:
apanizo 2018-09-25 10:36:47 +02:00
parent 1c3c548284
commit 6a76217020
3 changed files with 20 additions and 7 deletions

View File

@ -35,7 +35,7 @@ class TextField extends React.PureComponent<TextFieldProps> {
const underline = meta.active || (meta.visited && !meta.valid)
const inputRoot = helperText ? classes.root : undefined
const inputProps = { ...restInput, autoComplete: 'off' }
const inputProps = { ...restInput, autoComplete: 'false' }
const inputRootProps = { disableUnderline: !underline, className: inputRoot }
return (

View File

@ -2,22 +2,33 @@
import * as React from 'react'
import { withStyles } from '@material-ui/core/styles'
import Paper from '@material-ui/core/Paper'
import Block from '~/components/layout/Block'
import { lg } from '~/theme/variables'
const styles = () => ({
root: {
margin: '10px',
maxWidth: '770px',
},
container: {
maxWidth: '600px',
letterSpacing: '-0.5px',
padding: lg,
},
})
type Props = {
classes: Object,
children: React$Node,
controls: React$Node,
}
const OpenPaper = ({ classes, children }: Props) => (
const OpenPaper = ({ classes, children, controls }: Props) => (
<Paper className={classes.root} elevation={1}>
{children}
<Block className={classes.container}>
{children}
</Block>
{ controls }
</Paper>
)

View File

@ -1,6 +1,6 @@
// @flow
import * as React from 'react'
import Block from '~/components/layout/Block'
import OpenPaper from '~/routes/open/components/OpenPaper'
import { getAccountsFrom } from '~/routes/open/utils/safeDataExtractor'
import Owners from './Owners'
import Confirmations from './Confirmations'
@ -18,10 +18,12 @@ export const safeFieldsValidation = (values: Object) => {
return errors
}
export default () => (constrols: React$Node, { values }: Object) => (
<Block margin="md">
const SafeRestPage = () => (controls: React$Node, { values }: Object) => (
<OpenPaper controls={controls}>
<Owners numOwners={values.owners} otherAccounts={getAccountsFrom(values)} />
<Confirmations />
<DailyLimit />
</Block>
</OpenPaper>
)
export default SafeRestPage