From 3fbf63e257501b505bdbdf5c094d6cc648ac38bc Mon Sep 17 00:00:00 2001 From: apanizo Date: Tue, 3 Jul 2018 13:21:14 +0200 Subject: [PATCH] WA-232 Adding button to move funds in Safe's BalanceInfo component --- src/routes/safe/component/Safe/BalanceInfo.jsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/routes/safe/component/Safe/BalanceInfo.jsx b/src/routes/safe/component/Safe/BalanceInfo.jsx index db679d89..7073f2d4 100644 --- a/src/routes/safe/component/Safe/BalanceInfo.jsx +++ b/src/routes/safe/component/Safe/BalanceInfo.jsx @@ -13,12 +13,14 @@ import { withStyles } from '@material-ui/core/styles' import ExpandLess from '@material-ui/icons/ExpandLess' import ExpandMore from '@material-ui/icons/ExpandMore' import { Map } from 'immutable' +import Button from '~/components/layout/Button' import openHoc, { type Open } from '~/components/hoc/OpenHoc' import { type WithStyles } from '~/theme/mui' import { type Balance } from '~/routes/safe/store/model/balance' type Props = Open & WithStyles & { balances: Map, + onMoveFunds: (balance: Balance) => void, } const styles = { @@ -27,8 +29,10 @@ const styles = { }, } +export const MOVE_FUNDS_BUTTON_TEXT = 'Move Funds' + const BalanceComponent = openHoc(({ - open, toggle, balances, classes, + open, toggle, balances, classes, onMoveFunds, }: Props) => ( @@ -48,6 +52,8 @@ const BalanceComponent = openHoc(({ {balances.valueSeq().map((balance: Balance) => { const symbol = balance.get('symbol') const name = balance.get('name') + const disabled = Number(balance.get('funds')) === 0 + const onMoveFundsClick = () => onMoveFunds(balance) return ( @@ -55,6 +61,9 @@ const BalanceComponent = openHoc(({ {name} + ) })}