diff --git a/react/src/components/dashboard/notifications/notifications.render.js b/react/src/components/dashboard/notifications/notifications.render.js index 93c57b6..8a894c9 100644 --- a/react/src/components/dashboard/notifications/notifications.render.js +++ b/react/src/components/dashboard/notifications/notifications.render.js @@ -58,13 +58,13 @@ export const NotificationsModalRender = function() {
{ translate('INDEX.FILL_SEND_DETAILS') }
{ translate('INDEX.CONFIRM_DETAILS') }
@@ -368,7 +368,7 @@ export const SettingsRender = function() { onChange={ this.updateInput } value={ this.state.wifkeysPassphrase }> this.openTab('ImportKeys', 5) } - className={ this.state.nativeOnly ? 'panel hide' : 'panel' }> + className={ 'panel' + (this.state.nativeOnly ? ' hide' : '') }> - + { translate('INDEX.IMPORT_KEYS') } { translate('INDEX.IMPORT_KEYS_DESC_P1') } @@ -456,12 +456,12 @@ export const SettingsRender = function() { id="DebugLog" onClick={ () => this.openTab('DebugLog', 6) }> - + { translate('INDEX.DEBUG_LOG') } { translate('INDEX.DEBUG_LOG_DESC') } @@ -515,12 +515,12 @@ export const SettingsRender = function() { id="AppSettings" onClick={ () => this.openTab('AppSettings', 7) }> - + { translate('SETTINGS.APP_CONFIG') } (config.json) @@ -547,14 +547,14 @@ export const SettingsRender = function() { this.openTab('Cli', 9) } - className={ !this.props.Main.coins.native.length ? 'panel hide' : 'panel' }> + className={ 'panel' + (!this.props.Main.coins.native.length ? ' hide' : '') }> - + CLI { translate('INDEX.CLI_SELECT_A_COIN') } diff --git a/react/src/components/dashboard/walletsData/walletsData.js b/react/src/components/dashboard/walletsData/walletsData.js index 72400e9..33d2891 100644 --- a/react/src/components/dashboard/walletsData/walletsData.js +++ b/react/src/components/dashboard/walletsData/walletsData.js @@ -24,7 +24,6 @@ import { PaginationItemsPerPageSelectorRender, PaginationRender, TxHistoryListRender, - UseCacheToggleRender, AddressListRender, WalletsDataRender } from './walletsData.render'; @@ -421,7 +420,7 @@ class WalletsData extends React.Component { items.push( this.updateAddressSelection(address, type, _amount) }> - + [ { _amount } { _coin } ] { address } @@ -470,7 +469,10 @@ class WalletsData extends React.Component { return ( - [ { this.renderAddressAmount() } { this.props.ActiveCoin.coin } ] { this.state.currentAddress } + + [ { this.renderAddressAmount() } { this.props.ActiveCoin.coin } ] + { this.state.currentAddress } + ); } else { diff --git a/react/src/components/dashboard/walletsData/walletsData.render.js b/react/src/components/dashboard/walletsData/walletsData.render.js index 2e1432f..4aca129 100644 --- a/react/src/components/dashboard/walletsData/walletsData.render.js +++ b/react/src/components/dashboard/walletsData/walletsData.render.js @@ -12,7 +12,7 @@ export const PaginationItemRender = function(i) { return ( + className={ 'paginate_button' + (this.state.activePage === i + 1 ? ' active' : '') }> this.updateCurrentPage(i + 1) : null }>{ i + 1 } @@ -41,6 +41,8 @@ export const PaginationItemsPerPageSelectorRender = function() { }; export const PaginationRender = function(paginationFrom, paginationTo) { + const disableNextBtn = this.state.activePage >= Math.floor(this.props.ActiveCoin.txhistory.length / this.state.itemsPerPage); + return ( @@ -57,11 +59,11 @@ export const PaginationRender = function(paginationFrom, paginationTo) { - + this.updateCurrentPage(this.state.activePage - 1) }>{ translate('INDEX.PREVIOUS') } { this.renderPaginationItems() } - Math.floor(this.props.ActiveCoin.txhistory.length / this.state.itemsPerPage) ? 'paginate_button next disabled' : 'paginate_button next' }> + this.updateCurrentPage(this.state.activePage + 1) }>{ translate('INDEX.NEXT') } @@ -91,17 +93,6 @@ export const TxHistoryListRender = function(tx, index) { ); }; -export const UseCacheToggleRender = function() { - return ( - - - - - Use cache - - ); -}; - export const AddressListRender = function() { return ( @@ -141,7 +132,7 @@ export const WalletsDataRender = function() { - + { translate('INDEX.BASILISK_ACTIONS') } @@ -181,11 +172,6 @@ export const WalletsDataRender = function() { { translate('INDEX.REFETCH_WALLET_DATA') } - - - Restart Basilisk Instance (unsafe!) - - { translate('INDEX.VIEW_CACHE_DATA') } @@ -216,7 +202,9 @@ export const WalletsDataRender = function() { - + { translate('INDEX.DIRECTION') } @@ -224,11 +212,11 @@ export const WalletsDataRender = function() { { translate('INDEX.AMOUNT') } { translate('INDEX.TIME') } { translate('INDEX.DEST_ADDRESS') } - { translate('INDEX.TX_DETAIL') } + { translate('INDEX.TX_DETAIL') } - { this.renderTxHistoryList() } + { this.renderTxHistoryList() } @@ -237,7 +225,7 @@ export const WalletsDataRender = function() { { translate('INDEX.AMOUNT') } { translate('INDEX.TIME') } { translate('INDEX.DEST_ADDRESS') } - { translate('INDEX.TX_DETAIL') } + { translate('INDEX.TX_DETAIL') } diff --git a/react/src/components/dashboard/walletsNative/walletsNative.js b/react/src/components/dashboard/walletsNative/walletsNative.js index ce31818..0168910 100644 --- a/react/src/components/dashboard/walletsNative/walletsNative.js +++ b/react/src/components/dashboard/walletsNative/walletsNative.js @@ -11,7 +11,7 @@ import Store from '../../../store'; import { SocketProvider } from 'socket.io-react'; import io from 'socket.io-client'; -const socket = io.connect('http://127.0.0.1:' + Config.agamaPort); +const socket = io.connect(`http://127.0.0.1:${Config.agamaPort}`); class WalletsNative extends React.Component { constructor(props) { diff --git a/react/src/components/dashboard/walletsNativeInfo/walletsNativeInfo.render.js b/react/src/components/dashboard/walletsNativeInfo/walletsNativeInfo.render.js index 9a62ad6..07bd784 100644 --- a/react/src/components/dashboard/walletsNativeInfo/walletsNativeInfo.render.js +++ b/react/src/components/dashboard/walletsNativeInfo/walletsNativeInfo.render.js @@ -52,91 +52,91 @@ const WalletsNativeInfoRender = function() { - - { translate('INDEX.VERSION') } - - { this.props.Dashboard.progress.KMDversion } - - - - { translate('INDEX.PROTOCOL_VERSION') } - - { this.props.Dashboard.progress.protocolversion } - - - - { translate('INDEX.NOTARIZED') } - - { this.props.Dashboard.progress.notarized } - - - - - { translate('INDEX.NOTARIZED') } Hash - - - { this.props.Dashboard.progress.notarizedhash ? - this.props.Dashboard.progress.notarizedhash.substring( - 0, - Math.floor(this.props.Dashboard.progress.notarizedhash.length / 2) - ) + - '\t' + - this.props.Dashboard.progress.notarizedhash.substring( - Math.floor(this.props.Dashboard.progress.notarizedhash.length / 2), - this.props.Dashboard.progress.notarizedhash.length - ) - : '' - } - - - - - { translate('INDEX.NOTARIZED') } BTC - - - - - { translate('INDEX.BLOCKS') } - - { this.props.Dashboard.progress.blocks } - - - - { translate('INDEX.CONNECTIONS') } - - { this.props.Dashboard.progress.connections } - - - - { translate('INDEX.DIFFICULTY') } - - { this.props.Dashboard.progress.difficulty } - - - - Testnet - - { this.props.Dashboard.progress.testnet } - - - - { translate('INDEX.PAY_TX_FEE') } - - { this.props.Dashboard.progress.paytxfee } - - - - { translate('INDEX.RELAY_FEE') } - - { this.props.Dashboard.progress.relayfee } - - - - { translate('INDEX.ERRORS') } - - { this.props.Dashboard.progress.errors } - - + + { translate('INDEX.VERSION') } + + { this.props.Dashboard.progress.KMDversion } + + + + { translate('INDEX.PROTOCOL_VERSION') } + + { this.props.Dashboard.progress.protocolversion } + + + + { translate('INDEX.NOTARIZED') } + + { this.props.Dashboard.progress.notarized } + + + + + { translate('INDEX.NOTARIZED') } Hash + + + { this.props.Dashboard.progress.notarizedhash ? + this.props.Dashboard.progress.notarizedhash.substring( + 0, + Math.floor(this.props.Dashboard.progress.notarizedhash.length / 2) + ) + + '\t' + + this.props.Dashboard.progress.notarizedhash.substring( + Math.floor(this.props.Dashboard.progress.notarizedhash.length / 2), + this.props.Dashboard.progress.notarizedhash.length + ) + : '' + } + + + + + { translate('INDEX.NOTARIZED') } BTC + + + + + { translate('INDEX.BLOCKS') } + + { this.props.Dashboard.progress.blocks } + + + + { translate('INDEX.CONNECTIONS') } + + { this.props.Dashboard.progress.connections } + + + + { translate('INDEX.DIFFICULTY') } + + { this.props.Dashboard.progress.difficulty } + + + + Testnet + + { this.props.Dashboard.progress.testnet } + + + + { translate('INDEX.PAY_TX_FEE') } + + { this.props.Dashboard.progress.paytxfee } + + + + { translate('INDEX.RELAY_FEE') } + + { this.props.Dashboard.progress.relayfee } + + + + { translate('INDEX.ERRORS') } + + { this.props.Dashboard.progress.errors } + + diff --git a/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js b/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js index df08fb4..3bc67df 100644 --- a/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js +++ b/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js @@ -67,7 +67,14 @@ class WalletsNativeSend extends React.Component { this.props.ActiveCoin.addresses[type].length) { return this.props.ActiveCoin.addresses[type].map((address) => - this.updateAddressSelection(address.address, type, address.amount) }> [ { address.amount } { this.props.ActiveCoin.coin } ] { type === 'public' ? address.address : address.address.substring(0, 34) + '...' } + this.updateAddressSelection(address.address, type, address.amount) }> + + + [ { address.amount } { this.props.ActiveCoin.coin } ] + { type === 'public' ? address.address : address.address.substring(0, 34) + '...' } + + + ); } else { @@ -79,7 +86,7 @@ class WalletsNativeSend extends React.Component { if (this.state.sendFrom) { return ( - + [ { this.state.sendFromAmount } { this.props.ActiveCoin.coin } ] { this.state.sendFrom } diff --git a/react/src/components/dashboard/walletsNativeSyncProgress/walletsNativeSyncProgress.js b/react/src/components/dashboard/walletsNativeSyncProgress/walletsNativeSyncProgress.js deleted file mode 100644 index 3d49782..0000000 --- a/react/src/components/dashboard/walletsNativeSyncProgress/walletsNativeSyncProgress.js +++ /dev/null @@ -1,147 +0,0 @@ -import React from 'react'; -import { translate } from '../../../translate/translate'; -import { - ChainActivationNotificationRender, - WalletsNativeSyncProgressRender -} from './walletsNativeSyncProgress.render'; - -class WalletsNativeSyncProgress extends React.Component { - renderSyncPercentagePlaceholder() { - if (this.props.Dashboard.progress && - this.props.Dashboard.progress.blocks > 0 && - this.props.Dashboard.progress.longestchain === 0) { - return ( - - { translate('INDEX.SYNC_ERR_LONGESTCHAIN') } - - ); - } else if (this.props.Dashboard.progress && this.props.Dashboard.progress.blocks === 0) { - return ( - - { translate('INDEX.SYNC_ERR_BLOCKS') } - - ); - } else { - if (this.props.Dashboard.progress && - this.props.Dashboard.progress.blocks) { - const syncPercentage = (parseFloat(parseInt(this.props.Dashboard.progress.blocks, 10) * 100 / parseInt(this.props.Dashboard.progress.longestchain, 10)).toFixed(2) + '%').replace('NaN', 0); - - return ( - - { syncPercentage } | { this.props.Dashboard.progress.blocks } / { this.props.Dashboard.progress.longestchain } | { translate('INDEX.CONNECTIONS') }: { this.props.Dashboard.progress.connections } - - ); - } else { - return ( - - { translate('INDEX.LOADING_BLOCKS') } - - ); - } - } - } - - renderActivatingBestChainProgress() { - if (this.props.Settings && - this.props.Settings.debugLog) { - if (this.props.Settings.debugLog.indexOf('UpdateTip') > -1 && - !this.props.Dashboard.progress && - !this.props.Dashboard.progress.blocks) { - const temp = this.props.Settings.debugLog.split(' '); - let currentBestChain; - let currentProgress; - - for (let i = 0; i < temp.length; i++) { - if (temp[i].indexOf('height=') > -1) { - currentBestChain = temp[i].replace('height=', ''); - } - if (temp[i].indexOf('progress=') > -1) { - currentProgress = Number(temp[i].replace('progress=', '')) * 100; - } - } - - // fallback to local data if remote node is inaccessible - if (this.props.Dashboard.progress.remoteKMDNode && - !this.props.Dashboard.progress.remoteKMDNode.blocks) { - return ( - `: ${currentProgress}% (activating)` - ); - } else { - if (this.props.Dashboard.progress.remoteKMDNode && - this.props.Dashboard.progress.remoteKMDNode.blocks) { - return( - `: ${Math.floor(currentBestChain * 100 / this.props.Dashboard.progress.remoteKMDNode.blocks)}% (${ translate('INDEX.BLOCKS_SM') } ${currentBestChain} / ${this.props.Dashboard.progress.remoteKMDNode.blocks})` - ); - } - } - } else if ( - this.props.Settings.debugLog.indexOf('Still rescanning') > -1 && - !this.props.Dashboard.progress || - !this.props.Dashboard.progress.blocks - ) { - const temp = this.props.Settings.debugLog.split(' '); - let currentProgress; - - for (let i = 0; i < temp.length; i++) { - if (temp[i].indexOf('Progress=') > -1) { - currentProgress = (Number(temp[i].replace('Progress=', '')) * 100).toFixed(2); - } - } - - return ( - `: ${currentProgress}% (${ translate('INDEX.RESCAN_SM') })` - ); - } else if ( - this.props.Settings.debugLog.indexOf('LoadExternalBlockFile:') > -1 || - this.props.Settings.debugLog.indexOf('Reindexing block file') > -1 - ) { - return ( - `: (${ translate('INDEX.REINDEX') })` - ); - } else { - return ( - ({ translate('INDEX.DL_BLOCKS') }) - ); - } - } - } - - renderLB(_translationID) { - const _translationComponents = translate(_translationID).split(''); - - return _translationComponents.map((_translation) => - - { _translation } - - - ); - } - - renderChainActivationNotification() { - return ChainActivationNotificationRender.call(this); - - /* if (this.props.Dashboard.progress) { - if ((!this.props.Dashboard.progress.blocks && !this.props.Dashboard.progress.longestchain) || - (this.props.Dashboard.progress.blocks < this.props.Dashboard.progress.longestchain)) { - return ChainActivationNotificationRender.call(this); - } - } else { - return null; - } */ - } - - render() { - if (this.props && - this.props.Dashboard) { - return WalletsNativeSyncProgressRender.call(this); - } - - return null; - } -} - -export default WalletsNativeSyncProgress; diff --git a/react/src/components/dashboard/walletsNativeTxHistory/walletsNativeTxHistory.js b/react/src/components/dashboard/walletsNativeTxHistory/walletsNativeTxHistory.js index 935c907..f26611b 100644 --- a/react/src/components/dashboard/walletsNativeTxHistory/walletsNativeTxHistory.js +++ b/react/src/components/dashboard/walletsNativeTxHistory/walletsNativeTxHistory.js @@ -141,7 +141,7 @@ class WalletsNativeTxHistory extends React.Component { for (let i = 0; i < Math.floor(this.props.ActiveCoin.txhistory.length / this.state.itemsPerPage); i++) { items.push( - + this.updateCurrentPage(i + 1) : null }>{ i + 1 } diff --git a/react/src/components/dashboard/walletsNativeTxHistory/walletsNativeTxHistory.render.js b/react/src/components/dashboard/walletsNativeTxHistory/walletsNativeTxHistory.render.js index e0a72fc..233aac2 100644 --- a/react/src/components/dashboard/walletsNativeTxHistory/walletsNativeTxHistory.render.js +++ b/react/src/components/dashboard/walletsNativeTxHistory/walletsNativeTxHistory.render.js @@ -39,12 +39,11 @@ export const PaginationRender = function(paginationStart, paginationEnd, paginat - + this.updateCurrentPage(this.state.activePage - 1) }>{ translate('INDEX.PREVIOUS') } { this.renderPaginationItems() } - + this.updateCurrentPage(this.state.activePage + 1) }>{ translate('INDEX.NEXT') } diff --git a/react/src/components/dashboard/walletsNav/walletsNav.render.js b/react/src/components/dashboard/walletsNav/walletsNav.render.js index 9a5374d..d740cea 100644 --- a/react/src/components/dashboard/walletsNav/walletsNav.render.js +++ b/react/src/components/dashboard/walletsNav/walletsNav.render.js @@ -1,7 +1,7 @@ import React from 'react'; import { translate } from '../../../translate/translate'; -export const WalletsNavNoWalletRender = function () { +export const WalletsNavNoWalletRender = function() { return ( @@ -20,11 +20,11 @@ export const WalletsNavNoWalletRender = function () { ); }; -export const WalletsNavWithWalletRender = function () { +export const WalletsNavWithWalletRender = function() { return ( diff --git a/react/src/components/dashboard/walletsNotariesList/walletsNotariesList.render.js b/react/src/components/dashboard/walletsNotariesList/walletsNotariesList.render.js index aa64dee..4f45cc4 100644 --- a/react/src/components/dashboard/walletsNotariesList/walletsNotariesList.render.js +++ b/react/src/components/dashboard/walletsNotariesList/walletsNotariesList.render.js @@ -3,7 +3,7 @@ import { translate } from '../../../translate/translate'; import Tree, { TreeNode } from 'rc-tree'; import { animation } from '../../../util/rc-tree-animate'; -export const NotariesListRender = function (node, index) { +export const NotariesListRender = function(node, index) { return ( this.handleKeydown(event) }> - + @@ -119,7 +119,7 @@ const WalletsTxInfoRender = function(txInfo) { - + @@ -137,7 +137,7 @@ const WalletsTxInfoRender = function(txInfo) { - + - + { diff --git a/react/src/components/login/login.render.js b/react/src/components/login/login.render.js index 1cb06e5..5d8c7c0 100644 --- a/react/src/components/login/login.render.js +++ b/react/src/components/login/login.render.js @@ -74,7 +74,7 @@ const LoginRender = function () { onKeyDown={ (event) => this.handleKeydown(event) } value={ this.state.loginPassphrase }>
{ translate('INDEX.DEBUG_LOG_DESC') }
@@ -547,14 +547,14 @@ export const SettingsRender = function() {
{ translate('INDEX.CLI_SELECT_A_COIN') }