From 18ac6fd82d7a3827bd5b8c4d4d2572d0f8617dce Mon Sep 17 00:00:00 2001 From: "hack.ily" Date: Tue, 29 Oct 2019 23:07:30 -0700 Subject: [PATCH] feat(wallet): Close buttons on send/address pages to go back to wallet --- src/ui/component/walletAddress/index.js | 11 +++++++---- src/ui/component/walletAddress/view.jsx | 11 +++++++++-- src/ui/component/walletSend/index.js | 11 +++++++---- src/ui/component/walletSend/view.jsx | 11 +++++++++-- 4 files changed, 32 insertions(+), 12 deletions(-) diff --git a/src/ui/component/walletAddress/index.js b/src/ui/component/walletAddress/index.js index 87b98aaee..13cdafd47 100644 --- a/src/ui/component/walletAddress/index.js +++ b/src/ui/component/walletAddress/index.js @@ -1,6 +1,7 @@ import { connect } from 'react-redux'; import { doCheckAddressIsMine, doGetNewAddress, selectReceiveAddress, selectGettingNewAddress } from 'lbry-redux'; import WalletAddress from './view'; +import { withRouter } from 'react-router'; const select = state => ({ receiveAddress: selectReceiveAddress(state), @@ -12,7 +13,9 @@ const perform = dispatch => ({ getNewAddress: () => dispatch(doGetNewAddress()), }); -export default connect( - select, - perform -)(WalletAddress); +export default withRouter( + connect( + select, + perform + )(WalletAddress) +); diff --git a/src/ui/component/walletAddress/view.jsx b/src/ui/component/walletAddress/view.jsx index 01c4cd091..64fe797da 100644 --- a/src/ui/component/walletAddress/view.jsx +++ b/src/ui/component/walletAddress/view.jsx @@ -1,5 +1,6 @@ // @flow import React from 'react'; +import { REMOVE } from 'constants/icons'; import Button from 'component/button'; import CopyableText from 'component/copyableText'; import QRCode from 'component/common/qr-code'; @@ -10,6 +11,7 @@ type Props = { receiveAddress: string, getNewAddress: () => void, gettingNewAddress: boolean, + history: { goBack: () => void }, }; type State = { @@ -43,12 +45,17 @@ class WalletAddress extends React.PureComponent { } render() { - const { receiveAddress, getNewAddress, gettingNewAddress } = this.props; + const { receiveAddress, getNewAddress, gettingNewAddress, history } = this.props; const { showQR } = this.state; return ( + {__('Receive Credits')} +