From 6fcab5ced6fbe6fb3b6a842fb6f0c1fed52bd9b1 Mon Sep 17 00:00:00 2001 From: Mikhail Mikheev Date: Mon, 17 Jun 2019 16:51:37 +0400 Subject: [PATCH] ThresholdModal wip --- .../ChangeThreshold/index.jsx | 45 +++++++++++ .../ChangeThreshold/style.js | 37 +++++++++ .../Settings/ThresholdSettings/index.jsx | 78 +++++++++++++------ .../Settings/ThresholdSettings/style.js | 4 +- 4 files changed, 139 insertions(+), 25 deletions(-) create mode 100644 src/routes/safe/components/Settings/ThresholdSettings/ChangeThreshold/index.jsx create mode 100644 src/routes/safe/components/Settings/ThresholdSettings/ChangeThreshold/style.js diff --git a/src/routes/safe/components/Settings/ThresholdSettings/ChangeThreshold/index.jsx b/src/routes/safe/components/Settings/ThresholdSettings/ChangeThreshold/index.jsx new file mode 100644 index 00000000..9c6e67b8 --- /dev/null +++ b/src/routes/safe/components/Settings/ThresholdSettings/ChangeThreshold/index.jsx @@ -0,0 +1,45 @@ +// @flow +import React from 'react' +import { List } from 'immutable' +import { withStyles } from '@material-ui/core/styles' +import Close from '@material-ui/icons/Close' +import IconButton from '@material-ui/core/IconButton' +import Hairline from '~/components/layout/Hairline' +import Paragraph from '~/components/layout/Paragraph' +import Button from '~/components/layout/Button' +import Block from '~/components/layout/Block' +import Row from '~/components/layout/Row' +import Col from '~/components/layout/Col' +import type { Owner } from '~/routes/safe/store/models/owner' +import { styles } from './style' + +type Props = { + onClose: () => void, + classes: Object, + threshold: number, + owners: List, +} + +const ChangeThreshold = ({ onClose, owners, threshold, classes, }: Props) => ( + + + + Remove owner + + + + + + + + + + + + + +) + +export default withStyles(styles)(ChangeThreshold) diff --git a/src/routes/safe/components/Settings/ThresholdSettings/ChangeThreshold/style.js b/src/routes/safe/components/Settings/ThresholdSettings/ChangeThreshold/style.js new file mode 100644 index 00000000..96e20c6b --- /dev/null +++ b/src/routes/safe/components/Settings/ThresholdSettings/ChangeThreshold/style.js @@ -0,0 +1,37 @@ +// @flow +import { lg, md, sm } from '~/theme/variables' + +export const styles = () => ({ + heading: { + padding: `${sm} ${lg}`, + justifyContent: 'flex-start', + boxSizing: 'border-box', + maxHeight: '75px', + }, + annotation: { + letterSpacing: '-1px', + color: '#a2a8ba', + marginRight: 'auto', + marginLeft: '20px', + }, + headingText: { + fontSize: '24px', + }, + closeIcon: { + height: '35px', + width: '35px', + }, + container: { + padding: `${md} ${lg}`, + }, + amount: { + marginLeft: sm, + }, + buttonRow: { + height: '84px', + justifyContent: 'center', + position: 'absolute', + bottom: 0, + width: '100%', + }, +}) diff --git a/src/routes/safe/components/Settings/ThresholdSettings/index.jsx b/src/routes/safe/components/Settings/ThresholdSettings/index.jsx index 4b03d8a5..d6cd64a4 100644 --- a/src/routes/safe/components/Settings/ThresholdSettings/index.jsx +++ b/src/routes/safe/components/Settings/ThresholdSettings/index.jsx @@ -1,43 +1,73 @@ // @flow -import React from 'react' +import React, { useState } from 'react' import { withStyles } from '@material-ui/core/styles' +import { List } from 'immutable' import Heading from '~/components/layout/Heading' import Button from '~/components/layout/Button' import Bold from '~/components/layout/Bold' import Block from '~/components/layout/Block' import Row from '~/components/layout/Row' -import Paragraph from '~/components/layout/Paragraph/index' +import Modal from '~/components/Modal' +import Paragraph from '~/components/layout/Paragraph' +import ChangeThreshold from './ChangeThreshold' +import type { Owner } from '~/routes/safe/store/models/owner' import { styles } from './style' type Props = { - owners: any, + owners: List, threshold: number, classes: Object, } -const ThresholdSettings = ({ owners, threshold, classes }: Props) => ( - - Required confirmations - - Any transaction over any daily limit -
- {' '} +const ThresholdSettings = ({ owners, threshold, classes }: Props) => { + const [isModalOpen, setModalOpen] = useState(false) + + const toggleModal = () => { + setModalOpen(prevOpen => !prevOpen) + } + + return ( + + + Required confirmations + + Any transaction over any daily limit +
+ {' '} requires the confirmation of: -
- - {threshold} - {' '} + + + {threshold} + {' '} out of - {owners.size} - {' '} + {owners.size} + {' '} owners - - - - -
-) +
+ + + +
+ + + + + ) +} export default withStyles(styles)(ThresholdSettings) diff --git a/src/routes/safe/components/Settings/ThresholdSettings/style.js b/src/routes/safe/components/Settings/ThresholdSettings/style.js index fe909dbf..350e71ac 100644 --- a/src/routes/safe/components/Settings/ThresholdSettings/style.js +++ b/src/routes/safe/components/Settings/ThresholdSettings/style.js @@ -1,5 +1,7 @@ // @flow -import { fontColor, lg, smallFontSize, md } from '~/theme/variables' +import { + fontColor, lg, smallFontSize, md, +} from '~/theme/variables' export const styles = () => ({ ownersText: {