From b064b0fa9f9796351cee8c8b249cbf84fc1f0e58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Germ=C3=A1n=20Mart=C3=ADnez?= Date: Wed, 3 Jul 2019 18:33:05 +0200 Subject: [PATCH] Show owner list when current address in not an owner --- .../Settings/ManageOwners/index.jsx | 96 +++++++++++-------- .../components/Settings/ManageOwners/style.js | 4 - src/routes/safe/components/Settings/index.jsx | 22 ++--- 3 files changed, 63 insertions(+), 59 deletions(-) diff --git a/src/routes/safe/components/Settings/ManageOwners/index.jsx b/src/routes/safe/components/Settings/ManageOwners/index.jsx index 9873e76c..b10327d0 100644 --- a/src/routes/safe/components/Settings/ManageOwners/index.jsx +++ b/src/routes/safe/components/Settings/ManageOwners/index.jsx @@ -9,7 +9,7 @@ import Col from '~/components/layout/Col' import Table from '~/components/Table' import { type Column, cellWidth } from '~/components/Table/TableHead' import Row from '~/components/layout/Row' -import Paragraph from '~/components/layout/Paragraph' +import Heading from '~/components/layout/Heading' import Hairline from '~/components/layout/Hairline' import Button from '~/components/layout/Button' import Img from '~/components/layout/Img' @@ -22,7 +22,7 @@ import type { Owner } from '~/routes/safe/store/models/owner' import { getOwnerData, generateColumns, OWNERS_TABLE_NAME_ID, OWNERS_TABLE_ADDRESS_ID, type OwnerRow, } from './dataFetcher' -import { sm, boldFont } from '~/theme/variables' +import { lg, sm, boldFont } from '~/theme/variables' import { styles } from './style' import ReplaceOwnerIcon from './assets/icons/replace-owner.svg' import RenameOwnerIcon from './assets/icons/rename-owner.svg' @@ -43,6 +43,10 @@ const addOwnerButtonStyle = { fontWeight: boldFont, } +const title = { + padding: lg, +} + type Props = { classes: Object, safeAddress: string, @@ -53,6 +57,7 @@ type Props = { userAddress: string, createTransaction: Function, updateSafe: Function, + granted: boolean, } type State = { @@ -103,6 +108,7 @@ class ManageOwners extends React.Component { userAddress, createTransaction, updateSafe, + granted, } = this.props const { showAddOwner, @@ -120,9 +126,7 @@ class ManageOwners extends React.Component { return ( - - Manage Safe Owners - + Manage Safe Owners { ))} - - Edit owner - Replace owner - Remove owner - + {granted && ( + + Edit owner + Replace owner + {ownerData.size > 1 && ( + Remove owner + )} + + )} )) }
- - - - - - + {granted && ( + + + + + + + + + )} ({ - title: { - padding: `${lg} 20px`, - fontSize: '16px', - }, formContainer: { minHeight: '369px', }, diff --git a/src/routes/safe/components/Settings/index.jsx b/src/routes/safe/components/Settings/index.jsx index 80e0f342..30358896 100644 --- a/src/routes/safe/components/Settings/index.jsx +++ b/src/routes/safe/components/Settings/index.jsx @@ -20,8 +20,6 @@ import actions, { type Actions } from './actions' import { styles } from './style' import RemoveSafeIcon from './assets/icons/bin.svg' -export const OWNERS_SETTINGS_TAB_TEST_ID = 'owner-settings-tab' - type State = { showRemoveSafe: boolean, menuOptionIndex: number, @@ -111,18 +109,15 @@ class Settings extends React.Component { Safe name + + Owners ({owners.size}) + + {granted && ( - - Owners ( - {owners.size} -) - - { {menuOptionIndex === 1 && ( )} - {granted && menuOptionIndex === 2 && ( + {menuOptionIndex === 2 && ( { createTransaction={createTransaction} userAddress={userAddress} updateSafe={updateSafe} + granted={granted} /> )} {granted && menuOptionIndex === 3 && (