diff --git a/src/routes/safe/components/Settings/ManageOwners/RemoveOwnerModal/index.jsx b/src/routes/safe/components/Settings/ManageOwners/RemoveOwnerModal/index.jsx index a0481a76..ba6b16e8 100644 --- a/src/routes/safe/components/Settings/ManageOwners/RemoveOwnerModal/index.jsx +++ b/src/routes/safe/components/Settings/ManageOwners/RemoveOwnerModal/index.jsx @@ -1,16 +1,15 @@ // @flow import React, { useState, useEffect } from 'react' import { List } from 'immutable' +import { withStyles } from '@material-ui/core/styles' import { SharedSnackbarConsumer } from '~/components/SharedSnackBar' import Modal from '~/components/Modal' -import { type Safe } from '~/routes/safe/store/models/safe' import { type Owner } from '~/routes/safe/store/models/owner' import { setOwners } from '~/logic/safe/utils' import { getGnosisSafeInstanceAt } from '~/logic/contracts/safeContracts' import CheckOwner from './screens/CheckOwner' import ThresholdForm from './screens/ThresholdForm' import ReviewRemoveOwner from './screens/Review' -import { withStyles } from '@material-ui/core/styles' const styles = () => ({ biggerModalWindow: { @@ -31,7 +30,6 @@ type Props = { owners: List, threshold: number, network: string, - userAddress: string, createTransaction: Function, } type ActiveScreen = 'checkOwner' | 'selectThreshold' | 'reviewRemoveOwner' @@ -51,8 +49,10 @@ export const sendRemoveOwner = async ( const storedOwners = await gnosisSafe.getOwners() const index = storedOwners.findIndex(ownerAddress => ownerAddress === ownerAddressToRemove) const prevAddress = index === 0 ? SENTINEL_ADDRESS : storedOwners[index - 1] - const txData = gnosisSafe.contract.methods.removeOwner(prevAddress, ownerAddressToRemove, values.threshold).encodeABI() - const text = `Remove Owner ${ownerNameToRemove} (${ownerAddressToRemove})` + const txData = gnosisSafe.contract.methods + .removeOwner(prevAddress, ownerAddressToRemove, values.threshold) + .encodeABI() + // const text = `Remove Owner ${ownerNameToRemove} (${ownerAddressToRemove})` const txHash = createTransaction(safeAddress, safeAddress, 0, txData, openSnackbar) if (txHash) { @@ -71,7 +71,6 @@ const RemoveOwner = ({ owners, threshold, network, - userAddress, createTransaction, }: Props) => { const [activeScreen, setActiveScreen] = useState('checkOwner') @@ -93,7 +92,7 @@ const RemoveOwner = ({ } } - const ownerSubmitted = (newValues: Object) => { + const ownerSubmitted = () => { setActiveScreen('selectThreshold') } diff --git a/src/routes/safe/components/Settings/ManageOwners/RemoveOwnerModal/screens/CheckOwner/index.jsx b/src/routes/safe/components/Settings/ManageOwners/RemoveOwnerModal/screens/CheckOwner/index.jsx index f9420fe7..636db589 100644 --- a/src/routes/safe/components/Settings/ManageOwners/RemoveOwnerModal/screens/CheckOwner/index.jsx +++ b/src/routes/safe/components/Settings/ManageOwners/RemoveOwnerModal/screens/CheckOwner/index.jsx @@ -4,16 +4,15 @@ import classNames from 'classnames/bind' import { withStyles } from '@material-ui/core/styles' import Close from '@material-ui/icons/Close' import IconButton from '@material-ui/core/IconButton' +import OpenInNew from '@material-ui/icons/OpenInNew' import Paragraph from '~/components/layout/Paragraph' import Row from '~/components/layout/Row' -import GnoForm from '~/components/forms/GnoForm' import Col from '~/components/layout/Col' import Button from '~/components/layout/Button' import Block from '~/components/layout/Block' import Hairline from '~/components/layout/Hairline' import Link from '~/components/layout/Link' import Identicon from '~/components/Identicon' -import OpenInNew from '@material-ui/icons/OpenInNew' import { getEtherScanLink } from '~/logic/wallets/getWeb3' import { styles } from './style' import { secondary } from '~/theme/variables' @@ -94,7 +93,7 @@ const CheckOwner = ({ variant="contained" minWidth={140} color="primary" - data-testid="review-tx-btn" + onClick={handleSubmit} > Next diff --git a/src/routes/safe/components/Settings/ManageOwners/ReplaceOwnerModal/screens/OwnerForm/index.jsx b/src/routes/safe/components/Settings/ManageOwners/ReplaceOwnerModal/screens/OwnerForm/index.jsx index beefc586..161c99be 100644 --- a/src/routes/safe/components/Settings/ManageOwners/ReplaceOwnerModal/screens/OwnerForm/index.jsx +++ b/src/routes/safe/components/Settings/ManageOwners/ReplaceOwnerModal/screens/OwnerForm/index.jsx @@ -4,6 +4,7 @@ import classNames from 'classnames/bind' import { withStyles } from '@material-ui/core/styles' import Close from '@material-ui/icons/Close' import IconButton from '@material-ui/core/IconButton' +import OpenInNew from '@material-ui/icons/OpenInNew' import Paragraph from '~/components/layout/Paragraph' import Row from '~/components/layout/Row' import GnoForm from '~/components/forms/GnoForm' @@ -15,13 +16,9 @@ import Field from '~/components/forms/Field' import TextField from '~/components/forms/TextField' import Identicon from '~/components/Identicon' import Link from '~/components/layout/Link' -import OpenInNew from '@material-ui/icons/OpenInNew' import { getEtherScanLink } from '~/logic/wallets/getWeb3' import { - composeValidators, - required, - mustBeEthereumAddress, - minMaxLength, + composeValidators, required, mustBeEthereumAddress, minMaxLength, } from '~/components/forms/validator' import { styles } from './style' import { secondary } from '~/theme/variables' @@ -41,12 +38,7 @@ type Props = { } const OwnerForm = ({ - classes, - onClose, - ownerAddress, - ownerName, - network, - onSubmit, + classes, onClose, ownerAddress, ownerName, network, onSubmit, }: Props) => { const handleSubmit = (values) => { onSubmit(values) @@ -65,93 +57,86 @@ const OwnerForm = ({ - {(...args) => { - const formState = args[2] - - return ( - - - - - Review the owner you want to replace from the active Safe. Then specify the new owner you want to replace it with: - - - - - Current owner - - - - - - - - - - {ownerName} - - - - {ownerAddress} - - - - - - - - - - - New owner - - - - - - - - - - - - - - - - - + {() => ( + + + + + Review the owner you want to replace from the active Safe. Then specify the new owner you want to + replace it with: + - - ) - }} + + Current owner + + + + + + + + + {ownerName} + + + + {ownerAddress} + + + + + + + + + + New owner + + + + + + + + + + + + + + + + + + + )} ) diff --git a/src/routes/safe/components/Settings/ManageOwners/style.js b/src/routes/safe/components/Settings/ManageOwners/style.js index 7ea08992..a0be24f6 100644 --- a/src/routes/safe/components/Settings/ManageOwners/style.js +++ b/src/routes/safe/components/Settings/ManageOwners/style.js @@ -16,9 +16,6 @@ export const styles = () => ({ '&:hover $actions': { visibility: 'initial', }, - '&:focus $actions': { - visibility: 'initial', - }, }, actions: { justifyContent: 'flex-end',