From 7ce5d596b89aa7e3dbbf176aa8c2a46eca8c4c25 Mon Sep 17 00:00:00 2001 From: hackrush Date: Sat, 29 Jul 2017 12:20:17 +0530 Subject: [PATCH] Displays snackBar for any successful trasaction. Also, minor changes to tip form css, to increase gap between select box and tip button. --- ui/js/actions/wallet.js | 10 ++++++++-- ui/js/component/app/view.jsx | 3 --- .../modalTransactionSuccessful/index.js | 12 ----------- .../modalTransactionSuccessful/view.jsx | 20 ------------------- ui/js/component/priceForm/view.jsx | 3 ++- ui/js/component/tipLink/view.jsx | 12 +++++++++-- ui/js/constants/modal_types.js | 1 - ui/scss/component/_form-field.scss | 4 ++++ 8 files changed, 24 insertions(+), 41 deletions(-) delete mode 100644 ui/js/component/modalTransactionSuccessful/index.js delete mode 100644 ui/js/component/modalTransactionSuccessful/view.jsx diff --git a/ui/js/actions/wallet.js b/ui/js/actions/wallet.js index 3eeb3810f..565ca478d 100644 --- a/ui/js/actions/wallet.js +++ b/ui/js/actions/wallet.js @@ -5,7 +5,7 @@ import { selectDraftTransactionAmount, selectBalance, } from "selectors/wallet"; -import { doOpenModal } from "actions/app"; +import { doOpenModal, doShowSnackBar } from "actions/app"; import * as modals from "constants/modal_types"; export function doUpdateBalance(balance) { @@ -86,7 +86,13 @@ export function doSendDraftTransaction() { dispatch({ type: types.SEND_TRANSACTION_COMPLETED, }); - dispatch(doOpenModal(modals.TRANSACTION_SUCCESSFUL)); + dispatch( + doShowSnackBar({ + message: __(`You sent ${amount} LBC`), + linkText: __("History"), + linkTarget: __("/wallet"), + }) + ); } else { dispatch({ type: types.SEND_TRANSACTION_FAILED, diff --git a/ui/js/component/app/view.jsx b/ui/js/component/app/view.jsx index b2782151e..6cedc6096 100644 --- a/ui/js/component/app/view.jsx +++ b/ui/js/component/app/view.jsx @@ -8,7 +8,6 @@ import ModalInsufficientCredits from "component/modalInsufficientCredits"; import ModalUpgrade from "component/modalUpgrade"; import ModalWelcome from "component/modalWelcome"; import ModalFirstReward from "component/modalFirstReward"; -import ModalTransactionSuccessful from "component/modalTransactionSuccessful"; import ModalTransactionFailed from "component/modalTransactionFailed"; import ModalInsufficientBalance from "component/modalInsufficientBalance"; import lbry from "lbry"; @@ -81,8 +80,6 @@ class App extends React.PureComponent { {modal == modals.WELCOME && } {modal == modals.FIRST_REWARD && } {modal == modals.AUTHENTICATION_FAILURE && } - {modal == modals.TRANSACTION_SUCCESSFUL && - } {modal == modals.TRANSACTION_FAILED && } {modal == modals.INSUFFICIENT_BALANCE && } diff --git a/ui/js/component/modalTransactionSuccessful/index.js b/ui/js/component/modalTransactionSuccessful/index.js deleted file mode 100644 index 3e239d997..000000000 --- a/ui/js/component/modalTransactionSuccessful/index.js +++ /dev/null @@ -1,12 +0,0 @@ -import React from "react"; -import { connect } from "react-redux"; -import { doCloseModal } from "actions/app"; -import ModalTransactionSuccessful from "./view"; - -const select = state => ({}); - -const perform = dispatch => ({ - closeModal: () => dispatch(doCloseModal()), -}); - -export default connect(select, perform)(ModalTransactionSuccessful); diff --git a/ui/js/component/modalTransactionSuccessful/view.jsx b/ui/js/component/modalTransactionSuccessful/view.jsx deleted file mode 100644 index 6f9f68f81..000000000 --- a/ui/js/component/modalTransactionSuccessful/view.jsx +++ /dev/null @@ -1,20 +0,0 @@ -import React from "react"; -import { Modal } from "component/modal"; - -class ModalTransactionSuccessful extends React.PureComponent { - render() { - const { closeModal } = this.props; - - return ( - - {__("Your transaction was successfully placed in the queue.")} - - ); - } -} - -export default ModalTransactionSuccessful; diff --git a/ui/js/component/priceForm/view.jsx b/ui/js/component/priceForm/view.jsx index b4c8318c0..bba0173f5 100644 --- a/ui/js/component/priceForm/view.jsx +++ b/ui/js/component/priceForm/view.jsx @@ -10,10 +10,11 @@ const PriceForm = props => { placeholder, min, step, + isTip, } = props; return ( - + this.handleFeeAmountChange(event)} - defaultFeeValue="1.00" + defaultFeeValue={this.state.feeAmount} onCurrencyChange={event => this.handleCurrencyChange(event)} defaultCurrencyValue="LBC" /> - {__(" ")}