Browse Source

send copy btn, link to explorer

v0.25
pbca26 7 years ago
parent
commit
7ecdbde73e
  1. 30
      react/src/components/dashboard/sendCoin/sendCoin.js
  2. 35
      react/src/components/dashboard/sendCoin/sendCoin.render.js
  3. 3
      react/src/components/dashboard/walletsTxInfo/walletsTxInfo.render.js

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

@ -9,7 +9,8 @@ import {
getKMDOPID,
clearLastSendToResponseState,
shepherdElectrumSend,
shepherdElectrumSendPreflight
shepherdElectrumSendPreflight,
copyString,
} from '../../../actions/actionCreators';
import Store from '../../../store';
import {
@ -55,6 +56,33 @@ class SendCoin extends React.Component {
this.isFullySynced = this.isFullySynced.bind(this);
}
copyTXID(txid) {
Store.dispatch(copyString(txid, 'TXID copied to clipboard'));
}
openExplorerWindow(txid) {
const url = `http://${this.props.ActiveCoin.coin}.explorer.supernet.org/tx/${txid}`;
const remote = window.require('electron').remote;
const BrowserWindow = remote.BrowserWindow;
const externalWindow = new BrowserWindow({
width: 1280,
height: 800,
title: `${translate('INDEX.LOADING')}...`,
icon: remote.getCurrentWindow().iguanaIcon,
webPreferences: {
nodeIntegration: false,
},
});
externalWindow.loadURL(url);
externalWindow.webContents.on('did-finish-load', () => {
setTimeout(() => {
externalWindow.show();
}, 40);
});
}
SendFormRender() {
return _SendFormRender.call(this);
}

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

@ -36,10 +36,7 @@ export const AddressListRender = function() {
export const _SendFormRender = function() {
return (
<form
className="extcoin-send-form"
method="post"
autoComplete="off">
<div className="extcoin-send-form">
{ this.state.renderAddressDropdown &&
<div className="row">
<div className="col-xlg-12 form-group form-material">
@ -137,7 +134,7 @@ export const _SendFormRender = function() {
</button>
</div>
</div>
</form>
</div>
);
}
@ -277,7 +274,33 @@ export const SendRender = function() {
</tr>
<tr>
<td className="padding-left-30">{ translate('SEND.TRANSACTION_ID') }</td>
<td className="padding-left-30">{ this.props.ActiveCoin.mode === 'spv' ? (this.state.lastSendToResponse && this.state.lastSendToResponse.txid ? this.state.lastSendToResponse.txid : '') : this.state.lastSendToResponse }</td>
<td className="padding-left-30">
{ this.props.ActiveCoin.mode === 'spv' ? (this.state.lastSendToResponse && this.state.lastSendToResponse.txid ? this.state.lastSendToResponse.txid : '') : this.state.lastSendToResponse }
{ ((this.props.ActiveCoin.mode === 'spv' &&
this.state.lastSendToResponse &&
this.state.lastSendToResponse.txid) ||
(this.props.ActiveCoin.mode === 'native' && this.state.lastSendToResponse && this.state.lastSendToResponse.length === 64)) &&
<button
className="btn btn-default btn-xs clipboard-edexaddr margin-left-10"
title={ translate('INDEX.COPY_TO_CLIPBOARD') }
onClick={ () => this.copyTXID(this.props.ActiveCoin.mode === 'spv' ? (this.state.lastSendToResponse && this.state.lastSendToResponse.txid ? this.state.lastSendToResponse.txid : '') : this.state.lastSendToResponse) }>
<i className="icon wb-copy"></i> { translate('INDEX.COPY') }
</button>
}
{ ((this.props.ActiveCoin.mode === 'spv' &&
this.state.lastSendToResponse &&
this.state.lastSendToResponse.txid) ||
(this.props.ActiveCoin.mode === 'native' && this.state.lastSendToResponse && this.state.lastSendToResponse.length === 64)) &&
<div className="margin-top-10">
<button
type="button"
className="btn btn-sm white btn-dark waves-effect waves-light pull-left"
onClick={ () => this.openExplorerWindow(this.props.ActiveCoin.mode === 'spv' ? (this.state.lastSendToResponse && this.state.lastSendToResponse.txid ? this.state.lastSendToResponse.txid : '') : this.state.lastSendToResponse) }>
<i className="icon fa-external-link"></i> { translate('INDEX.OPEN_TRANSACTION_IN_EPLORER', this.props.ActiveCoin.coin) }
</button>
</div>
}
</td>
</tr>
</tbody>
</table>

3
react/src/components/dashboard/walletsTxInfo/walletsTxInfo.render.js

@ -182,7 +182,8 @@ const WalletsTxInfoRender = function(txInfo) {
</div>
</div>
<div className="modal-footer">
{ this.state.txDetails && this.props.ActiveCoin.coin !== 'CHIPS' &&
{ this.state.txDetails &&
this.props.ActiveCoin.coin !== 'CHIPS' &&
<button
type="button"
className="btn btn-sm white btn-dark waves-effect waves-light pull-left"

Loading…
Cancel
Save