From 82e663546021c298148211b1ae608a2fecb7ef7b Mon Sep 17 00:00:00 2001 From: Travis Eden Date: Mon, 14 May 2018 12:19:07 -0400 Subject: [PATCH] disable Send button when tip amount <= 0 or tip amount > balance --- src/renderer/component/walletSendTip/index.js | 2 ++ src/renderer/component/walletSendTip/view.jsx | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/renderer/component/walletSendTip/index.js b/src/renderer/component/walletSendTip/index.js index dc304f2e7..ad1d98cb7 100644 --- a/src/renderer/component/walletSendTip/index.js +++ b/src/renderer/component/walletSendTip/index.js @@ -4,6 +4,7 @@ import { makeSelectTitleForUri, makeSelectClaimForUri, selectIsSendingSupport, + selectBalance, } from 'lbry-redux'; import WalletSendTip from './view'; @@ -11,6 +12,7 @@ const select = (state, props) => ({ isPending: selectIsSendingSupport(state), title: makeSelectTitleForUri(props.uri)(state), claim: makeSelectClaimForUri(props.uri)(state), + balance: selectBalance(state), }); const perform = dispatch => ({ diff --git a/src/renderer/component/walletSendTip/view.jsx b/src/renderer/component/walletSendTip/view.jsx index a8d10a8a5..b8dad4480 100644 --- a/src/renderer/component/walletSendTip/view.jsx +++ b/src/renderer/component/walletSendTip/view.jsx @@ -14,6 +14,7 @@ type Props = { sendSupport: (number, string, string) => void, onCancel: () => void, sendTipCallback?: () => void, + balance: number, }; type State = { @@ -51,7 +52,8 @@ class WalletSendTip extends React.PureComponent { } render() { - const { title, errorMessage, isPending, uri, onCancel } = this.props; + const { title, errorMessage, isPending, uri, onCancel, balance } = this.props; + const { amount } = this.state; return (
@@ -82,7 +84,7 @@ class WalletSendTip extends React.PureComponent {