Browse Source

AGP-299, Link to explorer

v0.25
Miika Turunen 7 years ago
parent
commit
3385c38e9f
  1. 25
      react/src/components/dashboard/walletsTxInfo/walletsTxInfo.js
  2. 5
      react/src/components/dashboard/walletsTxInfo/walletsTxInfo.render.js
  3. 3
      react/src/translate/en.js

25
react/src/components/dashboard/walletsTxInfo/walletsTxInfo.js

@ -1,5 +1,6 @@
import React from 'react';
import { connect } from 'react-redux';
import { translate } from '../../../translate/translate';
import { sortByDate } from '../../../util/sort';
import { toggleDashboardTxInfoModal } from '../../../actions/actionCreators';
import Store from '../../../store';
@ -34,6 +35,29 @@ class WalletsTxInfo extends React.Component {
}
}
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', function() {
setTimeout(function() {
externalWindow.show();
}, 40);
});
}
render() {
if (this.props &&
this.props.ActiveCoin.showTransactionInfo &&
@ -52,6 +76,7 @@ const mapStateToProps = (state) => {
return {
ActiveCoin: {
mode: state.ActiveCoin.mode,
coin: state.ActiveCoin.coin,
txhistory: state.ActiveCoin.txhistory,
showTransactionInfo: state.ActiveCoin.showTransactionInfo,
activeSection: state.ActiveCoin.activeSection,

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

@ -34,6 +34,11 @@ const WalletsTxInfoRender = function(txInfo) {
<i className="icon wb-file"></i>Raw info
</a>
</li>
<li className="pull-right">
<a onClick={ () => this.openExplorerWindow(txInfo.txid) }>
<i className="icon fa-search"></i> { translate('INDEX.OPEN_TRANSACTION_IN_EPLORER') }
</a>
</li>
</ul>
<div className="panel-body">
<div className="tab-content">

3
react/src/translate/en.js

@ -293,7 +293,8 @@ export const _lang = {
'CREATE_INVOICE_QR': 'Create Invoice QR Code',
'QR_CONTENT': 'QR Content',
'CHOOSE_RECEIVING_ADDRESS': 'Choose Address',
'SAVE_AS_IMAGE': 'Save as Image'
'SAVE_AS_IMAGE': 'Save as Image',
'OPEN_TRANSACTION_IN_EPLORER': 'Open transaction in Explorer',
},
'ATOMIC': {
'RAW_OUTPUT': 'Raw Output',

Loading…
Cancel
Save