@ -37,31 +37,31 @@ class WalletsNativeTxHistory extends React.Component {
}
renderTxType ( category ) {
if ( category === 'send' ) {
if ( category === 'send' ) {
return (
< span className = "label label-danger" >
< i className = "icon fa-arrow-circle-left" > < / i > < s p a n > { t r a n s l a t e ( ' D A S H B O A R D . O U T ' ) } < / s p a n >
< i className = "icon fa-arrow-circle-left" > < / i > < s p a n > { t r a n s l a t e ( ' D A S H B O A R D . O U T ' ) } < / s p a n >
< / s p a n >
) ;
}
if ( category === 'receive' ) {
if ( category === 'receive' ) {
return (
< span className = "label label-success" >
< i className = "icon fa-arrow-circle-right" > < / i > < s p a n > { t r a n s l a t e ( ' D A S H B O A R D . I N ' ) } < / s p a n >
< i className = "icon fa-arrow-circle-right" > < / i > < s p a n > { t r a n s l a t e ( ' D A S H B O A R D . I N ' ) } < / s p a n >
< / s p a n >
) ;
}
if ( category === 'generate' ) {
if ( category === 'generate' ) {
return (
< span >
< i className = "icon fa-cogs" > < / i > < s p a n > { t r a n s l a t e ( ' D A S H B O A R D . M I N E D ' ) } < / s p a n >
< i className = "icon fa-cogs" > < / i > < s p a n > { t r a n s l a t e ( ' D A S H B O A R D . M I N E D ' ) } < / s p a n >
< / s p a n >
) ;
}
if ( category === 'immature' ) {
if ( category === 'immature' ) {
return (
< span >
< i className = "icon fa-clock-o" > < / i > < s p a n > { t r a n s l a t e ( ' D A S H B O A R D . I M M A T U R E ' ) } < / s p a n >
< i className = "icon fa-clock-o" > < / i > < s p a n > { t r a n s l a t e ( ' D A S H B O A R D . I M M A T U R E ' ) } < / s p a n >
< / s p a n >
) ;
}
@ -71,7 +71,7 @@ class WalletsNativeTxHistory extends React.Component {
if ( ! tx . address ) {
return (
< span >
< i className = "icon fa-bullseye" > < / i > < s p a n c l a s s N a m e = " l a b e l l a b e l - d a r k " > { t r a n s l a t e ( ' D A S H B O A R D . Z A D D R _ N O T _ L I S T E D ' ) } < / s p a n >
< i className = "icon fa-bullseye" > < / i > < s p a n c l a s s N a m e = " l a b e l l a b e l - d a r k " > { t r a n s l a t e ( ' D A S H B O A R D . Z A D D R _ N O T _ L I S T E D ' ) } < / s p a n >
< / s p a n >
) ;
} else {
@ -109,8 +109,11 @@ class WalletsNativeTxHistory extends React.Component {
for ( let i = 0 ; i < Math . floor ( this . props . ActiveCoin . txhistory . length / this . state . itemsPerPage ) ; i ++ ) {
items . push (
< li className = { this . state . activePage === i + 1 ? 'paginate_button active' : 'paginate_button' } >
< a aria - controls = "kmd-tx-history-tbl" tabIndex = "0" key = { i + '-pagination' } onClick = { this . state . activePage !== ( i + 1 ) ? ( ) => this . updateCurrentPage ( i + 1 ) : null } > { i + 1 } < / a >
< li className = { this . state . activePage === i + 1 ? 'paginate_button active' : 'paginate_button' } >
< a
aria - controls = "kmd-tx-history-tbl"
tabIndex = "0" key = { i + '-pagination' }
onClick = { this . state . activePage !== ( i + 1 ) ? ( ) => this . updateCurrentPage ( i + 1 ) : null } > { i + 1 } < / a >
< / l i >
) ;
}
@ -126,7 +129,11 @@ class WalletsNativeTxHistory extends React.Component {
< div className = "dataTables_length" id = "kmd-tx-history-tbl_length" >
< label >
{ translate ( 'INDEX.SHOW' ) } & nbsp ;
< select name = "itemsPerPage" aria - controls = "kmd-tx-history-tbl" className = "form-control input-sm" onChange = { this . updateInput } >
< select
name = "itemsPerPage"
aria - controls = "kmd-tx-history-tbl"
className = "form-control input-sm"
onChange = { this . updateInput } >
< option value = "10" > 10 < / o p t i o n >
< option value = "25" > 25 < / o p t i o n >
< option value = "50" > 50 < / o p t i o n >
@ -145,20 +152,38 @@ class WalletsNativeTxHistory extends React.Component {
if ( this . props . ActiveCoin . txhistory &&
this . props . ActiveCoin . txhistory !== 'loading' &&
this . props . ActiveCoin . txhistory . length > 10 ) {
const _ paginationStart = ( ( this . state . activePage - 1 ) * this . state . itemsPerPage ) + 1 ;
const _ paginationEnd = this . state . activePage * this . state . itemsPerPage ;
const _ paginationNextState = this . state . activePage > Math . floor ( this . props . ActiveCoin . txhistory . length / this . state . itemsPerPage ) ;
return (
< div className = "row unselectable" >
< div className = "col-sm-5" >
< div className = "dataTables_info" id = "kmd-tx-history-tbl_info" role = "status" aria - live = "polite" > { translate ( 'INDEX.SHOWING' ) } { ( ( this . state . activePage - 1 ) * this . state . itemsPerPage ) + 1 } { translate ( 'INDEX.TO' ) } { this . state . activePage * this . state . itemsPerPage } { translate ( 'INDEX.OF' ) } { this . props . ActiveCoin . txhistory . length } { translate ( 'INDEX.ENTRIES_SM' ) } < / d i v >
< div
className = "dataTables_info"
id = "kmd-tx-history-tbl_info"
role = "status"
aria - live = "polite" > { translate ( 'INDEX.SHOWING' ) } { _ paginationStart } { translate ( 'INDEX.TO' ) } { _ paginationEnd } { translate ( 'INDEX.OF' ) } { this . props . ActiveCoin . txhistory . length } { translate ( 'INDEX.ENTRIES_SM' ) } < / d i v >
< / d i v >
< div className = "col-sm-7" >
< div className = "dataTables_paginate paging_simple_numbers" id = "kmd-tx-history-tbl_paginate" >
< ul className = "pagination" >
< li className = { this . state . activePage === 1 ? 'paginate_button previous disabled' : 'paginate_button previous' } id = "kmd-tx-history-tbl_previous" >
< a aria - controls = "kmd-tx-history-tbl" tabIndex = "0" onClick = { ( ) => this . updateCurrentPage ( this . state . activePage - 1 ) } > { translate ( 'INDEX.PREVIOUS' ) } < / a >
< li
className = { this . state . activePage === 1 ? 'paginate_button previous disabled' : 'paginate_button previous' }
id = "kmd-tx-history-tbl_previous" >
< a
aria - controls = "kmd-tx-history-tbl"
tabIndex = "0"
onClick = { ( ) => this . updateCurrentPage ( this . state . activePage - 1 ) } > { translate ( 'INDEX.PREVIOUS' ) } < / a >
< / l i >
{ this . renderPaginationItems ( ) }
< li className = { this . state . activePage > Math . floor ( this . props . ActiveCoin . txhistory . length / this . state . itemsPerPage ) ? 'paginate_button next disabled' : 'paginate_button next' } id = "kmd-tx-history-tbl_next" >
< a aria - controls = "kmd-tx-history-tbl" tabIndex = "0" onClick = { ( ) => this . updateCurrentPage ( this . state . activePage + 1 ) } > { translate ( 'INDEX.NEXT' ) } < / a >
< li
className = { _ paginationNextState ? 'paginate_button next disabled' : 'paginate_button next' }
id = "kmd-tx-history-tbl_next" >
< a
aria - controls = "kmd-tx-history-tbl"
tabIndex = "0"
onClick = { ( ) => this . updateCurrentPage ( this . state . activePage + 1 ) } > { translate ( 'INDEX.NEXT' ) } < / a >
< / l i >
< / u l >
< / d i v >
@ -171,28 +196,36 @@ class WalletsNativeTxHistory extends React.Component {
}
renderTxHistoryList ( ) {
if ( this . props . ActiveCoin . txhistory && this . props . ActiveCoin . txhistory === 'no data' ) {
return 'no data' ;
} else if ( this . props . ActiveCoin . txhistory && this . props . ActiveCoin . txhistory === 'loading' ) {
return 'loading history...' ;
if ( this . props . ActiveCoin . txhistory &&
this . props . ActiveCoin . txhistory === 'no data' ) {
return translate ( 'INDEX.NO_DATA' ) ;
} else if (
this . props . ActiveCoin . txhistory &&
this . props . ActiveCoin . txhistory === 'loading' ) {
return translate ( 'INDEX.LOADING_HISTORY' ) ;
} else if (
this . props . ActiveCoin . txhistory &&
( this . props . ActiveCoin . txhistory !== 'loading' && this . props . ActiveCoin . txhistory !== 'no data' ) ) {
if ( this . state . itemsList && this . state . itemsList . length && this . props . ActiveCoin . nativeActiveSection === 'default' ) {
if ( this . state . itemsList &&
this . state . itemsList . length &&
this . props . ActiveCoin . nativeActiveSection === 'default' ) {
return this . state . itemsList . map ( ( tx , index ) =>
< tr key = { tx . txid + tx . amount } >
< td >
< span className = "label label-default" >
< i className = "icon fa-eye" > < / i > { t r a n s l a t e ( ' I A P I . P U B L I C _ S M ' ) }
< i className = "icon fa-eye" > < / i > { t r a n s l a t e ( ' I A P I . P U B L I C _ S M ' ) }
< / s p a n >
< / t d >
< td > { this . renderTxType ( tx . category ) } < / t d >
< td > { tx . confirmations } < / t d >
< td > { tx . amount } < / t d >
< td > { secondsToString ( tx . time ) } < / t d >
< td > { this . renderAddress ( tx ) } < / t d >
< td > { this . renderTxType ( tx . category ) } < / t d >
< td > { tx . confirmations } < / t d >
< td > { tx . amount } < / t d >
< td > { secondsToString ( tx . time ) } < / t d >
< td > { this . renderAddress ( tx ) } < / t d >
< td >
< button type = "button" className = "btn btn-xs white btn-info waves-effect waves-light btn-kmdtxid" onClick = { ( ) => this . toggleTxInfoModal ( ! this . props . ActiveCoin . showTransactionInfo , index ) } > < i className = "icon fa-search" > < / i > < / b u t t o n >
< button
type = "button"
className = "btn btn-xs white btn-info waves-effect waves-light btn-kmdtxid"
onClick = { ( ) => this . toggleTxInfoModal ( ! this . props . ActiveCoin . showTransactionInfo , index ) } > < i className = "icon fa-search" > < / i > < / b u t t o n >
< / t d >
< / t r >
) ;
@ -203,27 +236,28 @@ class WalletsNativeTxHistory extends React.Component {
}
render ( ) {
if ( this . props && this . props . ActiveCoin . nativeActiveSection === 'default' ) {
if ( this . props &&
this . props . ActiveCoin . nativeActiveSection === 'default' ) {
return (
< div className = "native-transactions" >
< div data - extcoin = "COIN" id = "kmd_wallet_dashboardinfo" >
< div id = "kmd_wallet_dashboardinfo" >
< div className = "col-xs-12 margin-top-20" >
< div className = "panel nav-tabs-horizontal" >
< div data - extcoin = "COIN" id = "kmd_wallet_dashoard_section" >
< div id = "kmd_wallet_dashoard_section" >
< div className = "col-xlg-12 col-lg-12 col-sm-12 col-xs-12" >
< div className = "panel" >
< header className = "panel-heading" >
< h3 className = "panel-title" > { translate ( 'INDEX.TRANSACTION_HISTORY' ) } < / h 3 >
< h3 className = "panel-title" > { translate ( 'INDEX.TRANSACTION_HISTORY' ) } < / h 3 >
< / h e a d e r >
< div className = "panel-body" >
< div className = "row" >
< div className = "col-sm-6" >
{ this . renderPaginationItemsPerPageSelector ( ) }
{ this . renderPaginationItemsPerPageSelector ( ) }
< / d i v >
< div className = "col-sm-6" >
< div id = "kmd-tx-history-tbl_filter" className = "dataTables_filter" >
< label >
{ translate ( 'INDEX.SEARCH' ) } : < input type = "search" className = "form-control input-sm" aria - controls = "kmd-tx-history-tbl" disabled = "true" / >
{ translate ( 'INDEX.SEARCH' ) } : < input type = "search" className = "form-control input-sm" aria - controls = "kmd-tx-history-tbl" disabled = "true" / >
< / l a b e l >
< / d i v >
< / d i v >
@ -232,32 +266,32 @@ class WalletsNativeTxHistory extends React.Component {
< table className = "table table-hover dataTable table-striped" id = "kmd-tx-history-tbl" width = "100%" >
< thead >
< tr >
< th > { translate ( 'INDEX.TYPE' ) } < / t h >
< th > { translate ( 'INDEX.DIRECTION' ) } < / t h >
< th > { translate ( 'INDEX.CONFIRMATIONS' ) } < / t h >
< th > { translate ( 'INDEX.AMOUNT' ) } < / t h >
< th > { translate ( 'INDEX.TIME' ) } < / t h >
< th > { translate ( 'INDEX.DEST_ADDRESS' ) } < / t h >
< th > { translate ( 'INDEX.TX_DETAIL' ) } < / t h >
< th > { translate ( 'INDEX.TYPE' ) } < / t h >
< th > { translate ( 'INDEX.DIRECTION' ) } < / t h >
< th > { translate ( 'INDEX.CONFIRMATIONS' ) } < / t h >
< th > { translate ( 'INDEX.AMOUNT' ) } < / t h >
< th > { translate ( 'INDEX.TIME' ) } < / t h >
< th > { translate ( 'INDEX.DEST_ADDRESS' ) } < / t h >
< th > { translate ( 'INDEX.TX_DETAIL' ) } < / t h >
< / t r >
< / t h e a d >
< tbody >
{ this . renderTxHistoryList ( ) }
{ this . renderTxHistoryList ( ) }
< / t b o d y >
< tfoot >
< tr >
< th > { translate ( 'INDEX.TYPE' ) } < / t h >
< th > { translate ( 'INDEX.DIRECTION' ) } < / t h >
< th > { translate ( 'INDEX.CONFIRMATIONS' ) } < / t h >
< th > { translate ( 'INDEX.AMOUNT' ) } < / t h >
< th > { translate ( 'INDEX.TIME' ) } < / t h >
< th > { translate ( 'INDEX.DEST_ADDRESS' ) } < / t h >
< th > { translate ( 'INDEX.TX_DETAIL' ) } < / t h >
< th > { translate ( 'INDEX.TYPE' ) } < / t h >
< th > { translate ( 'INDEX.DIRECTION' ) } < / t h >
< th > { translate ( 'INDEX.CONFIRMATIONS' ) } < / t h >
< th > { translate ( 'INDEX.AMOUNT' ) } < / t h >
< th > { translate ( 'INDEX.TIME' ) } < / t h >
< th > { translate ( 'INDEX.DEST_ADDRESS' ) } < / t h >
< th > { translate ( 'INDEX.TX_DETAIL' ) } < / t h >
< / t r >
< / t f o o t >
< / t a b l e >
< / d i v >
{ this . renderPagination ( ) }
{ this . renderPagination ( ) }
< / d i v >
< / d i v >
< / d i v >