From 051f26aa765f1b3375295821a153ef65790d581c Mon Sep 17 00:00:00 2001 From: mmv Date: Fri, 24 May 2019 14:08:33 +0400 Subject: [PATCH] finish the ui for sending tokens --- src/components/layout/Hairline/index.js | 8 +++--- .../components/Balances/SendModal/index.jsx | 4 +++ .../SendModal/screens/ReviewTx/index.jsx | 26 +++++++++++++++---- .../SendModal/screens/ReviewTx/style.js | 3 +++ .../SendModal/screens/SendFunds/index.jsx | 4 ++- 5 files changed, 36 insertions(+), 9 deletions(-) diff --git a/src/components/layout/Hairline/index.js b/src/components/layout/Hairline/index.js index eab56457..b23445d8 100644 --- a/src/components/layout/Hairline/index.js +++ b/src/components/layout/Hairline/index.js @@ -14,12 +14,14 @@ const calculateStyleFrom = (color?: string, margin?: Size) => ({ type Props = { margin?: Size, color?: string, + style?: Object } -const Hairline = ({ margin, color }: Props) => { - const style = calculateStyleFrom(color, margin) +const Hairline = ({ margin, color, style }: Props) => { + const calculatedStyles = calculateStyleFrom(color, margin) + const mergedStyles = { ...calculatedStyles, ...(style || {}) } - return
+ return
} export default Hairline diff --git a/src/routes/safe/components/Balances/SendModal/index.jsx b/src/routes/safe/components/Balances/SendModal/index.jsx index 2b105540..8282b1cd 100644 --- a/src/routes/safe/components/Balances/SendModal/index.jsx +++ b/src/routes/safe/components/Balances/SendModal/index.jsx @@ -55,10 +55,12 @@ const Send = ({ setActiveScreen('reviewTx') setTx(txInfo) } + const onClickBack = () => setActiveScreen('sendFunds') useEffect( () => () => { setActiveScreen('sendFunds') + setTx({}) }, [isOpen], ) @@ -84,6 +86,7 @@ const Send = ({ tokens={tokens} selectedToken={selectedToken} onSubmit={handleTxCreation} + initialValues={tx} /> )} {activeScreen === 'reviewTx' && ( @@ -94,6 +97,7 @@ const Send = ({ etherScanLink={etherScanLink} safeName={safeName} ethBalance={ethBalance} + onClickBack={onClickBack} /> )} diff --git a/src/routes/safe/components/Balances/SendModal/screens/ReviewTx/index.jsx b/src/routes/safe/components/Balances/SendModal/screens/ReviewTx/index.jsx index 5be5096c..aa5f1c55 100644 --- a/src/routes/safe/components/Balances/SendModal/screens/ReviewTx/index.jsx +++ b/src/routes/safe/components/Balances/SendModal/screens/ReviewTx/index.jsx @@ -9,11 +9,13 @@ import Row from '~/components/layout/Row' import Link from '~/components/layout/Link' import Col from '~/components/layout/Col' import Button from '~/components/layout/Button' +import Img from '~/components/layout/Img' import Block from '~/components/layout/Block' import Identicon from '~/components/Identicon' import { copyToClipboard } from '~/utils/clipboard' import Hairline from '~/components/layout/Hairline' import SafeInfo from '~/routes/safe/components/Balances/SendModal/SafeInfo' +import { setImageToPlaceholder } from '~/routes/safe/components/Balances/utils' import ArrowDown from '../assets/arrow-down.svg' import { secondary } from '~/theme/variables' import { styles } from './style' @@ -24,6 +26,7 @@ type Props = { safeAddress: string, etherScanLink: string, safeName: string, + onClickBack: Function, ethBalance: string, tx: Object, } @@ -34,7 +37,7 @@ const openIconStyle = { } const ReviewTx = ({ - onClose, classes, safeAddress, etherScanLink, safeName, ethBalance, tx, + onClose, classes, safeAddress, etherScanLink, safeName, ethBalance, tx, onClickBack, }: Props) => ( @@ -62,7 +65,7 @@ const ReviewTx = ({ Recipient - + @@ -75,11 +78,24 @@ const ReviewTx = ({ + + + Amount + + + + {tx.token.name} + + {tx.amount} + {' '} + {tx.token.symbol} + + - + -