From 20d038ebfac5cdfae3407adec8171abbe91072d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Germ=C3=A1n=20Mart=C3=ADnez?= Date: Mon, 27 May 2019 14:59:04 +0200 Subject: [PATCH] Improve Safe settings styles --- src/components/Footer/index.scss | 1 + .../Settings/ManageOwners/dataFetcher.js | 2 - .../Settings/ManageOwners/index.jsx | 49 +++++++++++-------- .../components/Settings/ManageOwners/style.js | 11 +++++ src/routes/safe/components/Settings/index.jsx | 8 ++- src/routes/safe/components/Settings/style.js | 10 ++++ 6 files changed, 56 insertions(+), 25 deletions(-) diff --git a/src/components/Footer/index.scss b/src/components/Footer/index.scss index 91887ad4..0f3b3eba 100644 --- a/src/components/Footer/index.scss +++ b/src/components/Footer/index.scss @@ -7,6 +7,7 @@ align-items: center; border: solid 0.5px $border; background-color: white; + margin-top: 50px; } @media only screen and (max-width: $(screenXs)px) { diff --git a/src/routes/safe/components/Settings/ManageOwners/dataFetcher.js b/src/routes/safe/components/Settings/ManageOwners/dataFetcher.js index 5d5d2111..f66e4489 100644 --- a/src/routes/safe/components/Settings/ManageOwners/dataFetcher.js +++ b/src/routes/safe/components/Settings/ManageOwners/dataFetcher.js @@ -40,7 +40,6 @@ export const generateColumns = () => { order: false, disablePadding: false, label: 'Address', - width: 350, custom: false, align: 'left', } @@ -50,7 +49,6 @@ export const generateColumns = () => { order: false, disablePadding: false, label: '', - align: 'right', custom: true, } diff --git a/src/routes/safe/components/Settings/ManageOwners/index.jsx b/src/routes/safe/components/Settings/ManageOwners/index.jsx index cbf8ca68..19b4fa96 100644 --- a/src/routes/safe/components/Settings/ManageOwners/index.jsx +++ b/src/routes/safe/components/Settings/ManageOwners/index.jsx @@ -27,6 +27,9 @@ import { } from './dataFetcher' import { 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' +import RemoveOwnerIcon from '../assets/icons/bin.svg' const controlsStyle = { backgroundColor: 'white', @@ -52,15 +55,26 @@ type Action = 'AddOwner' | 'EditOwner' | 'ReplaceOwner' | 'RemoveOwner' class ManageOwners extends React.Component { state = { + selectedOwnerAddress: undefined, + selectedOwnerName: undefined, showAddOwner: false, + showRemoveOwner: false, } - onShow = (action: Action) => () => { - this.setState(() => ({ [`show${action}`]: true })) + onShow = (action: Action, row?: Object) => () => { + this.setState({ + [`show${action}`]: true, + selectedOwnerAddress: row && row.address, + selectedOwnerName: row && row.name, + }) } onHide = (action: Action) => () => { - this.setState(() => ({ [`show${action}`]: false })) + this.setState({ + [`show${action}`]: false, + selectedOwnerAddress: undefined, + selectedOwnerName: undefined, + }) } render() { @@ -74,9 +88,15 @@ class ManageOwners extends React.Component { userAddress, createTransaction, } = this.props - const { showAddOwner } = this.state + const { + showAddOwner, + showRemoveOwner, + selectedOwnerName, + selectedOwnerAddress + } = this.state const columns = generateColumns() + const autoColumns = columns.filter(c => !c.custom) const ownerData = getOwnerData(owners) return ( @@ -85,7 +105,6 @@ class ManageOwners extends React.Component { Manage Safe Owners - { > {(sortedData: Array) => sortedData.map((row: any, index: number) => ( - {columns.map((column: Column) => ( + {autoColumns.map((column: Column) => ( {column.id === OWNERS_TABLE_ADDRESS_ID ? : row[column.id]} ))} - - - + + + diff --git a/src/routes/safe/components/Settings/ManageOwners/style.js b/src/routes/safe/components/Settings/ManageOwners/style.js index 9b02b06e..32a6c455 100644 --- a/src/routes/safe/components/Settings/ManageOwners/style.js +++ b/src/routes/safe/components/Settings/ManageOwners/style.js @@ -26,4 +26,15 @@ export const styles = () => ({ justifyContent: 'flex-end', visibility: 'hidden', }, + editOwnerIcon: { + cursor: 'pointer', + }, + replaceOwnerIcon: { + marginLeft: lg, + cursor: 'pointer', + }, + removeOwnerIcon: { + marginLeft: lg, + cursor: 'pointer', + }, }) diff --git a/src/routes/safe/components/Settings/index.jsx b/src/routes/safe/components/Settings/index.jsx index eaa6a9cf..ecd84df0 100644 --- a/src/routes/safe/components/Settings/index.jsx +++ b/src/routes/safe/components/Settings/index.jsx @@ -16,6 +16,7 @@ import UpdateSafeName from './UpdateSafeName' import ManageOwners from './ManageOwners' import actions, { type Actions } from './actions' import { styles } from './style' +import RemoveSafeIcon from './assets/icons/bin.svg' type State = { showRemoveSafe: boolean, @@ -80,8 +81,11 @@ class Settings extends React.Component { - - Remove Safe + + + Remove Safe + + ({ cursor: 'pointer', }, }, + removeSafeText: { + height: '16px', + lineHeight: '16px', + paddingRight: sm, + float: 'left', + }, + removeSafeIcon: { + height: '16px', + cursor: 'pointer', + }, })