From 88795cf890db18bd2a49460807f2b29cbc9e9ef2 Mon Sep 17 00:00:00 2001 From: apanizo Date: Mon, 7 May 2018 15:50:52 +0200 Subject: [PATCH] WA-238 Logic for showing Withdrawn form after clicking on Safe's button --- src/routes/safe/component/Safe/DailyLimit.jsx | 11 +++++++- src/routes/safe/component/Safe/index.jsx | 27 ++++++++++++++----- src/routes/safe/component/Withdrawn/index.jsx | 10 +++++++ 3 files changed, 41 insertions(+), 7 deletions(-) create mode 100644 src/routes/safe/component/Withdrawn/index.jsx diff --git a/src/routes/safe/component/Safe/DailyLimit.jsx b/src/routes/safe/component/Safe/DailyLimit.jsx index 20bd47c7..1ea68679 100644 --- a/src/routes/safe/component/Safe/DailyLimit.jsx +++ b/src/routes/safe/component/Safe/DailyLimit.jsx @@ -3,18 +3,27 @@ import * as React from 'react' import { ListItem } from 'material-ui/List' import Avatar from 'material-ui/Avatar' import NotificationsPaused from 'material-ui-icons/NotificationsPaused' +import Button from '~/components/layout/Button' import ListItemText from '~/components/List/ListItemText' type Props = { limit: number, + onWithdrawn: () => void, } -const DailyLimit = ({ limit }: Props) => ( +const DailyLimit = ({ limit, onWithdrawn }: Props) => ( + ) diff --git a/src/routes/safe/component/Safe/index.jsx b/src/routes/safe/component/Safe/index.jsx index 9ec0726a..b1f3034e 100644 --- a/src/routes/safe/component/Safe/index.jsx +++ b/src/routes/safe/component/Safe/index.jsx @@ -9,6 +9,8 @@ import Row from '~/components/layout/Row' import { type Safe } from '~/routes/safe/store/model/safe' import List from 'material-ui/List' +import Withdrawn from '~/routes/safe/component/Withdrawn' + import Address from './Address' import Balance from './Balance' import Owners from './Owners' @@ -22,33 +24,46 @@ type SafeProps = { balance: string, } +type State = { + component: React$Node, +} + const listStyle = { width: '100%', } -class GnoSafe extends React.PureComponent { +class GnoSafe extends React.PureComponent { + state = { + component: undefined, + } + + onWithdrawn = () => { + this.setState({ component: }) + } + render() { const { safe, balance } = this.props + const { component } = this.state return ( - +
- + - + {safe.name.toUpperCase()} - - Safe Icon + + { component || Safe Icon } diff --git a/src/routes/safe/component/Withdrawn/index.jsx b/src/routes/safe/component/Withdrawn/index.jsx new file mode 100644 index 00000000..7037e5ad --- /dev/null +++ b/src/routes/safe/component/Withdrawn/index.jsx @@ -0,0 +1,10 @@ +// @flow +import * as React from 'react' + +const Withdrawn = () => ( +
+ Withdrawn form +
+) + +export default Withdrawn