diff --git a/src/routes/safe/components/Balances/SendModal/index.jsx b/src/routes/safe/components/Balances/SendModal/index.jsx index a8b906cc..48c5dc1c 100644 --- a/src/routes/safe/components/Balances/SendModal/index.jsx +++ b/src/routes/safe/components/Balances/SendModal/index.jsx @@ -7,6 +7,7 @@ import { withStyles } from '@material-ui/core/styles' import Modal from '~/components/Modal' import ChooseTxType from './screens/ChooseTxType' import SendFunds from './screens/SendFunds' +import ReviewTx from './screens/ReviewTx' type Props = { onClose: () => void, @@ -19,7 +20,15 @@ type Props = { tokens: List, selectedToken: string, } -type ActiveScreen = 'chooseTxType' | 'sendFunds' +type ActiveScreen = 'chooseTxType' | 'sendFunds' | 'reviewTx' + +type TxStateType = + | { + token: Token, + recipientAddress: string, + amount: string, + } + | Object const styles = () => ({ smallerModalWindow: { @@ -29,10 +38,23 @@ const styles = () => ({ }) const Send = ({ - onClose, isOpen, classes, safeAddress, etherScanLink, safeName, ethBalance, tokens, selectedToken, + onClose, + isOpen, + classes, + safeAddress, + etherScanLink, + safeName, + ethBalance, + tokens, + selectedToken, }: Props) => { const [activeScreen, setActiveScreen] = useState('sendFunds') + const [tx, setTx] = useState({}) const smallerModalSize = activeScreen === 'chooseTxType' + const handleTxCreation = (txInfo) => { + setActiveScreen('reviewTx') + setTx(txInfo) + } // Uncomment when we add custom txs // useEffect( @@ -62,8 +84,10 @@ const Send = ({ ethBalance={ethBalance} tokens={tokens} selectedToken={selectedToken} + onSubmit={handleTxCreation} /> )} + {activeScreen === 'reviewTx' && } ) diff --git a/src/routes/safe/components/Balances/SendModal/screens/ReviewTx/index.jsx b/src/routes/safe/components/Balances/SendModal/screens/ReviewTx/index.jsx new file mode 100644 index 00000000..cc5000f6 --- /dev/null +++ b/src/routes/safe/components/Balances/SendModal/screens/ReviewTx/index.jsx @@ -0,0 +1,12 @@ +// @flow +import React from 'react' + +const ReviewTx = () => { + return ( +
+ YO! Wanna review tx? +
+ ) +} + +export default ReviewTx 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 56b4a488..1138664e 100644 --- a/src/routes/safe/components/Balances/SendModal/screens/SendFunds/index.jsx +++ b/src/routes/safe/components/Balances/SendModal/screens/SendFunds/index.jsx @@ -39,6 +39,7 @@ type Props = { ethBalance: string, selectedToken: string, tokens: List, + onSubmit: Function, } const SendFunds = ({ @@ -50,10 +51,12 @@ const SendFunds = ({ ethBalance, tokens, selectedToken, + onSubmit, }: Props) => { const handleSubmit = (values) => { - console.log(values) + onSubmit(values) } + const formMutators = { setMax: (args, state, utils) => { const { token } = state.formState.values