Browse Source

basilisk receive addr amount

all-modes
pbca26 8 years ago
parent
commit
4f45dfd9eb
  1. 42
      react/src/components/dashboard/receiveCoin.js
  2. 3
      react/src/components/dashboard/walletsBalance.js
  3. 6
      react/src/components/dashboard/walletsData.js

42
react/src/components/dashboard/receiveCoin.js

@ -28,13 +28,6 @@ class ReceiveCoin extends React.Component {
Store.dispatch(copyCoinAddress(address));
}
/*importAddressBasilisk(address) {
Store.dispatch(importAddressBasilisk(this.props.coin, address));
}
<span className="label label-default margin-left-10 action" title="Import" onClick={() => this.importAddressBasilisk(address)}>
<i className="icon fa-upload"></i>
</span>*/
renderAddressActions(address) {
if (this.props.mode === 'basilisk') {
return (
@ -64,15 +57,32 @@ class ReceiveCoin extends React.Component {
}
renderAddressList() {
if (this.props.addresses && this.props.addresses['public'] && this.props.addresses['public'].length) {
return this.props.addresses['public'].map((address) =>
<tr key={address.address}>
{this.renderAddressActions(address.address)}
<td>{address.address}</td>
<td>{address.amount}</td>
<td>{address.interest ? address.interest : 'N/A'}</td>
</tr>
);
if (this.props.addresses &&
this.props.addresses.public &&
this.props.addresses.public.length) {
let items = [];
for (let i = 0; i < this.props.addresses.public.length; i++) {
let address = this.props.addresses.public[i];
if (this.props.mode === 'basilisk' && address.amount === 'N/A') {
address.amount = this.props.cache[this.props.coin][address.address].getbalance.data && this.props.cache[this.props.coin][address.address].getbalance.data.balance ? this.props.cache[this.props.coin][address.address].getbalance.data.balance : 'N/A';
}
if (this.props.mode === 'basilisk' && (address.interest === 'N/A' || !address.interest)) {
address.interest = this.props.cache[this.props.coin][address.address].getbalance.data && this.props.cache[this.props.coin][address.address].getbalance.data.interest ? this.props.cache[this.props.coin][address.address].getbalance.data.interest : 'N/A';
}
items.push(
<tr key={address.address}>
{this.renderAddressActions(address.address)}
<td>{address.address}</td>
<td>{address.amount}</td>
<td>{address.interest ? address.interest : 'N/A'}</td>
</tr>
);
}
return items;
} else {
return null;
}

3
react/src/components/dashboard/walletsBalance.js

@ -28,6 +28,7 @@ class WalletsBalance extends React.Component {
if (type === 'main' &&
this.props.ActiveCoin.mode === 'basilisk' &&
this.props.ActiveCoin.activeAddress &&
this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.props.ActiveCoin.activeAddress]&&
this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.props.ActiveCoin.activeAddress].getbalance &&
this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.props.ActiveCoin.activeAddress].getbalance.data &&
this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.props.ActiveCoin.activeAddress].getbalance.data.balance) {
@ -37,6 +38,7 @@ class WalletsBalance extends React.Component {
if (type === 'interest' &&
this.props.ActiveCoin.mode === 'basilisk' &&
this.props.ActiveCoin.activeAddress &&
this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.props.ActiveCoin.activeAddress] &&
this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.props.ActiveCoin.activeAddress].getbalance &&
this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.props.ActiveCoin.activeAddress].getbalance.data &&
this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.props.ActiveCoin.activeAddress].getbalance.data.interest) {
@ -46,6 +48,7 @@ class WalletsBalance extends React.Component {
if (type === 'total' &&
this.props.ActiveCoin.mode === 'basilisk' &&
this.props.ActiveCoin.activeAddress &&
this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.props.ActiveCoin.activeAddress] &&
this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.props.ActiveCoin.activeAddress].getbalance &&
this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.props.ActiveCoin.activeAddress].getbalance.data &&
(this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.props.ActiveCoin.activeAddress].getbalance.data.balance ||

6
react/src/components/dashboard/walletsData.js

@ -439,12 +439,6 @@ class WalletsData extends React.Component {
}
return items;
/*return this.props.ActiveCoin.addresses[type].map((address) =>
<li key={address.address}>
<a tabIndex="0" onClick={() => this.updateAddressSelection(address.address, type, address.amount)}><i className={type === 'public' ? 'icon fa-eye' : 'icon fa-eye-slash'}></i> <span className="text">[ {address.amount} {this.props.ActiveCoin.coin} ] {address.address}</span><span className="glyphicon glyphicon-ok check-mark"></span></a>
</li>
);*/
} else {
return null;
}

Loading…
Cancel
Save