@ -110,7 +110,10 @@ 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 >
< 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,14 +196,19 @@ 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 >
@ -192,7 +222,10 @@ class WalletsNativeTxHistory extends React.Component {
< 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,13 +236,14 @@ 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" >