From 9837452545f5ea2af30b743d8dad8e60bbd50212 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Thu, 20 Apr 2017 09:08:22 +0300 Subject: [PATCH] basilisk tx history addr dropdown --- react/src/components/dashboard/walletsData.js | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/react/src/components/dashboard/walletsData.js b/react/src/components/dashboard/walletsData.js index c97ebf5..561f5f6 100644 --- a/react/src/components/dashboard/walletsData.js +++ b/react/src/components/dashboard/walletsData.js @@ -17,12 +17,15 @@ class WalletsData extends React.Component { itemsPerPage: 10, activePage: 1, itemsList: null, + currentAddress: null, + addressSelectorOpen: false, }; this.updateInput = this.updateInput.bind(this); this.toggleBasiliskActionsMenu = this.toggleBasiliskActionsMenu.bind(this); this.basiliskRefreshAction = this.basiliskRefreshAction.bind(this); this.basiliskConnectionAction = this.basiliskConnectionAction.bind(this); this.getDexNotariesAction = this.getDexNotariesAction.bind(this); + this.openDropMenu = this.openDropMenu.bind(this); } toggleBasiliskActionsMenu() { @@ -204,6 +207,61 @@ class WalletsData extends React.Component { } } + openDropMenu() { + this.setState(Object.assign({}, this.state, { + addressSelectorOpen: !this.state.addressSelectorOpen, + })); + } + + renderAddressByType(type) { + if (this.props.ActiveCoin.addresses && this.props.ActiveCoin.addresses[type] && this.props.ActiveCoin.addresses[type].length) { + console.log(type); + return this.props.ActiveCoin.addresses[type].map((address) => +
  • + this.updateAddressSelection(address.address, type, address.amount)}> [ {address.amount} {this.props.ActiveCoin.coin} ]  {address.address} +
  • + ); + } else { + return null; + } + } + + renderSelectorCurrentLabel() { + if (this.state.sendFrom) { + return ( + + [ {this.state.sendFromAmount} {this.props.ActiveCoin.coin} ]  {this.state.sendFrom} + + ); + } else { + return ( + - Select Transparent or Private Address - + ); + } + } + + renderAddressList() { + if (this.props.Dashboard && this.props.Dashboard.activeHandle && this.props.Dashboard.activeHandle[this.props.ActiveCoin.coin]) { + return ( +
    + +
    + +
    +
    + ); + } else { + return null; + } + } + render() { if (this.props && this.props.ActiveCoin && this.props.ActiveCoin.coin && this.props.ActiveCoin.mode !== 'native' && !this.props.ActiveCoin.send && !this.props.ActiveCoin.receive) { return ( @@ -251,6 +309,11 @@ class WalletsData extends React.Component {

    {translate('INDEX.TRANSACTION_HISTORY')}

    +
    +
    + {this.renderAddressList()} +
    +
    {this.renderPaginationItemsPerPageSelector()}