From 1d25492e68a1c20dde67840e40fbe1df2930a261 Mon Sep 17 00:00:00 2001 From: mmv Date: Mon, 29 Apr 2019 19:58:47 +0400 Subject: [PATCH] send funds modal wip --- .../Balances/AssetTableCell/index.js | 5 --- .../{AssetTableCell.jsx => index.jsx} | 0 .../components/Balances/SendModal/index.jsx | 34 ++++++++++++----- .../SendModal/screens/ChooseTxType/index.jsx | 2 +- .../SendModal/screens/SendFunds/index.jsx | 37 +++++++++++++++++-- src/routes/safe/components/Balances/index.jsx | 8 +++- 6 files changed, 65 insertions(+), 21 deletions(-) delete mode 100644 src/routes/safe/components/Balances/AssetTableCell/index.js rename src/routes/safe/components/Balances/AssetTableCell/{AssetTableCell.jsx => index.jsx} (100%) diff --git a/src/routes/safe/components/Balances/AssetTableCell/index.js b/src/routes/safe/components/Balances/AssetTableCell/index.js deleted file mode 100644 index 483cf0c7..00000000 --- a/src/routes/safe/components/Balances/AssetTableCell/index.js +++ /dev/null @@ -1,5 +0,0 @@ -// @flow - -import AssetTableCell from './AssetTableCell' - -export default AssetTableCell diff --git a/src/routes/safe/components/Balances/AssetTableCell/AssetTableCell.jsx b/src/routes/safe/components/Balances/AssetTableCell/index.jsx similarity index 100% rename from src/routes/safe/components/Balances/AssetTableCell/AssetTableCell.jsx rename to src/routes/safe/components/Balances/AssetTableCell/index.jsx diff --git a/src/routes/safe/components/Balances/SendModal/index.jsx b/src/routes/safe/components/Balances/SendModal/index.jsx index edc14f24..2d48edf5 100644 --- a/src/routes/safe/components/Balances/SendModal/index.jsx +++ b/src/routes/safe/components/Balances/SendModal/index.jsx @@ -1,5 +1,5 @@ // @flow -import React, { useState, useEffect } from 'react' +import React, { useState } from 'react' import cn from 'classnames' import { withStyles } from '@material-ui/core/styles' import Modal from '~/components/Modal' @@ -10,6 +10,9 @@ type Props = { onClose: () => void, classes: Object, isOpen: boolean, + safeAddress: string, + etherScanLink: string, + safeName: string, } type ActiveScreen = 'chooseTxType' | 'sendFunds' @@ -20,16 +23,19 @@ const styles = () => ({ }, }) -const Send = ({ onClose, isOpen, classes }: Props) => { - const [activeScreen, setActiveScreen] = useState('chooseTxType') +const Send = ({ + onClose, isOpen, classes, safeAddress, etherScanLink, safeName, +}: Props) => { + const [activeScreen, setActiveScreen] = useState('sendFunds') const smallerModalSize = activeScreen === 'chooseTxType' - useEffect( - () => () => { - setActiveScreen('chooseTxType') - }, - [isOpen], - ) + // Uncomment when we add custom txs + // useEffect( + // () => () => { + // setActiveScreen('chooseTxType') + // }, + // [isOpen], + // ) return ( { > {activeScreen === 'chooseTxType' && } - {activeScreen === 'sendFunds' && } + {activeScreen === 'sendFunds' && ( + + )} ) diff --git a/src/routes/safe/components/Balances/SendModal/screens/ChooseTxType/index.jsx b/src/routes/safe/components/Balances/SendModal/screens/ChooseTxType/index.jsx index 1ab6145a..340c89aa 100644 --- a/src/routes/safe/components/Balances/SendModal/screens/ChooseTxType/index.jsx +++ b/src/routes/safe/components/Balances/SendModal/screens/ChooseTxType/index.jsx @@ -41,7 +41,7 @@ type Props = { const ChooseTxType = ({ classes, onClose, setActiveScreen }: Props) => ( - + Send diff --git a/src/routes/safe/components/Balances/SendModal/screens/SendFunds/index.jsx b/src/routes/safe/components/Balances/SendModal/screens/SendFunds/index.jsx index f0682179..eea2e15b 100644 --- a/src/routes/safe/components/Balances/SendModal/screens/SendFunds/index.jsx +++ b/src/routes/safe/components/Balances/SendModal/screens/SendFunds/index.jsx @@ -3,10 +3,16 @@ import * as React from 'react' 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 Identicon from '~/components/Identicon' import Paragraph from '~/components/layout/Paragraph' import Row from '~/components/layout/Row' +import Link from '~/components/layout/Link' +import Col from '~/components/layout/Col' +import Block from '~/components/layout/Block' import Hairline from '~/components/layout/Hairline' -import { lg, sm } from '~/theme/variables' +import { lg, sm, secondary } from '~/theme/variables' +import { copyToClipboard } from '~/utils/clipboard' const styles = () => ({ heading: { @@ -24,16 +30,25 @@ const styles = () => ({ }, }) +const openIconStyle = { + height: '16px', + color: secondary, +} + type Props = { onClose: () => void, classes: Object, - setActiveScreen: Function, + safeAddress: string, + etherScanLink: string, + safeName: string, } -const Send = ({ classes, onClose, setActiveScreen }: Props) => ( +const Send = ({ + classes, onClose, safeAddress, etherScanLink, safeName, +}: Props) => ( - + Send Funds @@ -41,6 +56,20 @@ const Send = ({ classes, onClose, setActiveScreen }: Props) => ( + + + + + + {safeName} + + {safeAddress} + + + + + + ) diff --git a/src/routes/safe/components/Balances/index.jsx b/src/routes/safe/components/Balances/index.jsx index 6797d22d..049d62ab 100644 --- a/src/routes/safe/components/Balances/index.jsx +++ b/src/routes/safe/components/Balances/index.jsx @@ -159,7 +159,13 @@ class Balances extends React.Component { )) } - +