diff --git a/src/routes/safe/component/Safe/index.jsx b/src/routes/safe/component/Safe/index.jsx index b1f3034e..795ed1b1 100644 --- a/src/routes/safe/component/Safe/index.jsx +++ b/src/routes/safe/component/Safe/index.jsx @@ -38,7 +38,9 @@ class GnoSafe extends React.PureComponent { } onWithdrawn = () => { - this.setState({ component: }) + const { safe } = this.props + + this.setState({ component: }) } render() { @@ -47,7 +49,7 @@ class GnoSafe extends React.PureComponent { return ( - + @@ -56,7 +58,7 @@ class GnoSafe extends React.PureComponent { - + {safe.name.toUpperCase()} @@ -71,8 +73,4 @@ class GnoSafe extends React.PureComponent { } } -/* - - {safe.name.toUpperCase()} -*/ export default GnoSafe diff --git a/src/routes/safe/component/Withdrawn/index.jsx b/src/routes/safe/component/Withdrawn/index.jsx index 7037e5ad..8c213f87 100644 --- a/src/routes/safe/component/Withdrawn/index.jsx +++ b/src/routes/safe/component/Withdrawn/index.jsx @@ -1,10 +1,66 @@ // @flow import * as React from 'react' +import { connect } from 'react-redux' +import Stepper from '~/components/Stepper' +import { TXS_ADDRESS } from '~/routes/routes' +import selector, { type SelectorProps } from './selector' +import withdrawn from './withdrawn' +import WithdrawnForm from './WithdrawnForm' +import Review from './Review' -const Withdrawn = () => ( -
- Withdrawn form -
-) +const getSteps = () => [ + 'Fill Withdrawn Form', 'Review Withdrawn', +] + +type Props = SelectorProps & { + safeAddress: string, +} + +type State = { + done: boolean, +} + +class Withdrawn extends React.Component { + state = { + done: false, + } + + onWithdrawn = async (values: Object) => { + try { + const { safeAddress, userAddress } = this.props + await withdrawn(values, safeAddress, userAddress) + this.setState({ done: true }) + } catch (error) { + this.setState({ done: false }) + // eslint-disable-next-line + console.log('Error while withdrawing funds ' + error) + } + } + + render() { + const { done } = this.state + const steps = getSteps() + + return ( + + + + { WithdrawnForm } + + + { Review } + + + + ) + } +} + +export default connect(selector)(Withdrawn) -export default Withdrawn