fixing eslint errors

This commit is contained in:
Mikhail Mikheev 2019-06-27 15:30:43 +04:00
parent 60ba580308
commit a27b4a3a47
5 changed files with 49 additions and 50 deletions

View File

@ -89,7 +89,6 @@ const CheckOwner = ({
</Button> </Button>
<Button <Button
type="submit" type="submit"
className={classes.button}
variant="contained" variant="contained"
minWidth={140} minWidth={140}
color="primary" color="primary"

View File

@ -1,6 +1,6 @@
// @flow // @flow
import { import {
lg, md, sm, background, lg, md, sm,
} from '~/theme/variables' } from '~/theme/variables'
export const styles = () => ({ export const styles = () => ({

View File

@ -10,13 +10,10 @@ import Identicon from '~/components/Identicon'
import Link from '~/components/layout/Link' import Link from '~/components/layout/Link'
import Paragraph from '~/components/layout/Paragraph' import Paragraph from '~/components/layout/Paragraph'
import Row from '~/components/layout/Row' import Row from '~/components/layout/Row'
import GnoForm from '~/components/forms/GnoForm'
import Col from '~/components/layout/Col' import Col from '~/components/layout/Col'
import Button from '~/components/layout/Button' import Button from '~/components/layout/Button'
import Block from '~/components/layout/Block' import Block from '~/components/layout/Block'
import Hairline from '~/components/layout/Hairline' import Hairline from '~/components/layout/Hairline'
import Field from '~/components/forms/Field'
import TextField from '~/components/forms/TextField'
import type { Owner } from '~/routes/safe/store/models/owner' import type { Owner } from '~/routes/safe/store/models/owner'
import { getEtherScanLink } from '~/logic/wallets/getWeb3' import { getEtherScanLink } from '~/logic/wallets/getWeb3'
import { secondary } from '~/theme/variables' import { secondary } from '~/theme/variables'
@ -68,7 +65,7 @@ const ReviewRemoveOwner = ({
</IconButton> </IconButton>
</Row> </Row>
<Hairline /> <Hairline />
<Block className={classes.formContainer}> <Block>
<Row className={classes.root}> <Row className={classes.root}>
<Col xs={4} layout="column"> <Col xs={4} layout="column">
<Block className={classes.details}> <Block className={classes.details}>
@ -90,7 +87,13 @@ const ReviewRemoveOwner = ({
Any transaction requires the confirmation of: Any transaction requires the confirmation of:
</Paragraph> </Paragraph>
<Paragraph size="lg" color="primary" noMargin weight="bolder" className={classes.name}> <Paragraph size="lg" color="primary" noMargin weight="bolder" className={classes.name}>
{values.threshold} out of {owners.size - 1} owner(s) {values.threshold}
{' '}
out of
{' '}
{owners.size - 1}
{' '}
owner(s)
</Paragraph> </Paragraph>
</Block> </Block>
</Block> </Block>
@ -98,35 +101,43 @@ const ReviewRemoveOwner = ({
<Col xs={8} layout="column" className={classes.owners}> <Col xs={8} layout="column" className={classes.owners}>
<Row className={classes.ownersTitle}> <Row className={classes.ownersTitle}>
<Paragraph size="lg" color="primary" noMargin> <Paragraph size="lg" color="primary" noMargin>
{owners.size - 1} Safe owner(s) {owners.size - 1}
{' '}
Safe owner(s)
</Paragraph> </Paragraph>
</Row> </Row>
<Hairline /> <Hairline />
{owners.map(owner => owner.get('address') != ownerAddress && ( {owners.map(
<React.Fragment key={owner.get('address')}> owner => owner.address !== ownerAddress && (
<Row className={classes.owner}> <React.Fragment key={owner.get('address')}>
<Col xs={1} align="center"> <Row className={classes.owner}>
<Identicon address={owner.get('address')} diameter={32} /> <Col xs={1} align="center">
</Col> <Identicon address={owner.get('address')} diameter={32} />
<Col xs={11}> </Col>
<Block className={classNames(classes.name, classes.userName)}> <Col xs={11}>
<Paragraph weight="bolder" size="lg" noMargin> <Block className={classNames(classes.name, classes.userName)}>
{owner.get('name')} <Paragraph weight="bolder" size="lg" noMargin>
</Paragraph> {owner.get('name')}
<Block align="center" className={classes.user}>
<Paragraph size="md" color="disabled" noMargin>
{owner.get('address')}
</Paragraph> </Paragraph>
<Link className={classes.open} to={getEtherScanLink(owner.get('address'), network)} target="_blank"> <Block align="center" className={classes.user}>
<OpenInNew style={openIconStyle} /> <Paragraph size="md" color="disabled" noMargin>
</Link> {owner.get('address')}
</Paragraph>
<Link
className={classes.open}
to={getEtherScanLink(owner.get('address'), network)}
target="_blank"
>
<OpenInNew style={openIconStyle} />
</Link>
</Block>
</Block> </Block>
</Block> </Col>
</Col> </Row>
</Row> <Hairline />
<Hairline /> </React.Fragment>
</React.Fragment> ),
))} )}
<Row className={classes.info} align="center"> <Row className={classes.info} align="center">
<Paragraph weight="bolder" noMargin color="primary" size="md"> <Paragraph weight="bolder" noMargin color="primary" size="md">
REMOVING OWNER &darr; REMOVING OWNER &darr;

View File

@ -1,6 +1,6 @@
// @flow // @flow
import { import {
lg, md, sm, border, background, lg, sm, border, background,
} from '~/theme/variables' } from '~/theme/variables'
export const styles = () => ({ export const styles = () => ({

View File

@ -3,9 +3,9 @@ import React from 'react'
import { List } from 'immutable' import { List } from 'immutable'
import { withStyles } from '@material-ui/core/styles' import { withStyles } from '@material-ui/core/styles'
import Close from '@material-ui/icons/Close' import Close from '@material-ui/icons/Close'
import MenuItem from '@material-ui/core/MenuItem'
import IconButton from '@material-ui/core/IconButton' import IconButton from '@material-ui/core/IconButton'
import SelectField from '~/components/forms/SelectField' import SelectField from '~/components/forms/SelectField'
import MenuItem from '@material-ui/core/MenuItem'
import Paragraph from '~/components/layout/Paragraph' import Paragraph from '~/components/layout/Paragraph'
import Row from '~/components/layout/Row' import Row from '~/components/layout/Row'
import GnoForm from '~/components/forms/GnoForm' import GnoForm from '~/components/forms/GnoForm'
@ -14,14 +14,9 @@ import Button from '~/components/layout/Button'
import Block from '~/components/layout/Block' import Block from '~/components/layout/Block'
import Hairline from '~/components/layout/Hairline' import Hairline from '~/components/layout/Hairline'
import Field from '~/components/forms/Field' import Field from '~/components/forms/Field'
import TextField from '~/components/forms/TextField'
import type { Owner } from '~/routes/safe/store/models/owner' import type { Owner } from '~/routes/safe/store/models/owner'
import { import {
composeValidators, composeValidators, required, minValue, maxValue, mustBeInteger,
required,
minValue,
maxValue,
mustBeInteger,
} from '~/components/forms/validator' } from '~/components/forms/validator'
import { styles } from './style' import { styles } from './style'
@ -35,12 +30,7 @@ type Props = {
} }
const ThresholdForm = ({ const ThresholdForm = ({
classes, classes, onClose, owners, threshold, onClickBack, onSubmit,
onClose,
owners,
threshold,
onClickBack,
onSubmit,
}: Props) => { }: Props) => {
const handleSubmit = (values) => { const handleSubmit = (values) => {
onSubmit(values) onSubmit(values)
@ -59,9 +49,8 @@ const ThresholdForm = ({
</IconButton> </IconButton>
</Row> </Row>
<Hairline /> <Hairline />
<GnoForm onSubmit={handleSubmit} initialValues={{threshold: defaultThreshold.toString()}}> <GnoForm onSubmit={handleSubmit} initialValues={{ threshold: defaultThreshold.toString() }}>
{(...args) => { {() => {
const formState = args[2]
const numOptions = owners.size > 1 ? owners.size - 1 : 1 const numOptions = owners.size > 1 ? owners.size - 1 : 1
return ( return (
@ -80,7 +69,7 @@ const ThresholdForm = ({
<Row margin="xl" align="center" className={classes.inputRow}> <Row margin="xl" align="center" className={classes.inputRow}>
<Col xs={2}> <Col xs={2}>
<Field <Field
name={"threshold"} name="threshold"
render={props => ( render={props => (
<React.Fragment> <React.Fragment>
<SelectField {...props} disableError> <SelectField {...props} disableError>
@ -107,7 +96,7 @@ const ThresholdForm = ({
{' '} {' '}
{owners.size - 1} {owners.size - 1}
{' '} {' '}
owner(s) owner(s)
</Paragraph> </Paragraph>
</Col> </Col>
</Row> </Row>