@ -1,128 +1,159 @@
import React from 'react' ;
import React from 'react' ;
import { translate } from '../../translate/translate' ;
import { translate } from '../../translate/translate' ;
import { secondsToString } from '../../util/time' ;
import { toggleDashboardTxInfoModal } from '../../actions/actionCreators' ;
import Store from '../../store' ;
class WalletsNativeTxInfo extends React . Component {
class WalletsNativeTxInfo extends React . Component {
constructor ( props ) {
super ( props ) ;
this . state = {
activeTab : 0 ,
} ;
this . toggleTxInfoModal = this . toggleTxInfoModal . bind ( this ) ;
}
toggleTxInfoModal ( ) {
Store . dispatch ( toggleDashboardTxInfoModal ( false ) ) ;
}
openTab ( tab ) {
this . setState ( Object . assign ( { } , this . state , {
activeTab : tab ,
} ) ) ;
}
render ( ) {
render ( ) {
if ( this . props && this . props . ActiveCoin && this . props . ActiveCoin . showTransactionInfo ) {
if ( this . props && this . props . ActiveCoin . showTransactionInfo && this . props . ActiveCoin . nativeActiveSection === 'default' ) {
const txInfo = this . props . ActiveCoin . txhistory [ this . props . ActiveCoin . showTransactionInfoTxIndex ] ;
return (
return (
< div >
< div >
< div className = "modal show" data - extcoin = "COIN" id = "kmd_txid_info_mdl" aria - hidden = "false" role = "dialog" >
< div className = "modal show" data - extcoin = "COIN" id = "kmd_txid_info_mdl" aria - hidden = "false" role = "dialog" >
< div className = "modal-dialog modal-center modal-lg" >
< div className = "modal-dialog modal-center modal-lg" >
< div className = "modal-content" >
< div className = "modal-content" >
< div className = "modal-body" >
< div className = "modal-body" style = { { height : '590px' } } >
< div className = "panel nav-tabs-horizontal" >
< div className = "panel nav-tabs-horizontal" >
< ul className = "nav nav-tabs nav-tabs-line" data - plugin = "nav-tabs" role = "tablist" >
< ul className = "nav nav-tabs nav-tabs-line" data - plugin = "nav-tabs" role = "tablist" >
< li className = "active" role = "presentation" >
< li className = { this . state . activeTab === 0 ? 'active' : '' } role = "presentation" >
< a data - toggle = "tab" href = "#KmdTxIDInfotab1" data - extcoin = "COIN" aria - controls = "KmdTxIDInfotab1" role = "tab" >
< a data - toggle = "tab" data - extcoin = "COIN" aria - controls = "KmdTxIDInfotab1" role = "tab" onClick = { ( ) => this . openTab ( 0 ) } >
< i className = "icon md-balance-wallet" aria - hidden = "true" > < / i > T x I D I n f o
< i className = "icon md-balance-wallet" aria - hidden = "true" > < / i > T x I D I n f o
< / a >
< / a >
< / l i >
< / l i >
< li role = "presentation" >
< li className = { this . state . activeTab === 1 ? 'active' : '' } role = "presentation" >
< a data - toggle = "tab" href = "#KmdTxIDInfotab2" data - extcoin = "COIN" aria - controls = "KmdTxIDInfotab2" role = "tab" >
< a data - toggle = "tab" data - extcoin = "COIN" aria - controls = "KmdTxIDInfotab2" role = "tab" onClick = { ( ) => this . openTab ( 1 ) } >
< i className = "icon md-plus-square" aria - hidden = "true" > < / i > v j o i n t s p l i t s , d e t a i l s
< i className = "icon md-plus-square" aria - hidden = "true" > < / i > V j o i n t s p l i t s , D e t a i l s
< / a >
< / a >
< / l i >
< / l i >
< li role = "presentation" >
< li className = { this . state . activeTab === 2 ? 'active' : '' } role = "presentation" >
< a data - toggle = "tab" href = "#KmdTxIDInfotab3" data - extcoin = "COIN" aria - controls = "KmdTxIDInfotab3" role = "tab" >
< a data - toggle = "tab" data - extcoin = "COIN" aria - controls = "KmdTxIDInfotab3" role = "tab" onClick = { ( ) => this . openTab ( 2 ) } >
< i className = "icon wb-briefcase" aria - hidden = "true" > < / i > h e x
< i className = "icon wb-briefcase" aria - hidden = "true" > < / i > H e x
< / a >
< / l i >
< li className = { this . state . activeTab === 3 ? 'active' : '' } role = "presentation" >
< a data - toggle = "tab" data - extcoin = "COIN" aria - controls = "KmdTxIDInfotab4" role = "tab" onClick = { ( ) => this . openTab ( 3 ) } >
< i className = "icon wb-file" aria - hidden = "true" > < / i > R a w i n f o
< / a >
< / a >
< / l i >
< / l i >
< / u l >
< / u l >
< div className = "panel-body" >
< div className = "panel-body" >
< div className = "tab-content" >
< div className = "tab-content" >
< div className = "tab-pane active" id = "KmdTxIDInfotab1" data - extcoin = "COIN" role = "tabpanel" >
< div className = { this . state . activeTab === 0 ? 'tab-pane active' : 'tab-pane' } id = "KmdTxIDInfotab1" data - extcoin = "COIN" role = "tabpanel" >
< table className = "table table-striped" >
< table className = "table table-striped" >
< tbody >
< tbody >
< tr >
< tr >
< td > amount < / t d >
< td > amount < / t d >
< td >
< td >
< span data - extcoin = "COIN" id = "kmd_txid_info_amount" > < / s p a n >
{ txInfo . amount }
< / t d >
< / t d >
< / t r >
< / t r >
< tr >
< tr >
< td > fee < / t d >
< td > fee < / t d >
< td >
< td >
< span data - extcoin = "COIN" id = "kmd_txid_info_fee" > < / s p a n >
{ txInfo . fee }
< / t d >
< / t d >
< / t r >
< / t r >
< tr >
< tr >
< td > confirmations < / t d >
< td > confirmations < / t d >
< td >
< td >
< span data - extcoin = "COIN" id = "kmd_txid_info_confirmations" > < / s p a n >
{ txInfo . confirmations }
< / t d >
< / t d >
< / t r >
< / t r >
< tr >
< tr >
< td > blockhash < / t d >
< td > blockhash < / t d >
< td >
< td >
< span data - extcoin = "COIN" id = "kmd_txid_info_blockhash" > < / s p a n >
{ txInfo . blockhash }
< / t d >
< / t d >
< / t r >
< / t r >
< tr >
< tr >
< td > blockindex < / t d >
< td > blockindex < / t d >
< td >
< td >
< span data - extcoin = "COIN" id = "kmd_txid_info_blockindex" > < / s p a n >
{ txInfo . blockindex }
< / t d >
< / t d >
< / t r >
< / t r >
< tr >
< tr >
< td > blocktime < / t d >
< td > blocktime < / t d >
< td >
< td >
< span data - extcoin = "COIN" id = "kmd_txid_info_blocktime" > < / s p a n >
{ secondsToString ( txInfo . blocktime ) }
< / t d >
< / t d >
< / t r >
< / t r >
< tr >
< tr >
< td > txid < / t d >
< td > txid < / t d >
< td >
< td >
< span data - extcoin = "COIN" id = "kmd_txid_info_txid" > < / s p a n >
{ txInfo . txid }
< / t d >
< / t d >
< / t r >
< / t r >
< tr >
< tr >
< td > walletconflicts < / t d >
< td > walletconflicts < / t d >
< td >
< td >
< span data - extcoin = "COIN" id = "kmd_txid_info_walletconflicts" > < / s p a n >
{ txInfo . walletconflicts . length }
< / t d >
< / t d >
< / t r >
< / t r >
< tr >
< tr >
< td > time < / t d >
< td > time < / t d >
< td >
< td >
< span data - extcoin = "COIN" id = "kmd_txid_info_time" > < / s p a n >
{ secondsToString ( txInfo . time ) }
< / t d >
< / t d >
< / t r >
< / t r >
< tr >
< tr >
< td > timereceived < / t d >
< td > timereceived < / t d >
< td >
< td >
< span data - extcoin = "COIN" id = "kmd_txid_info_timereceived" > < / s p a n >
{ secondsToString ( txInfo . timereceived ) }
< / t d >
< / t d >
< / t r >
< / t r >
< / t b o d y >
< / t b o d y >
< / t a b l e >
< / t a b l e >
< / d i v >
< / d i v >
< div className = "tab-pane" id = "KmdTxIDInfotab2" data - extcoin = "COIN" role = "tabpanel" >
< div className = { this . state . activeTab === 1 ? 'tab-pane active' : 'tab-pane' } id = "KmdTxIDInfotab2" data - extcoin = "COIN" role = "tabpanel" >
< table className = "table table-striped" >
< table className = "table table-striped" >
< tbody >
< tbody >
< tr >
< tr >
< td > vjoinsplit < / t d >
< td > vjoinsplit < / t d >
< td >
< td >
< span data - extcoin = "COIN" id = "kmd_txid_info_vjoinsplit" > < / s p a n >
{ txInfo . vjoinsplit }
< / t d >
< / t d >
< / t r >
< / t r >
< tr >
< tr >
< td > details < / t d >
< td > details < / t d >
< td >
< td >
< span data - extcoin = "COIN" id = "kmd_txid_info_details" > < / s p a n >
{ txInfo . details }
< / t d >
< / t d >
< / t r >
< / t r >
< / t b o d y >
< / t b o d y >
< / t a b l e >
< / t a b l e >
< / d i v >
< / d i v >
< div className = "tab-pane" id = "KmdTxIDInfotab3" data - extcoin = "COIN" role = "tabpanel" >
< div className = { this . state . activeTab === 2 ? 'tab-pane active' : 'tab-pane' } id = "KmdTxIDInfotab3" data - extcoin = "COIN" role = "tabpanel" >
< textarea id = "kmd_txid_info_hex" data - extcoin = "COIN" style = { { width : '100%' , height : '170px' } } rows = "10" cols = "80" disabled > < / t e x t a r e a >
< textarea id = "kmd_txid_info_hex" data - extcoin = "COIN" style = { { width : '100%' , height : '170px' } } rows = "10" cols = "80" disabled > { txInfo . hex } < / t e x t a r e a >
< / d i v >
< div className = { this . state . activeTab === 3 ? 'tab-pane active' : 'tab-pane' } id = "KmdTxIDInfotab4" data - extcoin = "COIN" role = "tabpanel" >
< textarea id = "kmd_txid_info_hex" data - extcoin = "COIN" style = { { width : '100%' , height : '400px' } } rows = "40" cols = "80" disabled > { JSON . stringify ( txInfo , null , '\t' ) } < / t e x t a r e a >
< / d i v >
< / d i v >
< / d i v >
< / d i v >
< / d i v >
< / d i v >
< / d i v >
< / d i v >
< / d i v >
< / d i v >
< div className = "modal-footer" >
< div className = "modal-footer" >
< button type = "button" className = "btn btn-default" data - dismiss = "modal" > Close < / b u t t o n >
< button type = "button" className = "btn btn-default" data - dismiss = "modal" onClick = { this . toggleTxInfoModal } > Close < / b u t t o n >
< / d i v >
< / d i v >
< / d i v >
< / d i v >
< / d i v >
< / d i v >