Browse Source

spv send self, whole balance shortcut buttons

v0.25
pbca26 7 years ago
parent
commit
8fa3c2c648
  1. 19
      react/src/components/dashboard/sendCoin/sendCoin.js
  2. 14
      react/src/components/dashboard/sendCoin/sendCoin.render.js
  3. 7
      react/src/components/dashboard/sendCoin/sendCoin.scss

19
react/src/components/dashboard/sendCoin/sendCoin.js

@ -56,6 +56,25 @@ class SendCoin extends React.Component {
this.isTransparentTx = this.isTransparentTx.bind(this);
this.toggleSubtractFee = this.toggleSubtractFee.bind(this);
this.isFullySynced = this.isFullySynced.bind(this);
this.setSendAmountAll = this.setSendAmountAll.bind(this);
this.setSendToSelf = this.setSendToSelf.bind(this);
}
setSendAmountAll() {
const _amount = this.state.amount;
const _amountSats = this.state.amount * 100000000;
const _balanceSats = this.props.ActiveCoin.balance.balanceSats;
const _fees = mainWindow.spvFees;
this.setState({
amount: Number((0.00000001 * (_balanceSats - _fees[this.props.ActiveCoin.coin])).toFixed(8)),
});
}
setSendToSelf() {
this.setState({
sendTo: this.props.Dashboard.electrumCoins[this.props.ActiveCoin.coin].pub,
});
}
copyTXID(txid) {

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

@ -52,6 +52,13 @@ export const _SendFormRender = function() {
}
<div className="row">
<div className="col-xlg-12 form-group form-material">
{ this.props.ActiveCoin.mode === 'spv' &&
<button type="button"
className="btn btn-default btn-send-self"
onClick={ this.setSendToSelf }>
Self
</button>
}
<label
className="control-label"
htmlFor="kmdWalletSendTo">{ translate('INDEX.SEND_TO') }</label>
@ -67,6 +74,13 @@ export const _SendFormRender = function() {
required />
</div>
<div className="col-lg-12 form-group form-material">
{ this.props.ActiveCoin.mode === 'spv' &&
<button type="button"
className="btn btn-default btn-send-self"
onClick={ this.setSendAmountAll }>
All
</button>
}
<label
className="control-label"
htmlFor="kmdWalletAmount">

7
react/src/components/dashboard/sendCoin/sendCoin.scss

@ -6,4 +6,11 @@
position: relative;
top: -2px;
}
}
.btn-send-self {
position: absolute;
right: 16px;
top: 20px;
padding: 0 11px;
}
Loading…
Cancel
Save