From 4d0007b13bdf7d4e7e3e9c9a8edbc75572de4b2c Mon Sep 17 00:00:00 2001 From: Mikhail Mikheev Date: Tue, 3 Sep 2019 12:31:17 +0400 Subject: [PATCH] show confirmations(threshold) settings in RO mode --- .../Settings/ManageOwners/index.jsx | 41 ++++++++++------- .../Settings/ThresholdSettings/index.jsx | 11 ++--- src/routes/safe/components/Settings/index.jsx | 44 +++++++++---------- 3 files changed, 53 insertions(+), 43 deletions(-) diff --git a/src/routes/safe/components/Settings/ManageOwners/index.jsx b/src/routes/safe/components/Settings/ManageOwners/index.jsx index bc912b8d..5929be61 100644 --- a/src/routes/safe/components/Settings/ManageOwners/index.jsx +++ b/src/routes/safe/components/Settings/ManageOwners/index.jsx @@ -20,7 +20,11 @@ import EditOwnerModal from './EditOwnerModal' import OwnerAddressTableCell from './OwnerAddressTableCell' import type { Owner } from '~/routes/safe/store/models/owner' import { - getOwnerData, generateColumns, OWNERS_TABLE_NAME_ID, OWNERS_TABLE_ADDRESS_ID, type OwnerRow, + getOwnerData, + generateColumns, + OWNERS_TABLE_NAME_ID, + OWNERS_TABLE_ADDRESS_ID, + type OwnerRow, } from './dataFetcher' import { lg, sm, boldFont } from '~/theme/variables' import { styles } from './style' @@ -76,13 +80,17 @@ type State = { type Action = 'AddOwner' | 'EditOwner' | 'ReplaceOwner' | 'RemoveOwner' class ManageOwners extends React.Component { - state = { - selectedOwnerAddress: undefined, - selectedOwnerName: undefined, - showAddOwner: false, - showRemoveOwner: false, - showReplaceOwner: false, - showEditOwner: false, + constructor(props) { + super(props) + + this.state = { + selectedOwnerAddress: undefined, + selectedOwnerName: undefined, + showAddOwner: false, + showRemoveOwner: false, + showReplaceOwner: false, + showEditOwner: false, + } } onShow = (action: Action, row?: Object) => () => { @@ -127,13 +135,15 @@ class ManageOwners extends React.Component { } = this.state const columns = generateColumns() - const autoColumns = columns.filter(c => !c.custom) + const autoColumns = columns.filter((c) => !c.custom) const ownerData = getOwnerData(owners) return ( - + <> - Manage Safe Owners + + Manage Safe Owners + { )} - )) - } + ))}
{granted && ( - + <> @@ -205,7 +214,7 @@ class ManageOwners extends React.Component { - + )} { network={network} editSafeOwner={editSafeOwner} /> -
+ ) } } diff --git a/src/routes/safe/components/Settings/ThresholdSettings/index.jsx b/src/routes/safe/components/Settings/ThresholdSettings/index.jsx index 7056b33a..74c98c1d 100644 --- a/src/routes/safe/components/Settings/ThresholdSettings/index.jsx +++ b/src/routes/safe/components/Settings/ThresholdSettings/index.jsx @@ -21,19 +21,20 @@ type Props = { classes: Object, createTransaction: Function, safeAddress: string, + granted: Boolean, } const ThresholdSettings = ({ - owners, threshold, classes, createTransaction, safeAddress, + owners, threshold, classes, createTransaction, safeAddress, granted, }: Props) => { const [isModalOpen, setModalOpen] = useState(false) const toggleModal = () => { - setModalOpen(prevOpen => !prevOpen) + setModalOpen((prevOpen) => !prevOpen) } return ( - + <> {({ openSnackbar }) => { const onChangeThreshold = async (newThreshold) => { @@ -62,7 +63,7 @@ const ThresholdSettings = ({ {' '} owners - {owners.size > 1 && ( + {owners.size > 1 && granted && (