Browse Source

display kmd interest in tx history

v0.25
pbca26 7 years ago
parent
commit
fe22bbc03c
  1. 8
      react/src/components/dashboard/coinTile/coinTileItem.js
  2. 1
      react/src/components/dashboard/walletsData/walletsData.js
  3. 14
      react/src/components/dashboard/walletsData/walletsData.render.js
  4. 38
      react/src/components/dashboard/walletsNav/walletsNav.js
  5. 2
      react/src/components/dashboard/walletsNav/walletsNav.render.js
  6. 7
      react/src/components/overrides.scss

8
react/src/components/dashboard/coinTile/coinTileItem.js

@ -25,7 +25,7 @@ import Config from '../../../config';
import CoinTileItemRender from './coinTileItem.render';
const SPV_DASHBOARD_UPDATE_TIMEOUT = 60000;
const IGUNA_ACTIVE_HANDLE_TIMEOUT_COIND_NATIVE = 15000;
const ACTIVE_HANDLE_TIMEOUT_COIND_NATIVE = 15000;
const COIND_DOWN_MODAL_FETCH_FAILURES_THRESHOLD = 5;
class CoinTileItem extends React.Component {
@ -33,10 +33,6 @@ class CoinTileItem extends React.Component {
super();
}
// TODO: 1) cache native/full node data to file
// 2) limit amount of req per update e.g. list of addresses don't change too often
// 3) limit req in basilisk as much as possible incl. activehandle
componentWillMount() {
if (!this.props.ActiveCoin.coin) {
let _coinSelected = false;
@ -154,7 +150,7 @@ class CoinTileItem extends React.Component {
if (mode === 'native') {
const _iguanaActiveHandle = setInterval(() => {
this.dispatchCoinActions(coin, mode);
}, IGUNA_ACTIVE_HANDLE_TIMEOUT_COIND_NATIVE);
}, ACTIVE_HANDLE_TIMEOUT_COIND_NATIVE);
Store.dispatch(startInterval('sync', _iguanaActiveHandle));
} else if (mode === 'spv') {

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

@ -207,7 +207,6 @@ class WalletsData extends React.Component {
componentWillReceiveProps(props) {
let _stateChange = {};
// TODO: clean
// TODO: figure out why changing ActiveCoin props doesn't trigger comp update
if (this.props.ActiveCoin.txhistory &&
this.props.ActiveCoin.txhistory !== 'loading' &&

14
react/src/components/dashboard/walletsData/walletsData.render.js

@ -149,12 +149,22 @@ export const TxAmountRender = function(tx) {
if (Config.roundValues) {
return (
<span title={ tx.amount * _amountNegative }>{ formatValue(tx.amount) * _amountNegative || translate('DASHBOARD.UNKNOWN') }</span>
<span title={ tx.amount * _amountNegative }>
{ formatValue(tx.amount) * _amountNegative || translate('DASHBOARD.UNKNOWN') }
<span className={ formatValue(tx.interest) ? '' : 'hide' }>{ formatValue(tx.interest) }</span>
</span>
);
}
return (
<span>{ tx.amount * _amountNegative || translate('DASHBOARD.UNKNOWN') }</span>
<span>
{ tx.amount * _amountNegative || translate('DASHBOARD.UNKNOWN') }
{ tx.interest &&
<span
className="tx-interest"
title={ `Claimed interest ${Math.abs(tx.interest)}` }>+{ Math.abs(tx.interest) }</span>
}
</span>
);
};

38
react/src/components/dashboard/walletsNav/walletsNav.js

@ -52,40 +52,34 @@ class WalletsNav extends React.Component {
// TODO: merge toggle func into one
toggleSendReceiveCoinForms() {
//if (this.props.ActiveCoin.mode === 'native') {
Store.dispatch(
toggleDashboardActiveSection(
this.props.ActiveCoin.activeSection === 'settings' ? 'default' : 'settings'
)
);
//}
Store.dispatch(
toggleDashboardActiveSection(
this.props.ActiveCoin.activeSection === 'settings' ? 'default' : 'settings'
)
);
}
toggleSendCoinForm(display) {
//if (this.props.ActiveCoin.mode === 'native') {
Store.dispatch(
toggleDashboardActiveSection(
this.props.ActiveCoin.activeSection === 'send' ? 'default' : 'send'
)
);
//}
Store.dispatch(
toggleDashboardActiveSection(
this.props.ActiveCoin.activeSection === 'send' ? 'default' : 'send'
)
);
}
toggleReceiveCoinForm(display) {
//if (this.props.ActiveCoin.mode === 'native') {
Store.dispatch(
toggleDashboardActiveSection(
this.props.ActiveCoin.activeSection === 'receive' ? 'default' : 'receive'
)
);
//}
Store.dispatch(
toggleDashboardActiveSection(
this.props.ActiveCoin.activeSection === 'receive' ? 'default' : 'receive'
)
);
}
render() {
if (this.props &&
this.props.ActiveCoin &&
!this.props.ActiveCoin.coin) {
return null; //WalletsNavNoWalletRender.call(this);
return null;
}
return WalletsNavWithWalletRender.call(this);

2
react/src/components/dashboard/walletsNav/walletsNav.render.js

@ -30,7 +30,7 @@ export const WalletsNavWithWalletRender = function() {
{ this.props && this.props.Dashboard && this.props.Dashboard.electrumCoins[this.props.ActiveCoin.coin] && this.props.Dashboard.electrumCoins[this.props.ActiveCoin.coin].pub ? this.props.Dashboard.electrumCoins[this.props.ActiveCoin.coin].pub : '-' }
<button
className="btn btn-default btn-xs clipboard-edexaddr"
onClick={ () => this.copyMyAddress(this.props.Dashboard.activeHandle[this.props.ActiveCoin.coin]) }>
onClick={ () => this.copyMyAddress(this.props.Dashboard.electrumCoins[this.props.ActiveCoin.coin].pub) }>
<i className="icon wb-copy"></i> { translate('INDEX.COPY') }
</button>
</div>

7
react/src/components/overrides.scss

@ -435,4 +435,11 @@ select{
font-size: 16px;
padding-top: 16px !important;
}
}
.tx-interest {
display: block;
color: #4caf50;
font-size: 13px;
padding-top: 5px;
}
Loading…
Cancel
Save