Browse Source

merge conflicts fix

all-modes
pbca26 8 years ago
parent
commit
cd27fb7bec
  1. 6
      react/src/actions/actionCreators.js
  2. 147
      react/src/actions/actions/addCoin.js
  3. 91
      react/src/actions/actions/addressBalance.js
  4. 8
      react/src/actions/actions/atomic.js
  5. 78
      react/src/actions/actions/basiliskCache.js
  6. 64
      react/src/actions/actions/basiliskProcessAddress.js
  7. 8
      react/src/actions/actions/basiliskTxHistory.js
  8. 16
      react/src/actions/actions/cli.js
  9. 16
      react/src/actions/actions/coinList.js
  10. 16
      react/src/actions/actions/copyAddress.js
  11. 24
      react/src/actions/actions/createWallet.js
  12. 8
      react/src/actions/actions/dexCoins.js
  13. 16
      react/src/actions/actions/edexBalance.js
  14. 8
      react/src/actions/actions/edexGetTx.js
  15. 8
      react/src/actions/actions/fullTxHistory.js
  16. 16
      react/src/actions/actions/getAddrByAccount.js
  17. 8
      react/src/actions/actions/iguanaHelpers.js
  18. 24
      react/src/actions/actions/iguanaInstance.js
  19. 8
      react/src/actions/actions/log.js
  20. 8
      react/src/actions/actions/logout.js
  21. 8
      react/src/actions/actions/nativeBalance.js
  22. 34
      react/src/actions/actions/nativeNewAddress.js
  23. 43
      react/src/actions/actions/nativeSend.js
  24. 24
      react/src/actions/actions/nativeSyncInfo.js
  25. 8
      react/src/actions/actions/nativeTxHistory.js
  26. 47
      react/src/actions/actions/notary.js
  27. 8
      react/src/actions/actions/openAlias.js
  28. 40
      react/src/actions/actions/sendFullBasilisk.js
  29. 119
      react/src/actions/actions/settings.js
  30. 8
      react/src/actions/actions/syncInfo.js
  31. 26
      react/src/actions/actions/syncOnly.js
  32. 8
      react/src/actions/actions/sysInfo.js
  33. 48
      react/src/actions/actions/walletAuth.js
  34. 65
      react/src/components/addcoin/addcoin.js
  35. 32
      react/src/components/addcoin/addcoin.render.js
  36. 43
      react/src/components/addcoin/coin-selectors.render.js
  37. 14
      react/src/components/dashboard/atomic/atomic.js
  38. 16
      react/src/components/dashboard/atomic/atomic.render.js
  39. 6
      react/src/components/dashboard/coinTile/coinTile.js
  40. 14
      react/src/components/dashboard/coinTile/coinTile.render.js
  41. 50
      react/src/components/dashboard/coinTile/coinTileItem.js
  42. 8
      react/src/components/dashboard/coinTile/coinTileItem.render.js
  43. 160
      react/src/components/dashboard/jumblr/jumblr.render.js
  44. 37
      react/src/components/dashboard/navbar/navbar.js
  45. 23
      react/src/components/dashboard/navbar/navbar.render.js
  46. 9
      react/src/components/dashboard/notifications/notifications.js
  47. 34
      react/src/components/dashboard/notifications/notifications.render.js
  48. 14
      react/src/components/dashboard/receiveCoin/receiveCoin.js
  49. 42
      react/src/components/dashboard/receiveCoin/receiveCoin.render.js
  50. 153
      react/src/components/dashboard/sendCoin/sendCoin.js
  51. 111
      react/src/components/dashboard/sendCoin/sendCoin.render.js
  52. 46
      react/src/components/dashboard/settings/settings.js
  53. 88
      react/src/components/dashboard/settings/settings.render.js
  54. 32
      react/src/components/dashboard/syncOnly/syncOnly.js
  55. 8
      react/src/components/dashboard/syncOnly/syncOnly.render.js
  56. 17
      react/src/components/dashboard/walletsBalance/walletsBalance.render.js
  57. 17
      react/src/components/dashboard/walletsBasiliskConnection/walletsBasiliskConnection.render.js
  58. 36
      react/src/components/dashboard/walletsCacheData/walletsCacheData.js
  59. 4
      react/src/components/dashboard/walletsCacheData/walletsCacheData.render.js
  60. 75
      react/src/components/dashboard/walletsData/walletsData.js
  61. 10
      react/src/components/dashboard/walletsData/walletsData.render.js
  62. 21
      react/src/components/dashboard/walletsHeader/walletsHeader.render.js
  63. 10
      react/src/components/dashboard/walletsNative/walletsNative.render.js
  64. 4
      react/src/components/dashboard/walletsNativeAlert/walletsNativeAlert.render.js
  65. 28
      react/src/components/dashboard/walletsNativeBalance/walletsNativeBalance.render.js
  66. 58
      react/src/components/dashboard/walletsNativeInfo/walletsNativeInfo.render.js
  67. 28
      react/src/components/dashboard/walletsNativeReceive/walletsNativeReceive.js
  68. 24
      react/src/components/dashboard/walletsNativeReceive/walletsNativeReceive.render.js
  69. 51
      react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js
  70. 28
      react/src/components/dashboard/walletsNativeSend/walletsNativeSend.render.js
  71. 4
      react/src/components/dashboard/walletsNativeSyncProgress/walletsNativeSyncProgress.render.js
  72. 28
      react/src/components/dashboard/walletsNativeTxHistory/walletsNativeTxHistory.js
  73. 27
      react/src/components/dashboard/walletsNativeTxHistory/walletsNativeTxHistory.render.js
  74. 6
      react/src/components/dashboard/walletsNativeTxInfo/walletsNativeTxInfo.render.js
  75. 18
      react/src/components/dashboard/walletsNav/walletsNav.js
  76. 12
      react/src/components/dashboard/walletsNav/walletsNav.render.js
  77. 4
      react/src/components/dashboard/walletsNotariesList/walletsNotariesList.js
  78. 24
      react/src/components/dashboard/walletsNotariesList/walletsNotariesList.render.js
  79. 4
      react/src/components/dashboard/walletsProgress/walletsProgress.render.js
  80. 4
      react/src/components/dashboard/walletsTxInfo/walletsTxInfo.render.js
  81. 21
      react/src/components/login/login.js
  82. 33
      react/src/components/login/login.render.js
  83. 25
      react/src/components/login/login.scss
  84. 312
      react/src/components/overrides.scss
  85. 4
      react/src/components/toaster/toaster-item.js
  86. 58
      react/src/reducers/dashboard.js
  87. 7
      react/src/reducers/toaster.js
  88. 11
      react/src/store.js
  89. 7
      react/src/translate/translate.js
  90. 4
      react/src/util/cacheFormat.js
  91. 6
      react/src/util/copyToClipboard.js
  92. 61
      react/src/util/time.js

6
react/src/actions/actionCreators.js

@ -314,7 +314,11 @@ export function setBasiliskMainAddress(json, coin, mode) {
}
if (mode === 'basilisk') {
getDexBalance(coin, mode, json.result);
getDexBalance(
coin,
mode,
json.result
);
}
return {

147
react/src/actions/actions/addCoin.js

@ -53,18 +53,38 @@ export function addCoin(coin, mode, syncOnly, port) {
.then(function(json) {
setTimeout(function() {
console.log(`started ${coin} / ${modeToValue[mode]} fork`, json);
dispatch(iguanaAddCoin(coin, mode, _acData, json.result));
dispatch(
iguanaAddCoin(
coin,
mode,
_acData,
json.result
)
);
}, 2000);
});
}
} else {
if (port) {
return dispatch => {
dispatch(iguanaAddCoin(coin, mode, _acData, port));
dispatch(
iguanaAddCoin(
coin,
mode,
_acData,
port
)
);
}
} else {
return dispatch => {
dispatch(iguanaAddCoin(coin, mode, _acData));
dispatch(
iguanaAddCoin(
coin,
mode,
_acData
)
);
}
}
}
@ -95,7 +115,13 @@ export function iguanaAddCoin(coin, mode, acData, port) {
'status': 'error',
'response': error,
}));
dispatch(triggerToaster(translate('TOASTR.FAILED_TO_ADDCOIN'), translate('TOASTR.ACCOUNT_NOTIFICATION'), 'error'));
dispatch(
triggerToaster(
translate('TOASTR.FAILED_TO_ADDCOIN'),
translate('TOASTR.ACCOUNT_NOTIFICATION'),
'error'
)
);
})
.then(response => response.json())
.then(json => {
@ -104,7 +130,13 @@ export function iguanaAddCoin(coin, mode, acData, port) {
'status': 'success',
'response': json,
}));
dispatch(addCoinResult(coin, mode, acData));
dispatch(
addCoinResult(
coin,
mode,
acData
)
);
});
}
@ -152,14 +184,31 @@ export function shepherdHerd(coin, mode, path) {
}
if (checkCoinType(coin) === 'crypto') {
acData = startCrypto(path.result, coin, mode);
acData = startCrypto(
path.result,
coin,
mode
);
}
if (checkCoinType(coin) === 'currency_ac') {
acData = startCurrencyAssetChain(path.result, coin, mode);
acData = startCurrencyAssetChain(
path.result,
coin,
mode
);
}
if (checkCoinType(coin) === 'ac') {
acData = startAssetChain(path.result, coin, mode);
const supply = startAssetChain(path.result, coin, mode, true);
const supply = startAssetChain(
path.result,
coin,
mode,
true
);
acData = startAssetChain(
path.result,
coin,
mode
);
herdData.ac_options.push(`-ac_supply=${supply}`);
}
@ -176,10 +225,24 @@ export function shepherdHerd(coin, mode, path) {
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster(translate('FAILED_SHEPHERD_HERD'), translate('TOASTR.SERVICE_NOTIFICATION'), 'error'));
dispatch(
triggerToaster(
translate('FAILED_SHEPHERD_HERD'),
translate('TOASTR.SERVICE_NOTIFICATION'),
'error'
)
);
})
.then(response => response.json())
.then(json => dispatch(iguanaAddCoin(coin, mode, acData)));
.then(
json => dispatch(
iguanaAddCoin(
coin,
mode,
acData
)
)
);
}
}
@ -191,7 +254,13 @@ export function addCoinResult(coin, mode) {
};
return dispatch => {
dispatch(triggerToaster(`${coin} ${translate('TOASTR.STARTED_IN')} ${modeToValue[mode]} ${translate('TOASTR.MODE')}`, translate('TOASTR.COIN_NOTIFICATION'), 'success'));
dispatch(
triggerToaster(
`${coin} ${translate('TOASTR.STARTED_IN')} ${modeToValue[mode]} ${translate('TOASTR.MODE')}`,
translate('TOASTR.COIN_NOTIFICATION'),
'success'
)
);
dispatch(toggleAddcoinModal(false, false));
dispatch(getDexCoins());
}
@ -208,10 +277,24 @@ export function _shepherdGetConfig(coin, mode) {
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster('Failed to get mode config', 'Error', 'error'));
dispatch(
triggerToaster(
'Failed to get mode config',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => dispatch(shepherdHerd(coin, mode, json)));
.then(
json => dispatch(
shepherdHerd(
coin,
mode,
json
)
)
);
}
}
@ -228,10 +311,24 @@ export function shepherdGetConfig(coin, mode) {
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster('Failed to get KMD config', 'Error', 'error'));
dispatch(
triggerToaster(
'Failed to get KMD config',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => dispatch(shepherdHerd(coin, mode, json)))
.then(
json => dispatch(
shepherdHerd(
coin,
mode,
json
)
)
)
}
} else {
return dispatch => {
@ -244,10 +341,24 @@ export function shepherdGetConfig(coin, mode) {
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster('Failed to get mode config', 'Error', 'error'));
dispatch(
triggerToaster(
'Failed to get mode config',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => dispatch(shepherdHerd(coin, mode, json)));
.then(
json => dispatch(
shepherdHerd(
coin,
mode,
json
)
)
);
}
}
}

91
react/src/actions/actions/addressBalance.js

@ -89,7 +89,13 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster('getKMDAddressesNative+addresslist+cache', 'Error', 'error'));
dispatch(
triggerToaster(
'getKMDAddressesNative+addresslist+cache',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(function(json) {
@ -121,7 +127,13 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
'status': 'error',
'response': error,
}));
dispatch(triggerToaster('getKMDAddressesNative', 'Error', 'error'));
dispatch(
triggerToaster(
'getKMDAddressesNative',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => {
@ -205,13 +217,12 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
}
}
if (isNewAddr) {
if (allAddrArray[a].substring(0, 2) === 'zc' ||
allAddrArray[a].substring(0, 2) === 'zt') {
result[1][result[1].length] = allAddrArray[a];
} else {
result[0][result[0].length] = allAddrArray[a];
}
if (isNewAddr &&
(allAddrArray[a].substring(0, 2) === 'zc' ||
allAddrArray[a].substring(0, 2) === 'zt')) {
result[1][result[1].length] = allAddrArray[a];
} else {
result[0][result[0].length] = allAddrArray[a];
}
}
}
@ -235,11 +246,6 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
sum += filteredArray[i];
}
if (sum === 0 &&
a === 1) {
}
newAddressArray[a][b] = {
address: result[a][b],
amount: currentAddress === result[a][b] || mode === 'native' ? sum : 'N/A',
@ -256,7 +262,8 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
const _timestamp = Date.now();
let ajaxDataToHex = `["${_address}"]`;
iguanaHashHex(ajaxDataToHex, dispatch).then((hashHexJson) => {
iguanaHashHex(ajaxDataToHex, dispatch)
.then((hashHexJson) => {
if (getPassthruAgent(coin) === 'iguana') {
payload = {
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
@ -296,7 +303,13 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
'status': 'error',
'response': error,
}));
dispatch(triggerToaster('getKMDAddressesNative+ZBalance', 'Error', 'error'));
dispatch(
triggerToaster(
'getKMDAddressesNative+ZBalance',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(function(json) {
@ -308,7 +321,13 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
'status': 'error',
'response': json,
}));
dispatch(triggerToaster('getKMDAddressesNative+ZBalance', 'Error', 'error'));
dispatch(
triggerToaster(
'getKMDAddressesNative+ZBalance',
'Error',
'error'
)
);
} else {
resolve(json);
newAddressArray[1][index] = {
@ -351,7 +370,13 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster('getKMDAddressesNative+addresslist+cache', 'Error', 'error'));
dispatch(
triggerToaster(
'getKMDAddressesNative+addresslist+cache',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(function(json) {
@ -383,7 +408,13 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
'status': 'error',
'response': error,
}));
dispatch(triggerToaster('getKMDAddressesNative+Balance', 'Error', 'error'));
dispatch(
triggerToaster(
'getKMDAddressesNative+Balance',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(function(json) {
@ -398,7 +429,12 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
'timestamp': Date.now(),
};
dispatch(shepherdGroomPost(pubkey, updatedCache));
calcBalance(result, json, dispatch, mode);
calcBalance(
result,
json,
dispatch,
mode
);
})
}
})
@ -424,7 +460,13 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
'status': 'error',
'response': error,
}));
dispatch(triggerToaster('getKMDAddressesNative+Balance', 'Error', 'error'));
dispatch(
triggerToaster(
'getKMDAddressesNative+Balance',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(function(json) {
@ -433,7 +475,12 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
'status': 'success',
'response': json,
}));
calcBalance(result, json, dispatch, mode);
calcBalance(
result,
json,
dispatch,
mode
);
})
}
})

8
react/src/actions/actions/atomic.js

@ -31,7 +31,13 @@ export function atomic(payload) {
'status': 'error',
'response': error,
}));
dispatch(triggerToaster(payload.method, 'Atomic Explorer error', 'error'));
dispatch(
triggerToaster(
payload.method,
'Atomic Explorer error',
'error'
)
);
})
.then(response => response.json())
.then(json => {

78
react/src/actions/actions/basiliskCache.js

@ -19,10 +19,20 @@ export function deleteCacheFile(_payload) {
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster('deleteCacheFile', 'Error', 'error'))
dispatch(
triggerToaster(
'deleteCacheFile',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => dispatch(fetchNewCacheData(_payload)));
.then(
json => dispatch(
fetchNewCacheData(_payload)
)
);
}
}
@ -38,7 +48,13 @@ export function getCacheFile(pubkey) {
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster('getCacheFile', 'Error', 'error'))
dispatch(
triggerToaster(
'getCacheFile',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => resolve(json))
@ -63,7 +79,13 @@ export function fetchNewCacheData(_payload) {
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster('fetchNewCacheData', 'Error', 'error'));
dispatch(
triggerToaster(
'fetchNewCacheData',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => console.log(json))
@ -80,10 +102,24 @@ export function getShepherdCache(pubkey, coin) {
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster('getShepherdCache', 'Error', 'error'));
dispatch(
triggerToaster(
'getShepherdCache',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => dispatch(getShepherdCacheState(json, pubkey, coin)))
.then(
json => dispatch(
getShepherdCacheState(
json,
pubkey,
coin
)
)
)
}
}
@ -125,10 +161,20 @@ export function fetchUtxoCache(_payload) {
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster('fetchNewCacheData', 'Error', 'error'));
dispatch(
triggerToaster(
'fetchNewCacheData',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => dispatch(getShepherdCache(_pubkey)))
.then(
json => dispatch(
getShepherdCache(_pubkey)
)
)
}
}
@ -146,7 +192,13 @@ export function shepherdGroomPost(_filename, _payload) {
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster('shepherdGroomPost', 'Error', 'error'));
dispatch(
triggerToaster(
'shepherdGroomPost',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => console.log(json))
@ -167,7 +219,13 @@ export function shepherdGroomPostPromise(_filename, _payload) {
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster('shepherdGroomPostPromise', 'Error', 'error'));
dispatch(
triggerToaster(
'shepherdGroomPostPromise',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => resolve(json))

64
react/src/actions/actions/basiliskProcessAddress.js

@ -39,7 +39,13 @@ export function checkAddressBasilisk(coin, address) {
'status': 'error',
'response': error,
}));
dispatch(triggerToaster('checkAddressBasilisk', 'Error', 'error'));
dispatch(
triggerToaster(
'checkAddressBasilisk',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => {
@ -57,7 +63,13 @@ function checkAddressBasiliskHandle(json) {
if (json &&
json.error) {
return dispatch => {
dispatch(triggerToaster(json.error, translate('TOASTR.WALLET_NOTIFICATION'), 'error'));
dispatch(
triggerToaster(
json.error,
translate('TOASTR.WALLET_NOTIFICATION'),
'error'
)
);
}
}
@ -65,7 +77,13 @@ function checkAddressBasiliskHandle(json) {
json.coin &&
json.randipbits) {
return dispatch => {
dispatch(triggerToaster('Address already registered', translate('TOASTR.WALLET_NOTIFICATION'), 'warning'));
dispatch(
triggerToaster(
'Address already registered',
translate('TOASTR.WALLET_NOTIFICATION'),
'warning'
)
);
}
}
}
@ -101,7 +119,13 @@ export function validateAddressBasilisk(coin, address) {
'status': 'error',
'response': error,
}));
dispatch(triggerToaster('validateAddressBasilisk', 'Error', 'error'));
dispatch(
triggerToaster(
'validateAddressBasilisk',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => {
@ -118,16 +142,40 @@ export function validateAddressBasilisk(coin, address) {
function validateAddressBasiliskHandle(json) {
return dispatch => {
if (json.iswatchonly === true) {
dispatch(triggerToaster(translate('TOASTR.VALIDATION_SUCCESS'), translate('TOASTR.BASILISK_NOTIFICATION'), 'error'));
dispatch(
triggerToaster(
translate('TOASTR.VALIDATION_SUCCESS'),
translate('TOASTR.BASILISK_NOTIFICATION'),
'error'
)
);
}
if (json.iswatchonly === false) {
dispatch(triggerToaster(translate('TOASTR.ADDR_ISNT_REG'), translate('TOASTR.BASILISK_NOTIFICATION'), 'error'));
dispatch(
triggerToaster(
translate('TOASTR.ADDR_ISNT_REG'),
translate('TOASTR.BASILISK_NOTIFICATION'),
'error'
)
);
}
if (json.iswatchonly === undefined) {
dispatch(triggerToaster(translate('TOASTR.INVALID_QUERY_ALT'), translate('TOASTR.BASILISK_NOTIFICATION'), 'error'));
dispatch(
triggerToaster(
translate('TOASTR.INVALID_QUERY_ALT'),
translate('TOASTR.BASILISK_NOTIFICATION'),
'error'
)
);
}
if (json.error === 'less than required responses') {
dispatch(triggerToaster(translate('TOASTR.LESS_RESPONSES_REQ'), translate('TOASTR.BASILISK_NOTIFICATION'), 'error'));
dispatch(
triggerToaster(
translate('TOASTR.LESS_RESPONSES_REQ'),
translate('TOASTR.BASILISK_NOTIFICATION'),
'error'
)
);
}
}
}

8
react/src/actions/actions/basiliskTxHistory.js

@ -20,7 +20,13 @@ export function getBasiliskTransactionsList(coin, address) {
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster('getBasiliskTransactionsList+cache', 'Error', 'error'));
dispatch(
triggerToaster(
'getBasiliskTransactionsList+cache',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(function(json) {

16
react/src/actions/actions/cli.js

@ -25,7 +25,13 @@ export function shepherdCliPromise(mode, chain, cmd) {
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster('shepherdCli', 'Error', 'error'));
dispatch(
triggerToaster(
'shepherdCli',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => resolve(json))
@ -49,7 +55,13 @@ export function shepherdCli(mode, chain, cmd) {
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster('shepherdCli', 'Error', 'error'));
dispatch(
triggerToaster(
'shepherdCli',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => dispatch(cliResponseState(json)))

16
react/src/actions/actions/coinList.js

@ -17,7 +17,13 @@ export function shepherdGetCoinList() {
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster('shepherdGetCoinList', 'Error', 'error'));
dispatch(
triggerToaster(
'shepherdGetCoinList',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => resolve(json))
@ -35,7 +41,13 @@ export function shepherdPostCoinList(data) {
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster('shepherdPostCoinList', 'Error', 'error'));
dispatch(
triggerToaster(
'shepherdPostCoinList',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => resolve(json))

16
react/src/actions/actions/copyAddress.js

@ -7,11 +7,23 @@ export function copyCoinAddress(address) {
if (_result) {
return dispatch => {
dispatch(triggerToaster(translate('DASHBOARD.ADDR_COPIED'), translate('TOASTR.COIN_NOTIFICATION'), 'success'));
dispatch(
triggerToaster(
translate('DASHBOARD.ADDR_COPIED'),
translate('TOASTR.COIN_NOTIFICATION'),
'success'
)
);
}
} else {
return dispatch => {
dispatch(triggerToaster('Couldn\'t copy address to clipboard', translate('TOASTR.COIN_NOTIFICATION'), 'error'));
dispatch(
triggerToaster(
'Couldn\'t copy address to clipboard',
translate('TOASTR.COIN_NOTIFICATION'),
'error'
)
);
}
}
}

24
react/src/actions/actions/createWallet.js

@ -13,11 +13,23 @@ function createNewWalletState(json) {
json.result &&
json.result === 'success') {
return dispatch => {
dispatch(triggerToaster(translate('TOASTR.WALLET_CREATED_SUCCESFULLY'), translate('TOASTR.ACCOUNT_NOTIFICATION'), 'success'));
dispatch(
triggerToaster(
translate('TOASTR.WALLET_CREATED_SUCCESFULLY'),
translate('TOASTR.ACCOUNT_NOTIFICATION'),
'success'
)
);
}
} else {
return dispatch => {
dispatch(triggerToaster('Couldn\'t create new wallet seed', translate('TOASTR.ACCOUNT_NOTIFICATION'), 'error'));
dispatch(
triggerToaster(
'Couldn\'t create new wallet seed',
translate('TOASTR.ACCOUNT_NOTIFICATION'),
'error'
)
);
}
}
}
@ -52,7 +64,13 @@ export function createNewWallet(_passphrase) {
'status': 'error',
'response': error,
}));
dispatch(triggerToaster('createNewWallet', 'Error', 'error'));
dispatch(
triggerToaster(
'createNewWallet',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => {

8
react/src/actions/actions/dexCoins.js

@ -37,7 +37,13 @@ export function getDexCoins() {
'status': 'error',
'response': error,
}));
dispatch(triggerToaster('Error getDexCoins', 'Error', 'error'));
dispatch(
triggerToaster(
'Error getDexCoins',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => {

16
react/src/actions/actions/edexBalance.js

@ -39,7 +39,13 @@ export function iguanaEdexBalance(coin) {
'status': 'error',
'response': error,
}));
dispatch(triggerToaster('Error iguanaEdexBalance', 'Error', 'error'));
dispatch(
triggerToaster(
'Error iguanaEdexBalance',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => dispatch(iguanaEdexBalanceState(json)));
@ -86,7 +92,13 @@ export function getDexBalance(coin, mode, addr) {
'status': 'error',
'response': error,
}));
dispatch(triggerToaster('getDexBalance', 'Error', 'error'));
dispatch(
triggerToaster(
'getDexBalance',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => {

8
react/src/actions/actions/edexGetTx.js

@ -39,7 +39,13 @@ export function edexGetTransaction(data, dispatch) {
'status': 'error',
'response': error,
}));
dispatch(triggerToaster('edexGetTransaction', 'Error', 'error'));
dispatch(
triggerToaster(
'edexGetTransaction',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => {

8
react/src/actions/actions/fullTxHistory.js

@ -42,7 +42,13 @@ export function getFullTransactionsList(coin) {
'status': 'error',
'response': error,
}));
dispatch(triggerToaster('getFullTransactionsList', 'Error', 'error'));
dispatch(
triggerToaster(
'getFullTransactionsList',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => {

16
react/src/actions/actions/getAddrByAccount.js

@ -61,7 +61,13 @@ export function getAddressesByAccount(coin, mode) {
'response': error,
}));
dispatch(updateErrosStack('activeHandle'));
dispatch(triggerToaster('getAddressesByAccount', 'Error', 'error'));
dispatch(
triggerToaster(
'getAddressesByAccount',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => {
@ -70,7 +76,13 @@ export function getAddressesByAccount(coin, mode) {
'status': 'success',
'response': json,
}));
dispatch(getAddressesByAccountState(json, coin, mode));
dispatch(
getAddressesByAccountState(
json,
coin,
mode
)
);
})
}
}

8
react/src/actions/actions/iguanaHelpers.js

@ -49,7 +49,13 @@ export function iguanaHashHex(data, dispatch) {
'status': 'error',
'response': error,
}));
dispatch(triggerToaster('iguanaHashHex', 'Error', 'error'));
dispatch(
triggerToaster(
'iguanaHashHex',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => {

24
react/src/actions/actions/iguanaInstance.js

@ -17,7 +17,13 @@ export function restartIguanaInstance(pmid) {
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster('restartIguanaInstance', 'Error', 'error'));
dispatch(
triggerToaster(
'restartIguanaInstance',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => resolve(json))
@ -54,7 +60,13 @@ export function startIguanaInstance(mode, coin) {
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster('startIguanaInstance', 'Error', 'error'));
dispatch(
triggerToaster(
'startIguanaInstance',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => resolve(json))
@ -71,7 +83,13 @@ export function getIguanaInstancesList() {
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster('getIguanaInstanceList', 'Error', 'error'));
dispatch(
triggerToaster(
'getIguanaInstanceList',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => resolve(json))

8
react/src/actions/actions/log.js

@ -34,7 +34,13 @@ export function getAgamaLog(type) {
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster('getAgamaLog', 'Error', 'error'));
dispatch(
triggerToaster(
'getAgamaLog',
'Error',
'error'
)
);
})
.then(response => response.json())
.then()

8
react/src/actions/actions/logout.js

@ -52,7 +52,13 @@ function walletLock() {
'status': 'error',
'response': error,
}));
dispatch(triggerToaster('walletLock', 'Error', 'error'));
dispatch(
triggerToaster(
'walletLock',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => {

8
react/src/actions/actions/nativeBalance.js

@ -77,7 +77,13 @@ export function getKMDBalanceTotal(coin) {
'status': 'error',
'response': error,
}));
dispatch(triggerToaster('getKMDBalanceTotal', 'Error', 'error'));
dispatch(
triggerToaster(
'getKMDBalanceTotal',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(function(json) { // TODO: figure out why komodod spits out "parse error"

34
react/src/actions/actions/nativeNewAddress.js

@ -11,7 +11,13 @@ import {
} from './log';
function handleGetNewKMDAddresses(pubpriv, coin, dispatch) {
dispatch(triggerToaster(translate('KMD_NATIVE.NEW_ADDR_GENERATED'), translate('TOASTR.WALLET_NOTIFICATION'), 'success'));
dispatch(
triggerToaster(
translate('KMD_NATIVE.NEW_ADDR_GENERATED'),
translate('TOASTR.WALLET_NOTIFICATION'),
'success'
)
);
dispatch(getKMDAddressesNative(coin));
return {};
@ -69,7 +75,13 @@ export function getNewKMDAddresses(coin, pubpriv) {
'status': 'error',
'response': error,
}));
dispatch(triggerToaster('getNewKMDAddresses', 'Error', 'error'));
dispatch(
triggerToaster(
'getNewKMDAddresses',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => {
@ -78,10 +90,22 @@ export function getNewKMDAddresses(coin, pubpriv) {
'status': 'success',
'response': json,
}));
dispatch(handleGetNewKMDAddresses(pubpriv, coin, dispatch));
dispatch(
handleGetNewKMDAddresses(
pubpriv,
coin,
dispatch
)
);
})
.catch(function(ex) {
dispatch(handleGetNewKMDAddresses(pubpriv, coin, dispatch))
})
dispatch(
handleGetNewKMDAddresses(
pubpriv,
coin,
dispatch
)
);
});
}
}

43
react/src/actions/actions/nativeSend.js

@ -67,7 +67,13 @@ export function sendNativeTx(coin, _payload) {
'status': 'error',
'response': error,
}));
dispatch(triggerToaster('sendNativeTx', 'Error', 'error'));
dispatch(
triggerToaster(
'sendNativeTx',
'Error',
'error'
)
);
})
.then(function(response) {
const _response = response.text().then(function(text) { return text; });
@ -82,13 +88,34 @@ export function sendNativeTx(coin, _payload) {
if (json.indexOf('"code":') > -1) {
const _message = json.substring(json.indexOf('"message":"') + 11, json.indexOf('"},"id":"jl777"'));
dispatch(triggerToaster(true, _message, translate('TOASTR.WALLET_NOTIFICATION'), 'error'));
dispatch(
triggerToaster(
true,
_message,
translate('TOASTR.WALLET_NOTIFICATION'),
'error'
)
);
if (json.indexOf('"code":-4') > -1) {
dispatch(triggerToaster(true, 'Your wallet.dat is not matching the blockchain. Please resync from the scratch.', translate('TOASTR.WALLET_NOTIFICATION'), 'info'));
dispatch(
triggerToaster(
true,
'Your wallet.dat is not matching the blockchain. Please resync from the scratch.',
translate('TOASTR.WALLET_NOTIFICATION'),
'info'
)
);
}
} else {
dispatch(triggerToaster(translate('TOASTR.TX_SENT_ALT'), translate('TOASTR.WALLET_NOTIFICATION'), 'success'));
dispatch(
triggerToaster(
translate('TOASTR.TX_SENT_ALT'),
translate('TOASTR.WALLET_NOTIFICATION'),
'success'
)
);
}
})
});
@ -162,7 +189,13 @@ export function getKMDOPID(opid, coin) {
'status': 'error',
'response': error,
}));
dispatch(triggerToaster('getKMDOPID', 'Error', 'error'));
dispatch(
triggerToaster(
'getKMDOPID',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => {

24
react/src/actions/actions/nativeSyncInfo.js

@ -34,7 +34,13 @@ export function getSyncInfoNativeKMD(skipDebug) {
'status': 'error',
'response': error,
}));
dispatch(triggerToaster('getSyncInfoNativeKMD', 'Error', 'error'));
dispatch(
triggerToaster(
'getSyncInfoNativeKMD',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => {
@ -120,7 +126,13 @@ export function getSyncInfoNative(coin, skipDebug) {
'status': 'error',
'response': error,
}));
dispatch(triggerToaster('getSyncInfo', 'Error', 'error'));
dispatch(
triggerToaster(
'getSyncInfo',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => {
@ -129,7 +141,13 @@ export function getSyncInfoNative(coin, skipDebug) {
'status': 'success',
'response': json,
}));
dispatch(getSyncInfoNativeState(json, coin, skipDebug));
dispatch(
getSyncInfoNativeState(
json,
coin,
skipDebug
)
);
})
}
}

8
react/src/actions/actions/nativeTxHistory.js

@ -76,7 +76,13 @@ export function getNativeTxHistory(coin) {
'status': 'error',
'response': error,
}));
dispatch(triggerToaster('getNativeTxHistory', 'Error', 'error'));
dispatch(
triggerToaster(
'getNativeTxHistory',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => {

47
react/src/actions/actions/notary.js

@ -44,7 +44,13 @@ function initNotaryNodesConSequence(nodes) {
'status': 'error',
'response': error,
}));
dispatch(triggerToaster(`getInfoDexNode+${node}`, 'Error', 'error'));
dispatch(
triggerToaster(
`getInfoDexNode+${node}`,
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => {
@ -53,7 +59,14 @@ function initNotaryNodesConSequence(nodes) {
'status': 'success',
'response': json,
}));
dispatch(updateNotaryNodeConState(json, nodes.length, index, node));
dispatch(
updateNotaryNodeConState(
json,
nodes.length,
index,
node
)
);
})
});
}));
@ -114,17 +127,33 @@ export function connectNotaries() {
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster('connectNotaries', 'Error', 'error'));
dispatch(
triggerToaster(
'connectNotaries',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => dispatch(connectAllNotaryNodes(json, dispatch)))
.then(
json => dispatch(
connectAllNotaryNodes(json, dispatch)
)
)
}
}
function getDexNotariesState(json) {
if (json.error === 'less than required responses') {
return dispatch => {
dispatch(triggerToaster(translate('TOASTR.LESS_RESPONSES_REQ'), translate('TOASTR.BASILISK_NOTIFICATION'), 'error'));
dispatch(
triggerToaster(
translate('TOASTR.LESS_RESPONSES_REQ'),
translate('TOASTR.BASILISK_NOTIFICATION'),
'error'
)
);
}
} else {
return {
@ -163,7 +192,13 @@ export function getDexNotaries(coin) {
'status': 'error',
'response': error,
}));
dispatch(triggerToaster('getDexNotaries', 'Error', 'error'));
dispatch(
triggerToaster(
'getDexNotaries',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => {

8
react/src/actions/actions/openAlias.js

@ -13,7 +13,13 @@ export function resolveOpenAliasAddress(email) {
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster('resolveOpenAliasAddress', 'Error', 'error'));
dispatch(
triggerToaster(
'resolveOpenAliasAddress',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => resolve(json))

40
react/src/actions/actions/sendFullBasilisk.js

@ -45,7 +45,13 @@ export function sendToAddress(coin, _payload) {
'status': 'error',
'response': error,
}));
dispatch(triggerToaster('sendToAddress', 'Error', 'error'));
dispatch(
triggerToaster(
'sendToAddress',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => {
@ -95,7 +101,13 @@ export function sendFromAddress(coin, _payload) {
'status': 'error',
'response': error,
}));
dispatch(triggerToaster('sendFromAddress', 'Error', 'error'));
dispatch(
triggerToaster(
'sendFromAddress',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => {
@ -148,7 +160,13 @@ export function iguanaUTXORawTX(data, dispatch) {
'status': 'error',
'response': error,
}));
dispatch(triggerToaster('iguanaUTXORawTX', 'Error', 'error'));
dispatch(
triggerToaster(
'iguanaUTXORawTX',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => {
@ -193,7 +211,13 @@ export function dexSendRawTX(data, dispatch) {
'status': 'error',
'response': error,
}));
dispatch(triggerToaster('dexSendRawTX', 'Error', 'error'));
dispatch(
triggerToaster(
'dexSendRawTX',
'Error',
'error'
)
);
})
.then(function(response) {
const _response = response.text().then(function(text) { return text; });
@ -221,7 +245,13 @@ function sendToAddressState(json, dispatch) {
lastSendToResponse: json,
}
} else if (json && json.result && json.complete) {
dispatch(triggerToaster(translate('TOASTR.TX_SENT_ALT'), translate('TOASTR.WALLET_NOTIFICATION'), 'success'));
dispatch(
triggerToaster(
translate('TOASTR.TX_SENT_ALT'),
translate('TOASTR.WALLET_NOTIFICATION'),
'success'
)
);
return {
type: DASHBOARD_ACTIVE_COIN_SENDTO,

119
react/src/actions/actions/settings.js

@ -32,7 +32,13 @@ export function getAppInfo() {
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster('getAppInfo', 'Error', 'error'));
dispatch(
triggerToaster(
'getAppInfo',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => dispatch(getAppInfoState(json)))
@ -50,19 +56,37 @@ export function settingsWifkeyState(json, coin) {
function parseImportPrivKeyResponse(json, dispatch) {
if (json.error === 'illegal privkey') {
return dispatch => {
dispatch(triggerToaster('Illegal privkey', translate('TOASTR.SETTINGS_NOTIFICATION'), 'error'));
dispatch(
triggerToaster(
'Illegal privkey',
translate('TOASTR.SETTINGS_NOTIFICATION'),
'error'
)
);
}
}
if (json.error === 'privkey already in wallet') {
return dispatch => {
dispatch(triggerToaster('Privkey already in wallet', translate('TOASTR.SETTINGS_NOTIFICATION'), 'warning'));
dispatch(
triggerToaster(
'Privkey already in wallet',
translate('TOASTR.SETTINGS_NOTIFICATION'),
'warning'
)
);
}
}
if (json &&
json.result !== undefined &&
json.result == 'success') {
return dispatch => {
dispatch(triggerToaster(translate('TOASTR.PRIV_KEY_IMPORTED'), translate('TOASTR.SETTINGS_NOTIFICATION'), 'success'));
dispatch(
triggerToaster(
translate('TOASTR.PRIV_KEY_IMPORTED'),
translate('TOASTR.SETTINGS_NOTIFICATION'),
'success'
)
);
}
}
}
@ -99,7 +123,13 @@ export function importPrivKey(wifKey) {
'status': 'error',
'response': error,
}));
dispatch(triggerToaster('importPrivKey', 'Error', 'error'));
dispatch(
triggerToaster(
'importPrivKey',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => {
@ -108,7 +138,12 @@ export function importPrivKey(wifKey) {
'status': 'success',
'response': json,
}));
dispatch(parseImportPrivKeyResponse(json, dispatch));
dispatch(
parseImportPrivKeyResponse(
json,
dispatch
)
);
})
.catch(function(ex) {
dispatch(parseImportPrivKeyResponse({
@ -144,7 +179,13 @@ export function getDebugLog(target, linesCount) {
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster('getDebugLog', 'Error', 'error'));
dispatch(
triggerToaster(
'getDebugLog',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => dispatch(getDebugLogState(json)))
@ -181,7 +222,13 @@ export function getPeersList(coin) {
'status': 'error',
'response': error,
}));
dispatch(triggerToaster('getPeersList', 'Error', 'error'));
dispatch(
triggerToaster(
'getPeersList',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => {
@ -216,22 +263,46 @@ export function getPeersListState(json) {
function addPeerNodeState(json, dispatch) {
if (json.error === 'addnode needs active coin, do an addcoin first') {
return dispatch => {
dispatch(triggerToaster('Addnode needs active coin', translate('TOASTR.SETTINGS_NOTIFICATION'), 'error'));
dispatch(
triggerToaster(
'Addnode needs active coin',
translate('TOASTR.SETTINGS_NOTIFICATION'),
'error'
)
);
}
}
if (json.result === 'peer was already connected') {
return dispatch => {
dispatch(triggerToaster('Peer was already connected', translate('TOASTR.SETTINGS_NOTIFICATION'), 'warning'));
dispatch(
triggerToaster(
'Peer was already connected',
translate('TOASTR.SETTINGS_NOTIFICATION'),
'warning'
)
);
}
}
if (json.result === 'addnode connection was already pending') {
return dispatch => {
dispatch(triggerToaster('Addnode connection was already pending', translate('TOASTR.SETTINGS_NOTIFICATION'), 'warning'));
dispatch(
triggerToaster(
'Addnode connection was already pending',
translate('TOASTR.SETTINGS_NOTIFICATION'),
'warning'
)
);
}
}
if (json.result === 'addnode submitted') {
return dispatch => {
dispatch(triggerToaster('Peer is added', translate('TOASTR.SETTINGS_NOTIFICATION'), 'success'));
dispatch(
triggerToaster(
'Peer is added',
translate('TOASTR.SETTINGS_NOTIFICATION'),
'success'
)
);
}
}
}
@ -267,7 +338,13 @@ export function addPeerNode(coin, ip) {
'status': 'error',
'response': error,
}));
dispatch(triggerToaster('addPeerNode', 'Error', 'error'));
dispatch(
triggerToaster(
'addPeerNode',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => {
@ -292,7 +369,13 @@ export function saveAppConfig(_payload) {
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster('saveAppConfig', 'Error', 'error'));
dispatch(
triggerToaster(
'saveAppConfig',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => dispatch(getAppConfig()))
@ -316,7 +399,13 @@ export function getAppConfig() {
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster('getAppConfig', 'Error', 'error'));
dispatch(
triggerToaster(
'getAppConfig',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => dispatch(getAppConfigState(json)))

8
react/src/actions/actions/syncInfo.js

@ -53,7 +53,13 @@ export function getSyncInfo(coin) {
'status': 'error',
'response': error,
}));
dispatch(triggerToaster('getSyncInfo', 'Error', 'error'));
dispatch(
triggerToaster(
'getSyncInfo',
'Error',
'error'
)
);
})
.then(function(response) {
const _response = response.text().then(function(text) { return text; });

26
react/src/actions/actions/syncOnly.js

@ -36,7 +36,13 @@ export function getSyncOnlyForks() {
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster('getSyncOnlyForks', 'Error', 'error'));
dispatch(
triggerToaster(
'getSyncOnlyForks',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => dispatch(getSyncOnlyForksState(json)))
@ -53,9 +59,23 @@ export function stopIguanaFork(pmid) {
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster('stopIguanaFork', 'Error', 'error'));
dispatch(
triggerToaster(
'stopIguanaFork',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => dispatch(triggerToaster('Iguana instance is stopped', translate('TOASTR.SERVICE_NOTIFICATION'), 'success')))
.then(
json => dispatch(
triggerToaster(
'Iguana instance is stopped',
translate('TOASTR.SERVICE_NOTIFICATION'),
'success'
)
)
)
}
}

8
react/src/actions/actions/sysInfo.js

@ -17,7 +17,13 @@ export function shepherdGetSysInfo() {
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster('Failed to get sys info', 'Error', 'error'))
dispatch(
triggerToaster(
'Failed to get sys info',
'Error',
'error'
)
)
})
.then(response => response.json())
.then(json => console.log(json));

48
react/src/actions/actions/walletAuth.js

@ -44,7 +44,13 @@ export function encryptWallet(_passphrase, cb, coin) {
'status': 'error',
'response': error,
}));
dispatch(triggerToaster('encryptWallet', 'Error', 'error'));
dispatch(
triggerToaster(
'encryptWallet',
'Error',
'error'
)
);
})
.then(dispatch(walletPassphrase(_passphrase)))
.then(response => response.json())
@ -54,7 +60,13 @@ export function encryptWallet(_passphrase, cb, coin) {
'status': 'success',
'response': json,
}));
dispatch(cb.call(this, json, coin));
dispatch(
cb.call(
this,
json,
coin
)
);
});
}
}
@ -90,7 +102,13 @@ export function walletPassphrase(_passphrase) {
'status': 'error',
'response': error,
}));
dispatch(triggerToaster('walletPassphrase', 'Error', 'error'));
dispatch(
triggerToaster(
'walletPassphrase',
'Error',
'error'
)
);
})
.then(json => {
dispatch(logGuiHttp({
@ -134,7 +152,13 @@ export function iguanaWalletPassphrase(_passphrase) {
'status': 'error',
'response': error,
}));
dispatch(triggerToaster('Error iguanaWalletPassphrase', 'Error', 'error'));
dispatch(
triggerToaster(
'Error iguanaWalletPassphrase',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => {
@ -178,7 +202,13 @@ export function iguanaActiveHandle(getMainAddress) {
'response': error,
}));
dispatch(updateErrosStack('activeHandle'));
dispatch(triggerToaster(translate('TOASTR.IGUANA_ARE_YOU_SURE'), translate('TOASTR.SERVICE_NOTIFICATION'), 'error'));
dispatch(
triggerToaster(
translate('TOASTR.IGUANA_ARE_YOU_SURE'),
translate('TOASTR.SERVICE_NOTIFICATION'),
'error'
)
);
})
.then(response => response.json())
.then(json => {
@ -194,7 +224,13 @@ export function iguanaActiveHandle(getMainAddress) {
function iguanaWalletPassphraseState(json, dispatch) {
sessionStorage.setItem('IguanaActiveAccount', JSON.stringify(json));
dispatch(triggerToaster(translate('TOASTR.LOGIN_SUCCESSFULL'), translate('TOASTR.ACCOUNT_NOTIFICATION'), 'success'));
dispatch(
triggerToaster(
translate('TOASTR.LOGIN_SUCCESSFULL'),
translate('TOASTR.ACCOUNT_NOTIFICATION'),
'success'
)
);
dispatch(getMainAddressState(json));
dispatch(iguanaActiveHandleState(json));

65
react/src/components/addcoin/addcoin.js

@ -50,9 +50,9 @@ class AddCoin extends React.Component {
saveCoinSelection() {
shepherdPostCoinList(this.state.coins)
.then(function(json) {
.then((json) => {
this.toggleActionsMenu();
}.bind(this));
});
}
loadCoinSelection() {
@ -64,7 +64,13 @@ class AddCoin extends React.Component {
actionsMenu: false,
}));
} else {
Store.dispatch(triggerToaster(translate('TOASTR.SELECTION_NOT_FOUND'), translate('TOASTR.COIN_SELECTION'), 'info'));
Store.dispatch(
triggerToaster(
translate('TOASTR.SELECTION_NOT_FOUND'),
translate('TOASTR.COIN_SELECTION'),
'info'
)
);
}
}.bind(this));
}
@ -92,9 +98,12 @@ class AddCoin extends React.Component {
}
componentWillReceiveProps(props) {
this.existingCoins = props && props.Main ? props.Main.coins : null;
const addCoinProps = props ? props.AddCoin : null;
if (addCoinProps && addCoinProps.display !== this.state.display) {
this.existingCoins = props && props.Main ? props.Main.coins : null;
if (addCoinProps &&
addCoinProps.display !== this.state.display) {
this.setState(Object.assign({}, this.state, {
display: addCoinProps.display,
modalClassName: addCoinProps.display ? 'show fade' : 'show fade',
@ -222,11 +231,13 @@ class AddCoin extends React.Component {
activateAllCoins() {
const coin = this.state.coins[0].selectedCoin.split('|')[0];
if (!this.isCoinAlreadyAdded(coin)) {
Store.dispatch(addCoin(
coin,
this.state.coins[0].mode,
this.state.coins[0].syncOnly
));
Store.dispatch(
addCoin(
coin,
this.state.coins[0].mode,
this.state.coins[0].syncOnly
)
);
}
for (let i = 1; i < this.state.coins.length; i++) {
@ -235,11 +246,13 @@ class AddCoin extends React.Component {
setTimeout(() => {
if (!this.isCoinAlreadyAdded(itemCoin)) {
Store.dispatch(addCoin(
itemCoin,
_item.mode,
_item.syncOnly
));
Store.dispatch(
addCoin(
itemCoin,
_item.mode,
_item.syncOnly
)
);
}
if (i === this.state.coins.length - 1) {
@ -264,7 +277,12 @@ class AddCoin extends React.Component {
const _coin = _item.selectedCoin || '';
items.push(
CoinSelectorsRender.call(this, _item, _coin, i)
CoinSelectorsRender.call(
this,
_item,
_coin,
i
)
);
}
@ -278,12 +296,23 @@ class AddCoin extends React.Component {
}
isCoinAlreadyAdded(coin) {
const modes = ['basilisk', 'full', 'native'];
const modes = [
'basilisk',
'full',
'native'
];
for (let mode of modes) {
if (this.existingCoins[mode].indexOf(coin) !== -1) {
const message = `${coin} ${translate('ADD_COIN.ALREADY_ADDED')} ${translate('ADD_COIN.IN')} ${mode} ${translate('ADD_COIN.MODE')}`;
Store.dispatch(triggerToaster(message, translate('ADD_COIN.COIN_ALREADY_ADDED'), 'error'));
Store.dispatch(
triggerToaster(
message,
translate('ADD_COIN.COIN_ALREADY_ADDED'),
'error'
)
);
return true;
}
}

32
react/src/components/addcoin/addcoin.render.js

@ -14,7 +14,9 @@ const AddCoinRender = function() {
onClick={ this.dismiss }>
<span>×</span>
</button>
<h4 className="modal-title white">{ translate('INDEX.SELECT_A_COIN') }</h4>
<h4 className="modal-title white">
{ translate('INDEX.SELECT_A_COIN') }
</h4>
</div>
<div className="modal-body">
<button
@ -28,18 +30,23 @@ const AddCoinRender = function() {
<span className={ !this.state.actionsMenu ? 'hide' : '' }>
<button
className="btn btn-outline-primary btn-save-coin-selection"
onClick={ this.saveCoinSelection }>{ translate('ADD_COIN.SAVE_SELECTION') }</button>
onClick={ this.saveCoinSelection }>
{ translate('ADD_COIN.SAVE_SELECTION') }
</button>
<button
className="btn btn-outline-primary btn-load-coin-selection"
onClick={ this.loadCoinSelection }>{ translate('ADD_COIN.LOAD_SELECTION') }</button>
onClick={ this.loadCoinSelection }>
{ translate('ADD_COIN.LOAD_SELECTION') }
</button>
</span>
{ this.renderCoinSelectors() }
<div
className={ 'text-align-center vertical-margin-20 horizontal-margin-0 ' + (this.hasMoreThanOneCoin() ? 'col-sm-12' : 'hide') }>
<div className={ 'text-align-center vertical-margin-20 horizontal-margin-0 ' + (this.hasMoreThanOneCoin() ? 'col-sm-12' : 'hide') }>
<button
type="button"
className="btn btn-primary col-sm-4 float-none"
onClick={ this.activateAllCoins }>{ translate('ADD_COIN.ACTIVATE_ALL') }</button>
onClick={ this.activateAllCoins }>
{ translate('ADD_COIN.ACTIVATE_ALL') }
</button>
</div>
<div className="col-sm-12">
<p>
@ -49,13 +56,20 @@ const AddCoinRender = function() {
<strong>{ translate('INDEX.BASILISK_MODE') }:</strong> { translate('INDEX.BASILISK_MODE_DESC') }
</p>
<p>
<strong>{ translate('INDEX.NATIVE_MODE') }:</strong> { translate('INDEX.NATIVE_MODE_DESC1') } <strong>Komodo Daemon</strong> { translate('INDEX.NATIVE_MODE_DESC2') } <i>Iguana Daemon</i> { translate('INDEX.NATIVE_MODE_DESC3') }.
<strong>{ translate('INDEX.NATIVE_MODE') }:</strong> { translate('INDEX.NATIVE_MODE_DESC1') }
<strong>Komodo Daemon</strong> { translate('INDEX.NATIVE_MODE_DESC2') }
<i>Iguana Daemon</i> { translate('INDEX.NATIVE_MODE_DESC3') }.
</p>
<div className="alert alert-icon alert-primary">
<button type="button" className="close">
<button
type="button"
className="close">
<span>×</span>
</button>
<i className="icon md-info-outline"></i> <strong>{ translate('INDEX.NATIVE_MODE') }</strong> { translate('INDEX.NATIVE_MODE_DESC4') } <strong>{ translate('INDEX.NATIVE_MODE_DESC5') }</strong>, <i>{ translate('INDEX.NATIVE_MODE_DESC5') }</i>.
<i className="icon md-info-outline"></i>
<strong>{ translate('INDEX.NATIVE_MODE') }</strong> { translate('INDEX.NATIVE_MODE_DESC4') }
<strong>{ translate('INDEX.NATIVE_MODE_DESC5') }</strong>,
<i>{ translate('INDEX.NATIVE_MODE_DESC5') }</i>.
</div>
</div>
</div>

43
react/src/components/addcoin/coin-selectors.render.js

@ -4,7 +4,6 @@ import AddCoinOptionsCrypto from '../addcoin/addcoinOptionsCrypto';
import AddCoinOptionsAC from '../addcoin/addcoinOptionsAC';
import AddCoinOptionsACFiat from '../addcoin/addcoinOptionsACFiat';
const CoinSelectorsRender = function(item, coin, i) {
return (
<div
@ -30,7 +29,9 @@ const CoinSelectorsRender = function(item, coin, i) {
type="button"
className="btn btn-primary"
onClick={ () => this.activateCoin(i) }
disabled={ item.mode === -2 }>{ translate('INDEX.ACTIVATE_COIN') }</button>
disabled={ item.mode === -2 }>
{ translate('INDEX.ACTIVATE_COIN') }
</button>
</div>
<div className="col-sm-12 text-center">
<div className="form-group col-lg-4 col-md-4 col-sm-6 col-xs-6 style-addcoin-lbl-mdl-login">
@ -50,13 +51,17 @@ const CoinSelectorsRender = function(item, coin, i) {
style={{ display: item.fullMode.checked ? 'none' : 'inline-block' }}></span>
<span
className="labelauty-unchecked"
style={{ display: item.fullMode.checked ? 'none' : 'inline-block' }}>{ translate('INDEX.FULL_MODE') }</span>
style={{ display: item.fullMode.checked ? 'none' : 'inline-block' }}>
{ translate('INDEX.FULL_MODE') }
</span>
<span
className="labelauty-checked-image"
style={{ display: item.fullMode.checked ? 'inline-block' : 'none' }}></span>
<span
className="labelauty-checked"
style={{ display: item.fullMode.checked ? 'inline-block' : 'none' }}>{ translate('INDEX.FULL_MODE') }</span>
style={{ display: item.fullMode.checked ? 'inline-block' : 'none' }}>
{ translate('INDEX.FULL_MODE') }
</span>
</label>
</div>
<div className="form-group col-lg-4 col-md-4 col-sm-6 col-xs-6 style-addcoin-lbl-mdl-login">
@ -76,13 +81,17 @@ const CoinSelectorsRender = function(item, coin, i) {
style={{ display: item.basiliskMode.checked ? 'none' : 'inline-block' }}></span>
<span
className="labelauty-unchecked"
style={{ display: item.basiliskMode.checked ? 'none' : 'inline-block' }}>{ translate('INDEX.BASILISK_MODE') }</span>
style={{ display: item.basiliskMode.checked ? 'none' : 'inline-block' }}>
{ translate('INDEX.BASILISK_MODE') }
</span>
<span
className="labelauty-checked-image"
style={{ display: item.basiliskMode.checked ? 'inline-block' : 'none' }}></span>
<span
className="labelauty-checked"
style={{ display: item.basiliskMode.checked ? 'inline-block' : 'none' }}>{ translate('INDEX.BASILISK_MODE') }</span>
style={{ display: item.basiliskMode.checked ? 'inline-block' : 'none' }}>
{ translate('INDEX.BASILISK_MODE') }
</span>
</label>
</div>
<div className="form-group col-lg-4 col-md-4 col-sm-12 col-xs-12 style-addcoin-lbl-mdl-login">
@ -102,13 +111,17 @@ const CoinSelectorsRender = function(item, coin, i) {
style={{ display: item.nativeMode.checked ? 'none' : 'inline-block' }}></span>
<span
className="labelauty-unchecked"
style={{ display: item.nativeMode.checked ? 'none' : 'inline-block' }}>{ translate('INDEX.NATIVE_MODE') }</span>
style={{ display: item.nativeMode.checked ? 'none' : 'inline-block' }}>
{ translate('INDEX.NATIVE_MODE') }
</span>
<span
className="labelauty-checked-image"
style={{ display: item.nativeMode.checked ? 'inline-block' : 'none' }}></span>
<span
className="labelauty-checked"
style={{ display: item.nativeMode.checked ? 'inline-block' : 'none' }}>{ translate('INDEX.NATIVE_MODE') }</span>
style={{ display: item.nativeMode.checked ? 'inline-block' : 'none' }}>
{ translate('INDEX.NATIVE_MODE') }
</span>
</label>
</div>
</div>
@ -117,19 +130,25 @@ const CoinSelectorsRender = function(item, coin, i) {
type="button"
className="btn btn-primary"
onClick={ () => this.removeCoin(i) }>
<i className="fa fa-trash-o"></i>
<i className="fa fa-trash-o"></i>
</button>
</div>
<div className={ item.mode === '1' || item.mode === 1 ? 'col-sm-12' : 'hide' }>
<div className="toggle-box padding-top-3 padding-bottom-10">
<span className="pointer">
<label className="switch">
<input type="checkbox" checked={ item.syncOnly } />
<div className="slider" onClick={ () => this.toggleSyncOnlyMode(i) }></div>
<input
type="checkbox"
checked={ item.syncOnly } />
<div
className="slider"
onClick={ () => this.toggleSyncOnlyMode(i) }></div>
</label>
<div
className="toggle-label"
onClick={ () => this.toggleSyncOnlyMode(i) }>{ translate('ADD_COIN.SYNC_ONLY') }</div>
onClick={ () => this.toggleSyncOnlyMode(i) }>
{ translate('ADD_COIN.SYNC_ONLY') }
</div>
</span>
</div>
</div>

14
react/src/components/dashboard/atomic/atomic.js

@ -340,7 +340,13 @@ class Atomic extends React.Component {
}
if (props.Atomic.response.error === 'less than required responses') {
Store.dispatch(triggerToaster('Basilisk connection error', translate('TOASTR.SERVICE_NOTIFICATION'), 'error'));
Store.dispatch(
triggerToaster(
'Basilisk connection error',
translate('TOASTR.SERVICE_NOTIFICATION'),
'error'
)
);
}
}
}
@ -469,7 +475,11 @@ class Atomic extends React.Component {
for (let i = 0; i < _options.length; i++) {
items.push(
<option key={ _options[i].method } value={ _options[i].method }>{ _options[i].name }</option>
<option
key={ _options[i].method }
value={ _options[i].method }>
{ _options[i].name }
</option>
);
}

16
react/src/components/dashboard/atomic/atomic.render.js

@ -11,7 +11,9 @@ const AtomicRender = function () {
<div className="page-content">
<div className="row">
<div className="col-xlg-12 col-md-12">
<h4 className="font-size-14 text-uppercase">Atomic Explorer</h4>
<h4 className="font-size-14 text-uppercase">
Atomic Explorer
</h4>
<div className="panel panel-bordered">
<div className="panel-body">
<div className="col-sm-4 col-xs-12">
@ -46,7 +48,9 @@ const AtomicRender = function () {
<button
type="button"
className="btn btn-primary waves-effect waves-light"
onClick={ this.getAtomicData }>{ translate('ATOMIC.SUBMIT') }</button>
onClick={ this.getAtomicData }>
{ translate('ATOMIC.SUBMIT') }
</button>
</div>
</div>
</div>
@ -54,11 +58,15 @@ const AtomicRender = function () {
<div className="col-xlg-4 col-md-12">
<div className="panel">
<div className="panel-heading">
<h3 className="panel-title">{ translate('ATOMIC.RAW_OUTPUT') }</h3>
<h3 className="panel-title">
{ translate('ATOMIC.RAW_OUTPUT') }
</h3>
</div>
<div className="panel-body">
<div className="tab-content">
<pre>{ this.state.output }</pre>
<pre>
{ this.state.output }
</pre>
</div>
</div>
</div>

6
react/src/components/dashboard/coinTile/coinTile.js

@ -52,7 +52,11 @@ class CoinTile extends React.Component {
return (
items.map((item, i) =>
<CoinTileItem key={ i } i={ i } item={ item } {...this.props} />)
<CoinTileItem
key={ i }
i={ i }
item={ item }
{...this.props} />)
);
}

14
react/src/components/dashboard/coinTile/coinTile.render.js

@ -13,13 +13,21 @@ const CoinTileRender = function() {
<div className="panel-heading">
<div className="panel-actions">
<div className="input-search input-group-sm">
<button type="submit" className="input-search-btn">
<button
type="submit"
className="input-search-btn">
<i className="icon md-search"></i>
</button>
<input type="text" className="form-control" placeholder="Search..." disabled />
<input
type="text"
className="form-control"
placeholder="Search..."
disabled />
</div>
</div>
<h3 className="panel-title">{ translate('INDEX.ACTIVE_COINS') }</h3>
<h3 className="panel-title">
{ translate('INDEX.ACTIVE_COINS') }
</h3>
</div>
</div>
<div className="wallet-widgets-list">

50
react/src/components/dashboard/coinTile/coinTileItem.js

@ -68,8 +68,19 @@ class CoinTileItem extends React.Component {
const useAddress = this.props.ActiveCoin.mainBasiliskAddress ? this.props.ActiveCoin.mainBasiliskAddress : this.props.Dashboard.activeHandle[coin];
Store.dispatch(iguanaActiveHandle(true));
Store.dispatch(getKMDAddressesNative(coin, mode, useAddress));
Store.dispatch(getShepherdCache(JSON.parse(sessionStorage.getItem('IguanaActiveAccount')).pubkey, coin));
Store.dispatch(
getKMDAddressesNative(
coin,
mode,
useAddress
)
);
Store.dispatch(
getShepherdCache(
JSON.parse(sessionStorage.getItem('IguanaActiveAccount')).pubkey,
coin
)
);
if (this.props &&
this.props.Dashboard &&
@ -86,8 +97,18 @@ class CoinTileItem extends React.Component {
dashboardChangeActiveCoin(coin, mode) {
if (coin !== this.props.ActiveCoin.coin) {
Store.dispatch(stopInterval('sync', this.props.Interval.interval));
Store.dispatch(stopInterval('basilisk', this.props.Interval.interval));
Store.dispatch(
stopInterval(
'sync',
this.props.Interval.interval
)
);
Store.dispatch(
stopInterval(
'basilisk',
this.props.Interval.interval
)
);
Store.dispatch(dashboardChangeActiveCoin(coin, mode));
this.dispatchCoinActions(coin, mode);
@ -96,7 +117,12 @@ class CoinTileItem extends React.Component {
const _iguanaActiveHandle = setInterval(() => {
this.dispatchCoinActions(coin, mode);
}, IGUNA_ACTIVE_HANDLE_TIMEOUT);
Store.dispatch(startInterval('sync', _iguanaActiveHandle));
Store.dispatch(
startInterval(
'sync',
_iguanaActiveHandle
)
);
}
if (mode === 'native') {
const _iguanaActiveHandle = setInterval(() => {
@ -130,8 +156,18 @@ class CoinTileItem extends React.Component {
'address': _basiliskMainAddress,
}));
}, BASILISK_CACHE_UPDATE_TIMEOUT);
Store.dispatch(startInterval('sync', _iguanaActiveHandle));
Store.dispatch(startInterval('basilisk', _basiliskCache));
Store.dispatch(
startInterval(
'sync',
_iguanaActiveHandle
)
);
Store.dispatch(
startInterval(
'basilisk',
_basiliskCache
)
);
}
}
}

8
react/src/components/dashboard/coinTile/coinTileItem.render.js

@ -14,9 +14,13 @@ const CoinTileItemRender = function() {
className="img-responsive"
src={ `assets/images/cryptologo/${item.coinlogo}.png` }
alt={ item.coinname }/>
<span className={ `badge up badge-${item.modecolor}` }>{ item.modecode }</span>
<span className={ `badge up badge-${item.modecolor}` }>
{ item.modecode }
</span>
</a>
<div className="coin-name">{ item.coinname } ({ item.coinlogo.toUpperCase() })</div>
<div className="coin-name">
{ item.coinname } ({ item.coinlogo.toUpperCase() })
</div>
</div>
</div>
</div>

160
react/src/components/dashboard/jumblr/jumblr.render.js

@ -11,12 +11,14 @@ const JumblrRender = function() {
<div className="row">
<div className="col-xs-12">
<div className="alert alert-danger">
<button type="button" className="close">
<button
type="button"
className="close">
<span>×</span>
</button>
<span className="jumblr-header">
<i className="icon fa-paw"></i> { translate('JUMBLR.NOTICE') }
</span>
<i className="icon fa-paw"></i> { translate('JUMBLR.NOTICE') }
</span>
<br />
{ translate('JUMBLR.DESCRIPTION') }
</div>
@ -24,12 +26,14 @@ const JumblrRender = function() {
<div className="col-xs-12">
<div className="alert alert-info alert-dismissible">
<button type="button" className="close">
<button
type="button"
className="close">
<span>×</span>
</button>
<span className="jumblr-header">
<i className="icon fa-paw"></i> { translate('JUMBLR.NEED_NATIVE') }
</span>
<i className="icon fa-paw"></i> { translate('JUMBLR.NEED_NATIVE') }
</span>
<br />
{ translate('JUMBLR.TO_USE_JUMBLR') }
<br />
@ -96,7 +100,9 @@ const JumblrRender = function() {
</div>
</div>
<div className="panel">
<div className="panel-heading" onClick={ () => this.openTab(2) }>
<div
className="panel-heading"
onClick={ () => this.openTab(2) }>
<a className={ this.state.activeTab === 2 ? 'panel-title' : 'panel-title collapsed' }>{ translate('JUMBLR.USING_JUMBLR') }</a>
</div>
<div className={ this.state.activeTab === 2 ? 'panel-collapse collapse in' : 'panel-collapse collapse' }>
@ -127,44 +133,46 @@ const JumblrRender = function() {
<div className="table-responsive">
<table className="table table-striped">
<tbody>
<tr>
<td width="20%">{ translate('JUMBLR.BTC_DEPOSIT') }</td>
<td>
<span></span>
</td>
</tr>
<tr>
<td>BTC Jumblr</td>
<td>
<button type="button" className="btn btn-animate btn-animate-side btn-default btn-sm waves-effect waves-light">
<span>
<i className="icon fa-eye"></i> { translate('JUMBLR.SHOW_HIDE') }
</span>
</button>
<span
className="label label-lg label-outline label-success"
style={{ display: 'none' }}></span>
<span className="label label-lg label-outline label-default">{ translate('JUMBLR.HIDDEN') }</span>
</td>
</tr>
<tr>
<td>{ translate('JUMBLR.KMD_DEPOSIT') }</td>
<td></td>
</tr>
<tr>
<td>KMD Jumblr</td>
<td>
<button type="button" className="btn btn-animate btn-animate-side btn-default btn-sm waves-effect waves-light">
<span>
<i className="icon fa-eye"></i> { translate('JUMBLR.SHOW_HIDE') }
<tr>
<td width="20%">{ translate('JUMBLR.BTC_DEPOSIT') }</td>
<td>
<span></span>
</td>
</tr>
<tr>
<td>BTC Jumblr</td>
<td>
<button
type="button"
className="btn btn-animate btn-animate-side btn-default btn-sm waves-effect waves-light">
<span>
<i className="icon fa-eye"></i> { translate('JUMBLR.SHOW_HIDE') }
</span>
</button>
<span className="label label-lg label-outline label-success hide"></span>
<span className="label label-lg label-outline label-default">{ translate('JUMBLR.HIDDEN') }</span>
</td>
</tr>
<tr>
<td>{ translate('JUMBLR.KMD_DEPOSIT') }</td>
<td></td>
</tr>
<tr>
<td>KMD Jumblr</td>
<td>
<button
type="button"
className="btn btn-animate btn-animate-side btn-default btn-sm waves-effect waves-light">
<span>
<i className="icon fa-eye"></i> { translate('JUMBLR.SHOW_HIDE') }
</span>
</button>
<span className="label label-lg label-outline label-success hide"></span>
<span className="label label-lg label-outline label-default">
{ translate('JUMBLR.HIDDEN') }
</span>
</button>
<span
className="label label-lg label-outline label-success"
style={{ display: 'none' }}></span>
<span className="label label-lg label-outline label-default">{ translate('JUMBLR.HIDDEN') }</span>
</td>
</tr>
</td>
</tr>
</tbody>
</table>
</div>
@ -172,41 +180,43 @@ const JumblrRender = function() {
</div>
<div className="col-xlg-12 col-md-12">
<h4 className="font-size-14 text-uppercase">{ translate('JUMBLR.JSTATUS') }</h4>
<h4 className="font-size-14 text-uppercase">
{ translate('JUMBLR.JSTATUS') }
</h4>
<div className="panel">
<div className="table-responsive">
<table className="table table-striped">
<tbody>
<tr>
<td width="20%">{ translate('JUMBLR.RESULT') }</td>
<td>
<span className="label label-success"></span>
</td>
</tr>
<tr>
<td>{ translate('JUMBLR.DEPOSITED') }</td>
<td></td>
</tr>
<tr>
<td>{ translate('JUMBLR.PUB_TO_PRIV') }</td>
<td></td>
</tr>
<tr>
<td>{ translate('JUMBLR.PRIV_TO_PRIV') }</td>
<td></td>
</tr>
<tr>
<td>{ translate('JUMBLR.PRIV_TO_PUB') }</td>
<td></td>
</tr>
<tr>
<td>{ translate('JUMBLR.FINISHED') }</td>
<td></td>
</tr>
<tr>
<td>{ translate('JUMBLR.PENDING') }</td>
<td></td>
</tr>
<tr>
<td width="20%">{ translate('JUMBLR.RESULT') }</td>
<td>
<span className="label label-success"></span>
</td>
</tr>
<tr>
<td>{ translate('JUMBLR.DEPOSITED') }</td>
<td></td>
</tr>
<tr>
<td>{ translate('JUMBLR.PUB_TO_PRIV') }</td>
<td></td>
</tr>
<tr>
<td>{ translate('JUMBLR.PRIV_TO_PRIV') }</td>
<td></td>
</tr>
<tr>
<td>{ translate('JUMBLR.PRIV_TO_PUB') }</td>
<td></td>
</tr>
<tr>
<td>{ translate('JUMBLR.FINISHED') }</td>
<td></td>
</tr>
<tr>
<td>{ translate('JUMBLR.PENDING') }</td>
<td></td>
</tr>
</tbody>
</table>
</div>

37
react/src/components/dashboard/navbar/navbar.js

@ -24,11 +24,19 @@ class Navbar extends React.Component {
}
componentWillMount() {
document.addEventListener('click', this.handleClickOutside, false);
document.addEventListener(
'click',
this.handleClickOutside,
false
);
}
componentWillUnmount() {
document.removeEventListener('click', this.handleClickOutside, false);
document.removeEventListener(
'click',
this.handleClickOutside,
false
);
}
handleClickOutside(e) {
@ -58,18 +66,33 @@ class Navbar extends React.Component {
}
logout() {
Store.dispatch(stopInterval('sync', this.props.Interval.interval));
Store.dispatch(stopInterval('basilisk', this.props.Interval.interval));
Store.dispatch(
stopInterval(
'sync',
this.props.Interval.interval
)
);
Store.dispatch(
stopInterval(
'basilisk',
this.props.Interval.interval
)
);
Store.dispatch(logout());
}
openSyncOnlyModal() {
Store.dispatch(getSyncOnlyForks());
const _iguanaActiveHandle = setInterval(function() {
const _iguanaActiveHandle = setInterval(() => {
Store.dispatch(getSyncOnlyForks());
}.bind(this), 3000);
Store.dispatch(startInterval('syncOnly', _iguanaActiveHandle));
}, 3000);
Store.dispatch(
startInterval(
'syncOnly',
_iguanaActiveHandle
)
);
Store.dispatch(toggleSyncOnlyModal(true));
}

23
react/src/components/dashboard/navbar/navbar.render.js

@ -5,16 +5,21 @@ const NavbarRender = function() {
return (
<nav className="site-navbar navbar navbar-default navbar-fixed-top navbar-mega">
<div className="navbar-header">
<button type="button" className="navbar-toggle hamburger hamburger-close navbar-toggle-left hided">
<button
type="button"
className="navbar-toggle hamburger hamburger-close navbar-toggle-left hided">
<span className="sr-only">{ translate('INDEX.TOGGLE_NAV') }</span>
<span className="hamburger-bar"></span>
</button>
<button type="button" className="navbar-toggle collapsed">
<button
type="button"
className="navbar-toggle collapsed">
<i className="icon md-more"></i>
</button>
<div className="navbar-brand navbar-brand-center site-gridmenu-toggle">
<img
className="navbar-brand-logo hidden-xs" src="assets/images/easydex-logo-dashboard.png"
className="navbar-brand-logo hidden-xs"
src="assets/images/easydex-logo-dashboard.png"
title="SuperNET Iguana" />
<img
className="navbar-brand-logo hidden-md hidden-sm hidden-lg"
@ -22,7 +27,9 @@ const NavbarRender = function() {
title="SuperNET Iguana white" />
<span className="navbar-brand-text hidden-xs"></span>
</div>
<button type="button" className="navbar-toggle collapsed">
<button
type="button"
className="navbar-toggle collapsed">
<span className="sr-only">{ translate('INDEX.TOGGLE_SEARCH') }</span>
<i className="icon md-search"></i>
</button>
@ -65,7 +72,9 @@ const NavbarRender = function() {
className="pointer padding-bottom-10 padding-top-16"
onClick={ this.toggleAddCoinModal }>
<span>
<img src="assets/images/icons/activatecoin.png" alt={ translate('INDEX.ADD_COIN') } />
<img
src="assets/images/icons/activatecoin.png"
alt={ translate('INDEX.ADD_COIN') } />
</span>
</a>
</li>
@ -74,7 +83,9 @@ const NavbarRender = function() {
onClick={ this.openDropMenu }>
<a className="navbar-avatar dropdown-toggle">
<span className="avatar avatar-online">
<img src="assets/images/iguana_profile_02.jpg" alt="iguana profile pic" />
<img
src="assets/images/iguana_profile_02.jpg"
alt="iguana profile pic" />
<i></i>
</span>
</a>

9
react/src/components/dashboard/notifications/notifications.js

@ -65,15 +65,20 @@ class Notifications extends React.Component {
if (this.state.guiLog &&
this.state.guiLog.length) {
let _guiLog = this.state.guiLog;
_guiLog = sortByDate(_guiLog);
let items = [];
_guiLog = sortByDate(_guiLog);
for (let i = 0; i < _guiLog.length; i++) {
if (_guiLog[i].status === type) {
const _logItem = _guiLog[i];
items.push(
NotificationsByTypeRender.call(this, _logItem, type, i)
NotificationsByTypeRender.call(
this,
_logItem,
type,
i
)
);
}
}

34
react/src/components/dashboard/notifications/notifications.render.js

@ -41,36 +41,30 @@ export const NotificationsModalRender = function() {
<div className="panel nav-tabs-horizontal">
<ul className="nav nav-tabs nav-tabs-line">
<li className={ this.state.activeTab === 0 ? 'active' : 'pointer' }>
<a
onClick={ () => this.openTab(0) }>
<a onClick={ () => this.openTab(0) }>
<i className="icon fa fa-thumbs-o-up"></i> Success ({ this.state.calls.success })
</a>
</li>
<li className={ this.state.activeTab === 1 ? 'active' : 'pointer' }>
<a
onClick={ () => this.openTab(1) }>
<a onClick={ () => this.openTab(1) }>
<i className="icon fa fa-exclamation-triangle"></i> Error ({ this.state.calls.error })
</a>
</li>
<li className={ this.state.activeTab === 2 ? 'active' : 'pointer' }>
<a
onClick={ () => this.openTab(2) }>
<a onClick={ () => this.openTab(2) }>
<i className="icon fa fa-clock-o"></i> Pending ({ this.state.calls.pending })
</a>
</li>
</ul>
<div className="panel-body panel-body-container">
<div className="tab-content">
<div
className={ this.state.activeTab === 0 ? 'tab-pane active' : 'tab-pane' }>
<div className={ this.state.activeTab === 0 ? 'tab-pane active' : 'tab-pane' }>
{ this.renderNotificationsByType('success') }
</div>
<div
className={ this.state.activeTab === 1 ? 'tab-pane active' : 'tab-pane' }>
<div className={ this.state.activeTab === 1 ? 'tab-pane active' : 'tab-pane' }>
{ this.renderNotificationsByType('error') }
</div>
<div
className={ this.state.activeTab === 2 ? 'tab-pane active' : 'tab-pane' }>
<div className={ this.state.activeTab === 2 ? 'tab-pane active' : 'tab-pane' }>
{ this.renderNotificationsByType('pending') }
</div>
</div>
@ -81,7 +75,9 @@ export const NotificationsModalRender = function() {
<button
type="button"
className="btn btn-default"
onClick={ this.toggleNotificationsModal }>{ translate('INDEX.CLOSE') }</button>
onClick={ this.toggleNotificationsModal }>
{ translate('INDEX.CLOSE') }
</button>
</div>
</div>
</div>
@ -97,9 +93,15 @@ export const NotificationsRender = function() {
<div
className={ this.props.Dashboard.activeHandle && this.props.Dashboard.activeHandle.status === 'unlocked' ? 'notifications-badge stick-to-top' : 'notifications-badge' }
onClick={ this.toggleNotificationsModal }>
<span className="badge success">{ this.state.calls.success }</span>
<span className="badge error">{ this.state.calls.error }</span>
<span className="badge pending">{ this.state.calls.pending }</span>
<span className="badge success">
{ this.state.calls.success }
</span>
<span className="badge error">
{ this.state.calls.error }
</span>
<span className="badge pending">
{ this.state.calls.pending }
</span>
<div className={ this.state.calls.pending === 0 ? 'spinner spinner-hide' : 'spinner' }>
<div className="rect1"></div>
<div className="rect2"></div>

14
react/src/components/dashboard/receiveCoin/receiveCoin.js

@ -22,11 +22,21 @@ class ReceiveCoin extends React.Component {
}
_checkAddressBasilisk(address) {
Store.dispatch(checkAddressBasilisk(this.props.coin, address));
Store.dispatch(
checkAddressBasilisk(
this.props.coin,
address
)
);
}
_validateAddressBasilisk(address) {
Store.dispatch(validateAddressBasilisk(this.props.coin, address));
Store.dispatch(
validateAddressBasilisk(
this.props.coin,
address
)
);
}
_copyCoinAddress(address) {

42
react/src/components/dashboard/receiveCoin/receiveCoin.render.js

@ -10,18 +10,20 @@ export const AddressActionsBasiliskModeRender = function(address) {
<button
className="btn btn-default btn-xs clipboard-edexaddr margin-left-10"
title={ translate('INDEX.COPY_TO_CLIPBOARD') }
onClick={ () => this._copyCoinAddress(address) }><i className="icon wb-copy"></i> { translate('INDEX.COPY') }</button>
onClick={ () => this._copyCoinAddress(address) }>
<i className="icon wb-copy"></i> { translate('INDEX.COPY') }
</button>
<span
className="label label-default margin-left-10 action"
title={ translate('INDEX.CHECK') }
onClick={ () => this._checkAddressBasilisk(address) }>
<i className="icon fa-database"></i>
<i className="icon fa-database"></i>
</span>
<span
className="label label-default margin-left-10 action"
title={ translate('INDEX.VALIDATE') }
onClick={ () => this._validateAddressBasilisk(address) }>
<i className="icon fa-info-circle"></i>
<i className="icon fa-info-circle"></i>
</span>
</td>
);
@ -35,7 +37,9 @@ export const AddressActionsNonBasiliskModeRender = function(address) {
</span>
<button
className="btn btn-default btn-xs clipboard-edexaddr margin-left-10"
onClick={ () => this._copyCoinAddress(address) }><i className="icon wb-copy"></i> { translate('INDEX.COPY') }</button>
onClick={ () => this._copyCoinAddress(address) }>
<i className="icon wb-copy"></i> { translate('INDEX.COPY') }
</button>
</td>
);
};
@ -61,28 +65,30 @@ export const ReceiveCoinRender = function() {
<div className="panel">
<header className="panel-heading">
<div className="panel-actions"></div>
<h4 className="panel-title">{ translate('INDEX.RECEIVING_ADDRESS') }</h4>
<h4 className="panel-title">
{ translate('INDEX.RECEIVING_ADDRESS') }
</h4>
</header>
<div className="panel-body">
<table className="table table-hover dataTable table-striped">
<thead>
<tr>
<th>{ translate('INDEX.TYPE') }</th>
<th>{ translate('INDEX.ADDRESS') }</th>
<th>{ translate('INDEX.BALANCE') }</th>
<th>{ translate('INDEX.INTEREST') }</th>
</tr>
<tr>
<th>{ translate('INDEX.TYPE') }</th>
<th>{ translate('INDEX.ADDRESS') }</th>
<th>{ translate('INDEX.BALANCE') }</th>
<th>{ translate('INDEX.INTEREST') }</th>
</tr>
</thead>
<tbody>
{ this.renderAddressList() }
{ this.renderAddressList() }
</tbody>
<tfoot>
<tr>
<th>{ translate('INDEX.TYPE') }</th>
<th>{ translate('INDEX.ADDRESS') }</th>
<th>{ translate('INDEX.BALANCE') }</th>
<th>{ translate('INDEX.INTEREST') }</th>
</tr>
<tr>
<th>{ translate('INDEX.TYPE') }</th>
<th>{ translate('INDEX.ADDRESS') }</th>
<th>{ translate('INDEX.BALANCE') }</th>
<th>{ translate('INDEX.INTEREST') }</th>
</tr>
</tfoot>
</table>
</div>

153
react/src/components/dashboard/sendCoin/sendCoin.js

@ -68,11 +68,19 @@ class SendCoin extends React.Component {
}
componentWillMount() {
document.addEventListener('click', this.handleClickOutside, false);
document.addEventListener(
'click',
this.handleClickOutside,
false
);
}
componentWillUnmount() {
document.removeEventListener('click', this.handleClickOutside, false);
document.removeEventListener(
'click',
this.handleClickOutside,
false
);
}
handleClickOutside(e) {
@ -86,7 +94,8 @@ class SendCoin extends React.Component {
}
componentWillReceiveProps(props) {
if (!this.state.sendFrom && this.props.ActiveCoin.activeAddress) {
if (!this.state.sendFrom &&
this.props.ActiveCoin.activeAddress) {
this.setState(Object.assign({}, this.state, {
sendFrom: this.props.ActiveCoin.activeAddress,
}));
@ -157,17 +166,16 @@ class SendCoin extends React.Component {
timestamp = null;
}
return UTXOCacheInfoRender.call(this, refreshCacheData, isReadyToUpdate, waitUntilCallIsFinished, timestamp);
return UTXOCacheInfoRender.call(
this,
refreshCacheData,
isReadyToUpdate,
waitUntilCallIsFinished,
timestamp
);
}
return null;
/*
<hr />
<div>
Split funds
<hr />
</div>
*/
}
renderAddressAmount(address) {
@ -272,7 +280,9 @@ class SendCoin extends React.Component {
className="btn dropdown-toggle btn-info"
title={ '-' + translate('SEND.SELECT_T_OR_Z_ADDR') + '-' }
onClick={ this.openDropMenu }>
<span className="filter-option pull-left">{ this.renderSelectorCurrentLabel() } </span>&nbsp;
<span className="filter-option pull-left">
{ this.renderSelectorCurrentLabel() }&nbsp;&nbsp;
</span>
<span className="bs-caret">
<span className="caret"></span>
</span>
@ -345,7 +355,12 @@ class SendCoin extends React.Component {
this.props.ActiveCoin.mode === 'basilisk') {
this.handleBasiliskSend();
} else {
Store.dispatch(sendToAddress(this.props.ActiveCoin.coin, this.state));
Store.dispatch(
sendToAddress(
this.props.ActiveCoin.coin,
this.state
)
);
}
}
}
@ -390,49 +405,69 @@ class SendCoin extends React.Component {
iguanaUTXORawTX(sendData, Store.dispatch)
.then(function(json) {
console.log('sendData', sendData);
console.log('iguanaUTXORawTXJSON', json);
if (json.result === 'success' &&
json.completed === true) {
Store.dispatch(triggerToaster(translate('TOASTR.SIGNED_TX_GENERATED') + '.', translate('TOASTR.WALLET_NOTIFICATION'), 'success'));
Store.dispatch(
triggerToaster(
translate('TOASTR.SIGNED_TX_GENERATED') + '.',
translate('TOASTR.WALLET_NOTIFICATION'),
'success'
)
);
if (sendData.sendsig === 1) {
const dexrawtxData = {
'signedtx': json.signedtx,
'coin': sendData.coin
};
dexSendRawTX(dexrawtxData, Store.dispatch)
.then(function(dexRawTxJSON) {
console.log('dexRawTxJSON', dexRawTxJSON);
dexSendRawTX(
dexrawtxData,
Store.dispatch
).then(function(dexRawTxJSON) {
if (dexRawTxJSON.indexOf('"error":{"code"') > -1) {
Store.dispatch(triggerToaster('Transaction failed', translate('TOASTR.WALLET_NOTIFICATION'), 'error'));
Store.dispatch(
triggerToaster(
'Transaction failed',
translate('TOASTR.WALLET_NOTIFICATION'),
'error'
)
);
Store.dispatch(sendToAddressStateAlt(JSON.parse(dexRawTxJSON)));
this.setState(Object.assign({}, this.state, {
utxoMethodInProgress: false,
}));
} else {
Store.dispatch(triggerToaster(translate('TOASTR.SIGNED_TX_SENT'), translate('TOASTR.WALLET_NOTIFICATION'), 'success'));
Store.dispatch(
triggerToaster(
translate('TOASTR.SIGNED_TX_SENT'),
translate('TOASTR.WALLET_NOTIFICATION'),
'success'
)
);
Store.dispatch(sendToAddressStateAlt(json));
let getTxidData = function() {
return new Promise(function(resolve, reject) {
Store.dispatch(triggerToaster(translate('TOASTR.GETTING_TXID_INFO') + '.', translate('TOASTR.WALLET_NOTIFICATION'), 'info'));
Store.dispatch(
triggerToaster(
translate('TOASTR.GETTING_TXID_INFO') + '.',
translate('TOASTR.WALLET_NOTIFICATION'),
'info'
)
);
edexGetTransaction({
'coin': sendData.coin,
'txid': dexRawTxJSON.txid ? dexRawTxJSON.txid : dexRawTxJSON
}, Store.dispatch)
.then(function(json) {
console.log('gettx', json);
resolve(json);
});
});
}
let processRefreshUTXOs = function(vinData) {
console.log('vin', vinData);
return new Promise(function(resolve, reject) {
let edexGetTxIDListRes = edexGetTxIDList(vinData);
resolve(edexGetTxIDListRes);
@ -441,14 +476,9 @@ class SendCoin extends React.Component {
let getDataCacheContents = function(txidListToRemove) {
return new Promise(function(resolve, reject) {
console.log(txidListToRemove);
console.log(sendData);
getCacheFile(_pubkey)
.then(function(result) {
console.log('got cache file', result);
let saveThisData = edexRemoveTXID(result.result, _sendFrom, txidListToRemove);
console.log('saveThisData', saveThisData);
resolve(saveThisData);
});
});
@ -456,15 +486,19 @@ class SendCoin extends React.Component {
let saveNewCacheData = function(saveThisData) {
return new Promise(function(resolve, reject) {
console.log('saveNewCacheData', saveThisData);
shepherdGroomPostPromise(_pubkey, saveThisData)
.then(function(result) {
console.log('saveNewCacheData', saveThisData);
console.log(result);
shepherdGroomPostPromise(
_pubkey,
saveThisData
).then(function(result) {
resolve(result);
forceUpdateCache();
Store.dispatch(triggerToaster(translate('TOASTR.LOCAL_UTXO_UPDATED'), translate('TOASTR.WALLET_NOTIFICATION'), 'info'));
Store.dispatch(
triggerToaster(
translate('TOASTR.LOCAL_UTXO_UPDATED'),
translate('TOASTR.WALLET_NOTIFICATION'),
'info'
)
);
this.setState(Object.assign({}, this.state, {
utxoMethodInProgress: false,
@ -473,10 +507,22 @@ class SendCoin extends React.Component {
}.bind(this));
}.bind(this);
Store.dispatch(triggerToaster(translate('TOASTR.AWAITING_TX_RESP') + '...', translate('TOASTR.WALLET_NOTIFICATION'), 'info'));
Store.dispatch(
triggerToaster(
translate('TOASTR.AWAITING_TX_RESP') + '...',
translate('TOASTR.WALLET_NOTIFICATION'),
'info'
)
);
function waterfallUTXOProcess() {
Store.dispatch(triggerToaster(translate('TOASTR.PROCESSING_UTXO') + '...', translate('TOASTR.WALLET_NOTIFICATION'), 'info'));
Store.dispatch(
triggerToaster(
translate('TOASTR.PROCESSING_UTXO') + '...',
translate('TOASTR.WALLET_NOTIFICATION'),
'info'
)
);
getTxidData()
.then(function(gettxdata) {
@ -493,14 +539,13 @@ class SendCoin extends React.Component {
let sentTxData = setInterval(function() {
getTxidData()
.then(function(gettxdata) {
if (gettxdata.vin && gettxdata.vin.length) {
if (gettxdata.vin &&
gettxdata.vin.length) {
clearInterval(sentTxData);
waterfallUTXOProcess();
}
})
}, 1000);
console.log('utxo remove', true);
}
}.bind(this));
} else {
@ -512,7 +557,13 @@ class SendCoin extends React.Component {
}
} else {
Store.dispatch(sendToAddressStateAlt(json));
Store.dispatch(triggerToaster(translate('TOASTR.SIGNED_TX_GENERATED_FAIL') + '.', translate('TOASTR.WALLET_NOTIFICATION'), 'error'));
Store.dispatch(
triggerToaster(
translate('TOASTR.SIGNED_TX_GENERATED_FAIL') + '.',
translate('TOASTR.WALLET_NOTIFICATION'),
'error'
)
);
this.setState(Object.assign({}, this.state, {
utxoMethodInProgress: false,
@ -622,10 +673,22 @@ class SendCoin extends React.Component {
}
if (this.state.sendTo === '') {
Store.dispatch(triggerToaster('Couldn\'t find any ' + this.props.ActiveCoin.coin + ' addresses', 'OpenAlias', 'error'));
Store.dispatch(
triggerToaster(
'Couldn\'t find any ' + this.props.ActiveCoin.coin + ' addresses',
'OpenAlias',
'error'
)
);
}
} else {
Store.dispatch(triggerToaster('Couldn\'t find any addresses', 'OpenAlias', 'error'));
Store.dispatch(
triggerToaster(
'Couldn\'t find any addresses',
'OpenAlias',
'error'
)
);
}
}.bind(this));
}

111
react/src/components/dashboard/sendCoin/sendCoin.render.js

@ -9,13 +9,16 @@ export const UTXOCacheInfoRender = function(refreshCacheData, isReadyToUpdate, w
return (
<div className="col-lg-12">
<hr />
{ translate('SEND.TOTAL_UTXO_AVAILABLE') }: { refreshCacheData ? refreshCacheData.data && refreshCacheData.data.length : translate('SEND.PRESS_UPDATE_BTN') }<br />
{ translate('SEND.TOTAL_UTXO_AVAILABLE') }:
{ refreshCacheData ? refreshCacheData.data && refreshCacheData.data.length : translate('SEND.PRESS_UPDATE_BTN') }<br />
<div className={ !timestamp ? 'hide' : '' }>
{ translate('SEND.LAST_UPDATED') } @ { secondsToString(refreshCacheData ? refreshCacheData.timestamp : 0, true) } | { secondsElapsedToString(timestamp || 0) } { translate('SEND.AGO') }<br />
{ translate('SEND.LAST_UPDATED') } @
{ secondsToString(refreshCacheData ? refreshCacheData.timestamp : 0, true) } | { secondsElapsedToString(timestamp || 0) } { translate('SEND.AGO') }<br />
</div>
<div className={ isReadyToUpdate ? 'hide' : '' }>{ translate('SEND.NEXT_UPDATE_IN') } { secondsElapsedToString(600 - timestamp) }s</div>
<div
className={ 'full-width margin-bottom-10 margin-top-10 ' + (this.state.currentStackLength === 1 || (this.state.currentStackLength === 0 && this.state.totalStackLength === 0) ? 'hide' : 'progress progress-sm') }>
<div className={ isReadyToUpdate ? 'hide' : '' }>
{ translate('SEND.NEXT_UPDATE_IN') } { secondsElapsedToString(600 - timestamp) }s
</div>
<div className={ 'full-width margin-bottom-10 margin-top-10 ' + (this.state.currentStackLength === 1 || (this.state.currentStackLength === 0 && this.state.totalStackLength === 0) ? 'hide' : 'progress progress-sm') }>
<div
className="progress-bar progress-bar-striped active progress-bar-indicating progress-bar-success font-size-80-percent"
style={{ width: 100 - (this.state.currentStackLength * 100 / this.state.totalStackLength) + '%' }}>
@ -133,13 +136,21 @@ export const SendApiTypeSelectorRender = function () {
return (
<div className="row">
<div className="col-lg-10 margin-bottom-10">
<span className="pointer">
<label className="switch">
<input type="checkbox" checked={ this.state.sendApiType } />
<div className="slider" onClick={ this.toggleSendAPIType }></div>
</label>
<div className="toggle-label" onClick={ this.toggleSendAPIType }>{ translate('SEND.SEND_VIA') } (sendtoaddress API)</div>
</span>
<span className="pointer">
<label className="switch">
<input
type="checkbox"
checked={ this.state.sendApiType } />
<div
className="slider"
onClick={ this.toggleSendAPIType }></div>
</label>
<div
className="toggle-label"
onClick={ this.toggleSendAPIType }>
{ translate('SEND.SEND_VIA') } (sendtoaddress API)
</div>
</span>
</div>
</div>
);
@ -184,14 +195,22 @@ export const SendCoinRender = function () {
{ this.renderSendApiTypeSelector() }
<div className="row">
<div className={ this.props.ActiveCoin.mode === 'basilisk' ? 'col-xlg-12 form-group form-material' : 'hide' }>
<label className="control-label" htmlFor="edexcoinSendFrom">{ translate('INDEX.SEND_FROM') }</label>
<label
className="control-label"
htmlFor="edexcoinSendFrom">
{ translate('INDEX.SEND_FROM') }
</label>
{ this.renderAddressList() }
</div>
</div>
{ this.renderOASendUI() }
<div className="row">
<div className="col-xlg-12 form-group form-material">
<label className="control-label" htmlFor="edexcoinSendTo">{ translate('INDEX.SEND_TO') }</label>
<label
className="control-label"
htmlFor="edexcoinSendTo">
{ translate('INDEX.SEND_TO') }
</label>
<input
type="text"
className="form-control"
@ -204,8 +223,10 @@ export const SendCoinRender = function () {
required />
</div>
<div className="col-lg-6 form-group form-material">
<label className="control-label" htmlFor="edexcoinAmount">
{ this.props.ActiveCoin.coin }
<label
className="control-label"
htmlFor="edexcoinAmount">
{ this.props.ActiveCoin.coin }
</label>
<input
type="text"
@ -217,7 +238,11 @@ export const SendCoinRender = function () {
onChange={ this.updateInput } />
</div>
<div className="col-lg-6 form-group form-material">
<label className="control-label" htmlFor="edexcoinFee">{ translate('INDEX.FEE') }</label>
<label
className="control-label"
htmlFor="edexcoinFee">
{ translate('INDEX.FEE') }
</label>
<input
type="text"
className="form-control"
@ -230,18 +255,24 @@ export const SendCoinRender = function () {
onChange={ this.updateInput } />
</div>
<div className="col-lg-12">
<span>
<strong>{ translate('INDEX.TOTAL') } ({ translate('INDEX.AMOUNT_SM') } - txfee):</strong> { Number(this.state.amount) - Number(this.state.fee) } { this.props.ActiveCoin.coin }
</span>
<strong>{ translate('INDEX.TOTAL') } ({ translate('INDEX.AMOUNT_SM') } - txfee):</strong> { Number(this.state.amount) - Number(this.state.fee) } { this.props.ActiveCoin.coin }
</div>
<div className={ this.state.sendApiType ? 'hide' : 'col-lg-10 margin-top-30' }>
<span className="pointer">
<label className="switch">
<input type="checkbox" checked={ this.state.sendSig } />
<div className="slider" onClick={ this.toggleSendSig }></div>
</label>
<div className="toggle-label" onClick={ this.toggleSendSig }>{ translate('INDEX.DONT_SEND') }</div>
</span>
<span className="pointer">
<label className="switch">
<input
type="checkbox"
checked={ this.state.sendSig } />
<div
className="slider"
onClick={ this.toggleSendSig }></div>
</label>
<div
className="toggle-label"
onClick={ this.toggleSendSig }>
{ translate('INDEX.DONT_SEND') }
</div>
</span>
</div>
{ this.renderUTXOCacheInfo()}
<div className="col-lg-12">
@ -281,7 +312,9 @@ export const SendCoinRender = function () {
<div className="col-xs-12">
<strong>{ translate('INDEX.FROM') }</strong>
</div>
<div className="col-lg-6 col-sm-6 col-xs-12">{ this.props.Dashboard.activeHandle[this.props.ActiveCoin.coin] }</div>
<div className="col-lg-6 col-sm-6 col-xs-12">
{ this.props.Dashboard.activeHandle[this.props.ActiveCoin.coin] }
</div>
<div className="col-lg-6 col-sm-6 col-xs-6 confirm-currency-send-container">
{ Number(this.state.amount) - Number(this.state.fee) } { this.props.ActiveCoin.coin }
</div>
@ -294,7 +327,9 @@ export const SendCoinRender = function () {
<button
type="button"
className="btn btn-primary"
onClick={ () => this.changeSendCoinStep(2) }>{ translate('INDEX.CONFIRM') }</button>
onClick={ () => this.changeSendCoinStep(2) }>
{ translate('INDEX.CONFIRM') }
</button>
</div>
</div>
</div>
@ -304,19 +339,21 @@ export const SendCoinRender = function () {
<div className={ this.state.currentStep === 2 ? 'col-xlg-12 col-md-12 col-sm-12 col-xs-12' : 'col-xlg-12 col-md-12 col-sm-12 col-xs-12 hide' }>
<div className="panel">
<div className="panel-heading">
<h4 className="panel-title">{ translate('INDEX.TRANSACTION_RESULT') }</h4>
<h4 className="panel-title">
{ translate('INDEX.TRANSACTION_RESULT') }
</h4>
<div className={ !this.state.sendSig ? 'hide' : 'center' }>
{ translate('SEND.YOU_PICKED_OPT') }
</div>
<table className="table table-hover table-striped">
<thead>
<tr>
<th>{ translate('INDEX.KEY') }</th>
<th>{ translate('INDEX.INFO') }</th>
</tr>
<tr>
<th>{ translate('INDEX.KEY') }</th>
<th>{ translate('INDEX.INFO') }</th>
</tr>
</thead>
<tbody>
{ this.renderSendCoinResponse() }
{ this.renderSendCoinResponse() }
</tbody>
</table>
<div className="widget-body-footer">
@ -325,7 +362,9 @@ export const SendCoinRender = function () {
type="button"
className="btn btn-primary"
onClick={ () => this.changeSendCoinStep(0) }
disabled={ this.state.utxoMethodInProgress }>{ !this.state.utxoMethodInProgress ? translate('INDEX.MAKE_ANOTHER_TX') : translate('SEND.PLEASE_WAIT') + '...' }</button>
disabled={ this.state.utxoMethodInProgress }>
{ !this.state.utxoMethodInProgress ? translate('INDEX.MAKE_ANOTHER_TX') : translate('SEND.PLEASE_WAIT') + '...' }
</button>
</div>
</div>
</div>

46
react/src/components/dashboard/settings/settings.js

@ -82,7 +82,13 @@ class Settings extends React.Component {
}
execCliCmd() {
Store.dispatch(shepherdCli('passthru', this.state.cliCoin, this.state.cliCmd));
Store.dispatch(
shepherdCli(
'passthru',
this.state.cliCoin,
this.state.cliCmd
)
);
}
openTab(elemId, tab) {
@ -98,7 +104,13 @@ class Settings extends React.Component {
}
exportWifKeys() {
Store.dispatch(encryptWallet(this.state.wifkeysPassphrase, settingsWifkeyState, this.props.ActiveCoin.coin));
Store.dispatch(
encryptWallet(
this.state.wifkeysPassphrase,
settingsWifkeyState,
this.props.ActiveCoin.coin
)
);
}
importWifKey() {
@ -106,7 +118,12 @@ class Settings extends React.Component {
}
readDebugLog() {
Store.dispatch(getDebugLog(this.state.debugTarget, this.state.debugLinesCount));
Store.dispatch(
getDebugLog(
this.state.debugTarget,
this.state.debugLinesCount
)
);
}
checkNodes() {
@ -117,7 +134,12 @@ class Settings extends React.Component {
addNode() {
if (this.state.addNodeCoin) {
Store.dispatch(addPeerNode(this.state.addNodeCoin.split('|')[0], this.state.addPeerIP));
Store.dispatch(
addPeerNode(
this.state.addNodeCoin.split('|')[0],
this.state.addPeerIP
)
);
}
}
@ -326,14 +348,22 @@ class Settings extends React.Component {
modes.map(function(mode) {
allCoins[mode].map(function(coin) {
items.push(
<option value={ coin } key={ coin }>{ coin } ({ mode })</option>
<option
value={ coin }
key={ coin }>
{ coin } ({ mode })
</option>
);
});
});
} else {
allCoins[mode].map(function(coin) {
items.push(
<option value={ coin } key={ coin }>{ coin } ({ mode })</option>
<option
value={ coin }
key={ coin }>
{ coin } ({ mode })
</option>
);
});
}
@ -350,7 +380,9 @@ class Settings extends React.Component {
if (_wifKeysResponse &&
this.state.exportWifKeysRaw) {
return (
<div className="padding-bottom-30 padding-top-30">{ JSON.stringify(_wifKeysResponse, null, '\t') }</div>
<div className="padding-bottom-30 padding-top-30">
{ JSON.stringify(_wifKeysResponse, null, '\t') }
</div>
);
} else {
return null;

88
react/src/components/dashboard/settings/settings.render.js

@ -6,7 +6,10 @@ import AddCoinOptionsACFiat from '../../addcoin/addcoinOptionsACFiat';
export const AppInfoTabRender = function() {
return (
<div className="panel" id="AppInfo" onClick={ () => this.openTab('AppInfo', 8) }>
<div
className="panel"
id="AppInfo"
onClick={ () => this.openTab('AppInfo', 8) }>
<div className="panel-heading">
<a className={ this.state.activeTab === 8 ? 'panel-title' : 'panel-title collapsed' }>
<i className="icon md-info"></i>{ translate('SETTINGS.APP_INFO') }
@ -77,6 +80,9 @@ export const AppInfoTabRender = function() {
<div>
Komodo { translate('SETTINGS.DIR') }: { this.props.Settings.appInfo.dirs.komodoDir }
</div>
<div>
Komodo wallet.dat: { this.props.Settings.appInfo.dirs.komodoDir }
</div>
</div>
</div>
</div>
@ -88,13 +94,17 @@ export const AppInfoTabRender = function() {
export const SettingsRender = function() {
return (
<div className="margin-left-0">
<div className="page-content" id="section-iguana-wallet-settings">
<div
className="page-content"
id="section-iguana-wallet-settings">
<div className="row">
<div className="col-xlg-12 col-md-12">
<div className="row">
<div className="col-xlg-12 col-md-12">
<h4 className="font-size-14 text-uppercase">{ translate('INDEX.WALLET_SETTINGS') }</h4>
<div className="panel-group" id="SettingsAccordion">
<div
className="panel-group"
id="SettingsAccordion">
<div
className="panel"
id="WalletInfo"
@ -110,36 +120,36 @@ export const SettingsRender = function() {
<div className="panel-body">
<table className="table">
<thead>
<tr>
<th width="10%">{ translate('INDEX.KEY') }</th>
<th>{ translate('INDEX.VALUE') }</th>
</tr>
<tr>
<th width="10%">{ translate('INDEX.KEY') }</th>
<th>{ translate('INDEX.VALUE') }</th>
</tr>
</thead>
<tbody>
<tr>
<td className="wallet-info-key">pubkey</td>
<td>{ this.props.Main.activeHandle.pubkey }</td>
</tr>
<tr>
<td className="wallet-info-key">btcpubkey</td>
<td>{ this.props.Main.activeHandle.btcpubkey }</td>
</tr>
<tr>
<td className="wallet-info-key">rmd160</td>
<td>{ this.props.Main.activeHandle.rmd160 }</td>
</tr>
<tr>
<td className="wallet-info-key">NXT</td>
<td>{ this.props.Main.activeHandle.NXT }</td>
</tr>
<tr>
<td className="wallet-info-key">notary</td>
<td>{ this.props.Main.activeHandle.notary }</td>
</tr>
<tr>
<td className="wallet-info-key">status</td>
<td>{ this.props.Main.activeHandle.status }</td>
</tr>
<tr>
<td className="wallet-info-key">pubkey</td>
<td>{ this.props.Main.activeHandle.pubkey }</td>
</tr>
<tr>
<td className="wallet-info-key">btcpubkey</td>
<td>{ this.props.Main.activeHandle.btcpubkey }</td>
</tr>
<tr>
<td className="wallet-info-key">rmd160</td>
<td>{ this.props.Main.activeHandle.rmd160 }</td>
</tr>
<tr>
<td className="wallet-info-key">NXT</td>
<td>{ this.props.Main.activeHandle.NXT }</td>
</tr>
<tr>
<td className="wallet-info-key">notary</td>
<td>{ this.props.Main.activeHandle.notary }</td>
</tr>
<tr>
<td className="wallet-info-key">status</td>
<td>{ this.props.Main.activeHandle.status }</td>
</tr>
</tbody>
</table>
</div>
@ -287,7 +297,11 @@ export const SettingsRender = function() {
</strong>
</p>
<div className="col-sm-12"></div>
<form className="wifkeys-form" method="post" action="javascript:" autoComplete="off">
<form
className="wifkeys-form"
method="post"
action="javascript:"
autoComplete="off">
<div className="form-group form-material floating">
<input
type={ this.state.seedInputVisibility ? 'text' : 'password' }
@ -298,7 +312,9 @@ export const SettingsRender = function() {
<i
className={ this.state.seedInputVisibility ? 'seed-toggle fa fa-eye-slash' : 'seed-toggle fa fa-eye' }
onClick={ this.toggleSeedInputVisibility }></i>
<label className="floating-label" htmlFor="wifkeysPassphrase">{ translate('INDEX.PASSPHRASE') }</label>
<label
className="floating-label"
htmlFor="wifkeysPassphrase">{ translate('INDEX.PASSPHRASE') }</label>
</div>
<div className="col-sm-12 col-xs-12 text-align-center">
<button
@ -350,7 +366,11 @@ export const SettingsRender = function() {
</strong>
</p>
<div className="col-sm-12"></div>
<form className="wifkeys-import-form" method="post" action="javascript:" autoComplete="off">
<form
className="wifkeys-import-form"
method="post"
action="javascript:"
autoComplete="off">
<div className="form-group form-material floating">
<input
type="text"

32
react/src/components/dashboard/syncOnly/syncOnly.js

@ -62,7 +62,14 @@ class SyncOnly extends React.Component {
this.setState({
autoRestartedForks: _autoRestartedForks,
});
Store.dispatch(addCoin(forkInfo.registry.coin, '1', null, port));
Store.dispatch(
addCoin(
forkInfo.registry.coin,
'1',
null,
port
)
);
setTimeout(() => {
let _autoRestartedForks = Object.assign({}, this.state.autoRestartedForks);
@ -78,7 +85,12 @@ class SyncOnly extends React.Component {
}
closeSyncOnlyModal() {
Store.dispatch(stopInterval('syncOnly', this.props.Interval.interval));
Store.dispatch(
stopInterval(
'syncOnly',
this.props.Interval.interval
)
);
Store.dispatch(toggleSyncOnlyModal(false));
}
@ -90,8 +102,14 @@ class SyncOnly extends React.Component {
restartIguanaInstance(pmid)
.then(function(json) {
setTimeout(function() {
Store.dispatch(addCoin(coin, '1', null, port));
console.log('restartSyncOnlyInstance', json);
Store.dispatch(
addCoin(
coin,
'1',
null,
port
)
);
}, 2000);
});
}
@ -110,7 +128,11 @@ class SyncOnly extends React.Component {
forkInfo.registry &&
forkInfo.getinfo) {
items.push(
ForkItemRender.call(this, forkInfo, port)
ForkItemRender.call(
this,
forkInfo,
port
)
);
}
}

8
react/src/components/dashboard/syncOnly/syncOnly.render.js

@ -17,7 +17,9 @@ export const ProgressRender = function (fork) {
</div>
</div>
</div>
<div id="additional-progress-bars" className={ this.isFullySynced(fork) ? 'hide' : '' }>
<div
id="additional-progress-bars"
className={ this.isFullySynced(fork) ? 'hide' : '' }>
<div className="progress progress-sm">
<div
className="progress-bar progress-bar-warning progress-bar-striped active font-size-80-percent"
@ -46,7 +48,9 @@ export const ProgressRender = function (fork) {
export const ForkItemRender = function (forkInfo, port) {
return (
<div key={ port } className="padding-bottom-60 full-width">
<div
key={ port }
className="padding-bottom-60 full-width">
<div className="avatar">
<img
className="img-responsive margin-bottom-5"

17
react/src/components/dashboard/walletsBalance/walletsBalance.render.js

@ -7,7 +7,9 @@ const WalletsBalanceRender = function() {
<div className="col-xs-12">
<div className={ this.isActiveCoinMode('native') || (this.isActiveCoinMode('full') && !this.isFullySynced()) ? 'col-xs-12' : 'col-xs-12 hide' }>
<div className="alert alert-info alert-dismissible">
<button className="close" type="button">
<button
className="close"
type="button">
<span>×</span>
</button>
<h4>{ translate('INDEX.ACTIVATING_WALLET_RT') }</h4>
@ -17,7 +19,9 @@ const WalletsBalanceRender = function() {
</div>
<div className="alert alert-info alert-dismissible">
<button className="close" type="button">
<button
className="close"
type="button">
<span>×</span>
</button>
<h4>{ translate('INDEX.FETCHING_COIN_DATA') }</h4>
@ -33,7 +37,8 @@ const WalletsBalanceRender = function() {
<div className="padding-20 padding-top-10">
<div className="clearfix">
<div className="pull-left padding-vertical-10">
<i className="icon fa-eye font-size-24 vertical-align-bottom margin-right-5"></i>{ translate('INDEX.BALANCE')}
<i className="icon fa-eye font-size-24 vertical-align-bottom margin-right-5"></i>
{ translate('INDEX.BALANCE')}
</div>
<span className="pull-right padding-top-10 font-size-22">
{ this.renderBalance('main') } { this.props.ActiveCoin.coin }
@ -50,7 +55,8 @@ const WalletsBalanceRender = function() {
<div className="padding-20 padding-top-10">
<div className="clearfix">
<div className="pull-left padding-vertical-10">
<i className="icon fa-money font-size-24 vertical-align-bottom margin-right-5"></i>{ translate('INDEX.INTEREST_EARNED') }
<i className="icon fa-money font-size-24 vertical-align-bottom margin-right-5"></i>
{ translate('INDEX.INTEREST_EARNED') }
</div>
<span className="pull-right padding-top-10 font-size-22">
{ this.renderBalance('interest') } { this.props.ActiveCoin.coin }
@ -67,7 +73,8 @@ const WalletsBalanceRender = function() {
<div className="padding-20 padding-top-10">
<div className="clearfix">
<div className="pull-left padding-vertical-10">
<i className="icon fa-bullseye font-size-24 vertical-align-bottom margin-right-5"></i>{ translate('INDEX.TOTAL_BALANCE') }
<i className="icon fa-bullseye font-size-24 vertical-align-bottom margin-right-5"></i>
{ translate('INDEX.TOTAL_BALANCE') }
</div>
<span className="pull-right padding-top-10 font-size-22">
{ this.renderBalance('total') } { this.props.ActiveCoin.coin }

17
react/src/components/dashboard/walletsBasiliskConnection/walletsBasiliskConnection.render.js

@ -4,14 +4,19 @@ import { translate } from '../../../translate/translate';
const WalletsBasiliskConnectionRender = function() {
return (
<div onKeyDown={ (event) => this.handleKeydown(event) }>
<div className="modal show" id="RefreshBasiliskConnectionsMdl">
<div
className="modal show"
id="RefreshBasiliskConnectionsMdl">
<div className="modal-dialog modal-center modal-md">
<div className="modal-content">
<div className="modal-header bg-orange-a400 wallet-send-header">
<h4 className="modal-title white">
<span className="icon fa-refresh no-margin"></span> { translate('INDEX.REFRESHING_BASILISK_NET') }...
</h4>
<button type="button" className="close btn-close" onClick={ this.basiliskConnectionAction }>
<button
type="button"
className="close btn-close"
onClick={ this.basiliskConnectionAction }>
<span>&times;</span>
<span className="sr-only">{ translate('INDEX.CLOSE') }</span>
</button>
@ -56,12 +61,14 @@ const WalletsBasiliskConnectionRender = function() {
</div>
</div>
<h5 className="text-left">
{ `${translate('IAPI.CON_STATUS')}... ${this.props.Dashboard.connectedNotaries.current}/${this.props.Dashboard.connectedNotaries.total}:${this.props.Dashboard.connectedNotaries.currentNodeName}` } <span className="pull-right" id="basilisk-connections-refresh-percent">{ Math.floor(this.props.Dashboard.connectedNotaries.current * 100 / this.props.Dashboard.connectedNotaries.total) }%</span>
{ `${translate('IAPI.CON_STATUS')}... ${this.props.Dashboard.connectedNotaries.current} / ${this.props.Dashboard.connectedNotaries.total}:${this.props.Dashboard.connectedNotaries.currentNodeName}` } <span className="pull-right" id="basilisk-connections-refresh-percent">{ Math.floor(this.props.Dashboard.connectedNotaries.current * 100 / this.props.Dashboard.connectedNotaries.total) }%</span>
</h5>
<div className="progress progress-sm">
<div className="progress-bar progress-bar-info progress-bar-striped active font-size-80-percent" style={{ width: Math.floor(this.props.Dashboard.connectedNotaries.current * 100 / this.props.Dashboard.connectedNotaries.total) + '%' }} role="progressbar" id="basilisk-connections-refresh-progress-bar"></div>
<div
className="progress-bar progress-bar-info progress-bar-striped active font-size-80-percent"
style={{ width: Math.floor(this.props.Dashboard.connectedNotaries.current * 100 / this.props.Dashboard.connectedNotaries.total) + '%' }}></div>
</div>
<pre id="basilisk-connections-refresh-status-output no-padding">
<pre id="no-padding">
{ this.props.Dashboard.connectedNotaries.failedToConnectNodes ? `Failed: ${this.props.Dashboard.connectedNotaries.failedToConnectNodes}` : null }
</pre>
</div>

36
react/src/components/dashboard/walletsCacheData/walletsCacheData.js

@ -43,21 +43,29 @@ class WalletsCacheData extends React.Component {
if (_sourceObj.data[0] &&
Object.keys(_sourceObj.data[0]).length) {
return _sourceObj.data.map((key, value) =>
<TreeNode title={ key.txid ? key.txid : `${pre}-array-${value}` } key={ `{$pre}-${value}-array` }>
<TreeNode
title={ key.txid ? key.txid : `${pre}-array-${value}` }
key={ `{$pre}-${value}-array` }>
{ this.renderArrayNode(`${pre}-array-${value}`, key) }
</TreeNode>);
} else {
return Object.keys(_sourceObj.data).map((key, value) => this.renderKeyValue(pre, key, _sourceObj.data[key]));
return Object.keys(_sourceObj.data).map(
(key, value) => this.renderKeyValue(pre, key, _sourceObj.data[key])
);
}
}
renderArrayNode(pre, obj) {
return Object.keys(obj).map((key, value) => this.renderKeyValue(`${pre}-${key}`, key, obj[key]));
return Object.keys(obj).map(
(key, value) => this.renderKeyValue(`${pre}-${key}`, key, obj[key])
);
}
renderKeyValue(pre, key, value) {
return (
<TreeNode title={ `${key}: ${value}` } key={ `{$pre}-${key}` } />
<TreeNode
title={ `${key}: ${value}` }
key={ `{$pre}-${key}` } />
);
}
@ -67,17 +75,27 @@ class WalletsCacheData extends React.Component {
if (sourceObj[call].data &&
(sourceObj[call].data.length || Object.keys(sourceObj[call].data).length)) {
return (
<TreeNode title={ `${call}`} key={`${coin}-${address}-${call}` }>
<TreeNode title={ `status: ${sourceObj[call].status}` } key={ `${coin}-${address}-${call}-status` } />
<TreeNode title={ `updated @: ${secondsToString(sourceObj[call].timestamp, true)}` } key={ `${coin}-${address}-${call}-timestamp` } />
<TreeNode title="data" key={ `${coin}-${address}-${call}-data` }>
<TreeNode
title={ `${call}`}
key={`${coin}-${address}-${call}` }>
<TreeNode
title={ `status: ${sourceObj[call].status}` }
key={ `${coin}-${address}-${call}-status` } />
<TreeNode
title={ `updated @: ${secondsToString(sourceObj[call].timestamp, true)}` }
key={ `${coin}-${address}-${call}-timestamp` } />
<TreeNode
title="data"
key={ `${coin}-${address}-${call}-data` }>
{ this.renderKeyValueParent(`${coin}-${address}-${call}`, sourceObj[call]) }
</TreeNode>
</TreeNode>
);
} else {
return (
<TreeNode title={ `${call} (no data)` } key={ `${coin}-${address}-${call}` } />
<TreeNode
title={ `${call} (no data)` }
key={ `${coin}-${address}-${call}` } />
);
}
}

4
react/src/components/dashboard/walletsCacheData/walletsCacheData.render.js

@ -15,7 +15,9 @@ const WalletsCacheDataRender = function() {
<div className="tab-content">
<div className="tab-pane active">
{ this.renderNotariesFetching() }
<Tree defaultExpandAll={ false } openAnimation={ animation }>
<Tree
defaultExpandAll={ false }
openAnimation={ animation }>
{ this.renderCoinRootNodes() }
</Tree>
</div>

75
react/src/components/dashboard/walletsData/walletsData.js

@ -65,11 +65,19 @@ class WalletsData extends React.Component {
}
componentWillMount() {
document.addEventListener('click', this.handleClickOutside, false);
document.addEventListener(
'click',
this.handleClickOutside,
false
);
}
componentWillUnmount() {
document.removeEventListener('click', this.handleClickOutside, false);
document.removeEventListener(
'click',
this.handleClickOutside,
false
);
}
handleClickOutside(e) {
@ -217,7 +225,10 @@ class WalletsData extends React.Component {
(this.state.itemsList && !this.state.itemsList.length) ||
(props.ActiveCoin.txhistory !== this.props.ActiveCoin.txhistory)) {
let historyToSplit = sortByDate(this.props.ActiveCoin.txhistory);
historyToSplit = historyToSplit.slice((this.state.activePage - 1) * this.state.itemsPerPage, this.state.activePage * this.state.itemsPerPage);
historyToSplit = historyToSplit.slice(
(this.state.activePage - 1) * this.state.itemsPerPage,
this.state.activePage * this.state.itemsPerPage
);
this.setState(Object.assign({}, this.state, {
itemsList: historyToSplit,
@ -239,7 +250,10 @@ class WalletsData extends React.Component {
updateCurrentPage(page) {
let historyToSplit = sortByDate(this.props.ActiveCoin.txhistory);
historyToSplit = historyToSplit.slice((page - 1) * this.state.itemsPerPage, page * this.state.itemsPerPage);
historyToSplit = historyToSplit.slice(
(page - 1) * this.state.itemsPerPage,
page * this.state.itemsPerPage
);
this.setState(Object.assign({}, this.state, {
activePage: page,
@ -250,7 +264,7 @@ class WalletsData extends React.Component {
renderPaginationItems() {
let items = [];
for (let i=0; i < Math.ceil(this.props.ActiveCoin.txhistory.length / this.state.itemsPerPage); i++) {
for (let i = 0; i < Math.ceil(this.props.ActiveCoin.txhistory.length / this.state.itemsPerPage); i++) {
items.push(
PaginationItemRender.call(this, i)
);
@ -276,7 +290,11 @@ class WalletsData extends React.Component {
const _paginationFrom = ((this.state.activePage - 1) * this.state.itemsPerPage) + 1;
const _paginationTo = this.state.activePage * this.state.itemsPerPage;
return PaginationRender.call(this, _paginationFrom, _paginationTo);
return PaginationRender.call(
this,
_paginationFrom,
_paginationTo
);
} else {
return null;
}
@ -336,7 +354,11 @@ class WalletsData extends React.Component {
this.state.itemsList.length &&
this.state.itemsList !== 'no data') {
return this.state.itemsList.map((tx, index) =>
TxHistoryListRender.call(this, tx, index)
TxHistoryListRender.call(
this,
tx,
index
)
);
}
}
@ -354,7 +376,12 @@ class WalletsData extends React.Component {
if (this.props.ActiveCoin.mode === 'basilisk') {
setTimeout(() => {
Store.dispatch(changeMainBasiliskAddress(address));
Store.dispatch(getBasiliskTransactionsList(this.props.ActiveCoin.coin, address));
Store.dispatch(
getBasiliskTransactionsList(
this.props.ActiveCoin.coin,
address
)
);
}, 100);
Store.dispatch(fetchNewCacheData({
@ -373,38 +400,6 @@ class WalletsData extends React.Component {
}));
}
/*filterTable() {
function myFunction() {
// Declare variables
var input, filter, table, tr, td, i;
input = document.getElementById("myInput");
filter = input.value.toUpperCase();
table = document.getElementById("myTable");
tr = table.getElementsByTagName("tr");
// Loop through all table rows, and hide those who don't match the search query
for (i = 0; i < tr.length; i++) {
td = tr[i].getElementsByTagName("td")[0];
if (td) {
if (td.innerHTML.toUpperCase().indexOf(filter) > -1) {
tr[i].style.display = "";
} else {
tr[i].style.display = "none";
}
}
}
}
}*/
// deprecated
renderUseCacheToggle() {
if (this.props.ActiveCoin.mode === 'basilisk') {
return UseCacheToggleRender.call(this);
}
return null;
}
renderAddressByType(type) {
if (this.props.ActiveCoin.addresses &&
this.props.ActiveCoin.addresses[type] &&

10
react/src/components/dashboard/walletsData/walletsData.render.js

@ -42,7 +42,15 @@ export const PaginationRender = function(paginationFrom, paginationTo) {
return (
<div className="row unselectable">
<div className="col-sm-5">
<div className="dataTables_info">{ translate('INDEX.SHOWING') } { paginationFrom } { translate('INDEX.TO_ALT') } { paginationTo } { translate('INDEX.OF') } { this.props.ActiveCoin.txhistory.length } { translate('INDEX.ENTRIES_SM') }</div>
<div className="dataTables_info">
{ translate('INDEX.SHOWING') }
{ paginationFrom }
{ translate('INDEX.TO_ALT') }
{ paginationTo }
{ translate('INDEX.OF') }
{ this.props.ActiveCoin.txhistory.length }
{ translate('INDEX.ENTRIES_SM') }
</div>
</div>
<div className="col-sm-7">
<div className="dataTables_paginate paging_simple_numbers">

21
react/src/components/dashboard/walletsHeader/walletsHeader.render.js

@ -6,12 +6,19 @@ const WalletsHeaderRender = function() {
<div
className="page-header page-header-bordered header-easydex margin-bottom-0"
id="easydex-header-div"
style={{ backgroundImage: `url("assets/images/bg/${this.props.activeSection}_transparent_header_bg.png")`, backgroundRepeat: 'no-repeat', backgroundPosition: '0%' }}>
style={{
backgroundImage: `url("assets/images/bg/${this.props.activeSection}_transparent_header_bg.png")`,
backgroundRepeat: 'no-repeat',
backgroundPosition: '0%'
}}>
<h1 className={ this.isActiveSectionJumblr() ? 'hide' : 'page-title' }>EasyDEX</h1>
<ol className="breadcrumb">
<li className={ this.isActiveSectionJumblr() ? 'hide' : 'header-easydex-section' }>{ translate('INDEX.DASHBOARD') }</li>
<li className={ this.isActiveSectionJumblr() ? 'hide' : 'header-easydex-section' }>
{ translate('INDEX.DASHBOARD') }
</li>
<li className={ !this.isActiveSectionJumblr() ? 'hide' : 'header-easydex-section' }>
<img src="assets/images/native/jumblr_header_title_logo.png" /><br /> { translate('SIDEBAR.JUMBLR_MOTTO') }
<img src="assets/images/native/jumblr_header_title_logo.png" /><br />
{ translate('SIDEBAR.JUMBLR_MOTTO') }
</li>
</ol>
<div className="page-header-actions z-index-1 hide">
@ -38,7 +45,9 @@ const WalletsHeaderRender = function() {
</ul>
</div>
<div id="zec_header_button" className="hide">
<div
id="zec_header_button"
className="hide">
<button
type="button"
className="bg-yellow-600 btn btn-floating white waves-effect waves-float waves-light">
@ -69,7 +78,9 @@ const WalletsHeaderRender = function() {
</button>
</div>
<div id="kmd_header_button" className="hide">
<div
id="kmd_header_button"
className="hide">
<button
type="button"
className="bg-teal-500 btn btn-floating white waves-effect waves-float waves-light">

10
react/src/components/dashboard/walletsNative/walletsNative.render.js

@ -10,10 +10,16 @@ const WalletsNativeRender = function() {
return (
<div className="page margin-left-0">
<div className="padding-top-0">
<div id="easydex-header-div" className="background-color-white" style={{ 'backgroundImage': `url("assets/images/bg/${this.defaultBG()}_transparent_header_bg.png")` }}>
<div
id="easydex-header-div"
className="background-color-white"
style={{ 'backgroundImage': `url("assets/images/bg/${this.defaultBG()}_transparent_header_bg.png")` }}>
<ol className="breadcrumb">
<li className="header-easydex-section">
<img src={ `assets/images/native/${this.defaultBG()}_header_title_logo.png` } /> <span className={ `easydex-section-image ${(this.props.ActiveCoin.coin === 'KMD' ? 'hide' : '')}` }>{ this.props.ActiveCoin.coin }</span>
<img src={ `assets/images/native/${this.defaultBG()}_header_title_logo.png` } />
<span className={ `easydex-section-image ${(this.props.ActiveCoin.coin === 'KMD' ? 'hide' : '')}` }>
{ this.props.ActiveCoin.coin }
</span>
</li>
</ol>
</div>

4
react/src/components/dashboard/walletsNativeAlert/walletsNativeAlert.render.js

@ -4,7 +4,9 @@ import { translate } from '../../../translate/translate';
const WalletsNativeAlertRender = function() {
return (
<div className="alert alert-danger alert-dismissible">
<button className="close" type="button">
<button
className="close"
type="button">
<span>×</span>
</button>
<h4>{ translate('INDEX.OOPS_ERROR') }</h4>

28
react/src/components/dashboard/walletsNativeBalance/walletsNativeBalance.render.js

@ -10,9 +10,12 @@ const WalletsNativeBalanceRender = function() {
<div className="padding-20 padding-top-10">
<div className="clearfix">
<div className="pull-left padding-vertical-10">
<i className="icon fa-eye font-size-24 vertical-align-bottom margin-right-5"></i>{ translate('INDEX.TRANSPARENT_BALANCE') }
<i className="icon fa-eye font-size-24 vertical-align-bottom margin-right-5"></i>
{ translate('INDEX.TRANSPARENT_BALANCE') }
</div>
<span className="pull-right padding-top-10 font-size-22">{ this.props.ActiveCoin.balance.transparent ? this.props.ActiveCoin.balance.transparent : '-' }</span>
<span className="pull-right padding-top-10 font-size-22">
{ this.props.ActiveCoin.balance.transparent ? this.props.ActiveCoin.balance.transparent : '-' }
</span>
</div>
</div>
</div>
@ -25,9 +28,12 @@ const WalletsNativeBalanceRender = function() {
<div className="padding-20 padding-top-10">
<div className="clearfix">
<div className="pull-left padding-vertical-10">
<i className="icon fa-eye-slash font-size-24 vertical-align-bottom margin-right-5"></i>{ translate('INDEX.Z_BALANCE') }
<i className="icon fa-eye-slash font-size-24 vertical-align-bottom margin-right-5"></i>
{ translate('INDEX.Z_BALANCE') }
</div>
<span className="pull-right padding-top-10 font-size-22">{ this.props.ActiveCoin.balance.private ? this.props.ActiveCoin.balance.private : '-' }</span>
<span className="pull-right padding-top-10 font-size-22">
{ this.props.ActiveCoin.balance.private ? this.props.ActiveCoin.balance.private : '-' }
</span>
</div>
</div>
</div>
@ -40,9 +46,12 @@ const WalletsNativeBalanceRender = function() {
<div className="padding-20 padding-top-10">
<div className="clearfix">
<div className="pull-left padding-vertical-10">
<i className="icon fa-money font-size-24 vertical-align-bottom margin-right-5"></i>{ translate('INDEX.INTEREST_EARNED') }
<i className="icon fa-money font-size-24 vertical-align-bottom margin-right-5"></i>
{ translate('INDEX.INTEREST_EARNED') }
</div>
<span className="pull-right padding-top-10 font-size-22">{ this.props.Dashboard.progress && this.props.Dashboard.progress.interest ? this.props.Dashboard.progress.interest : '-' }</span>
<span className="pull-right padding-top-10 font-size-22">
{ this.props.Dashboard.progress && this.props.Dashboard.progress.interest ? this.props.Dashboard.progress.interest : '-' }
</span>
</div>
</div>
</div>
@ -55,9 +64,12 @@ const WalletsNativeBalanceRender = function() {
<div className="padding-20 padding-top-10">
<div className="clearfix">
<div className="pull-left padding-vertical-10">
<i className="icon fa-bullseye font-size-24 vertical-align-bottom margin-right-5"></i>{ translate('INDEX.ZT_BALANCE') }
<i className="icon fa-bullseye font-size-24 vertical-align-bottom margin-right-5"></i>
{ translate('INDEX.ZT_BALANCE') }
</div>
<span className="pull-right padding-top-10 font-size-22">{ this.props.ActiveCoin.balance.total ? this.props.ActiveCoin.balance.total : '-' }</span>
<span className="pull-right padding-top-10 font-size-22">
{ this.props.ActiveCoin.balance.total ? this.props.ActiveCoin.balance.total : '-' }
</span>
</div>
</div>
</div>

58
react/src/components/dashboard/walletsNativeInfo/walletsNativeInfo.render.js

@ -12,30 +12,30 @@ const WalletsNativeInfoRender = function() {
<div className="table-responsive">
<table className="table table-striped">
<tbody>
<tr>
<td>{ translate('INDEX.WALLET_VERSION') }</td>
<td>
{ this.props.Dashboard.progress.walletversion }
</td>
</tr>
<tr>
<td>{ translate('INDEX.BALANCE') }</td>
<td>
{ this.props.Dashboard.progress.balance }
</td>
</tr>
<tr>
<td>{ translate('INDEX.UNCONFIRMED_BALANCE') }</td>
<td></td>
</tr>
<tr>
<td>{ translate('INDEX.IMMATURE_BALANCE') }</td>
<td></td>
</tr>
<tr>
<td>{ translate('INDEX.TOTAL_TX_COUNT') }</td>
<td></td>
</tr>
<tr>
<td>{ translate('INDEX.WALLET_VERSION') }</td>
<td>
{ this.props.Dashboard.progress.walletversion }
</td>
</tr>
<tr>
<td>{ translate('INDEX.BALANCE') }</td>
<td>
{ this.props.Dashboard.progress.balance }
</td>
</tr>
<tr>
<td>{ translate('INDEX.UNCONFIRMED_BALANCE') }</td>
<td></td>
</tr>
<tr>
<td>{ translate('INDEX.IMMATURE_BALANCE') }</td>
<td></td>
</tr>
<tr>
<td>{ translate('INDEX.TOTAL_TX_COUNT') }</td>
<td></td>
</tr>
</tbody>
</table>
</div>
@ -76,9 +76,15 @@ const WalletsNativeInfoRender = function() {
</td>
<td>
{ this.props.Dashboard.progress.notarizedhash ?
this.props.Dashboard.progress.notarizedhash.substring(0, Math.floor(this.props.Dashboard.progress.notarizedhash.length / 2)) +
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)
this.props.Dashboard.progress.notarizedhash.substring(
Math.floor(this.props.Dashboard.progress.notarizedhash.length / 2),
this.props.Dashboard.progress.notarizedhash.length
)
: ''
}
</td>

28
react/src/components/dashboard/walletsNativeReceive/walletsNativeReceive.js

@ -20,11 +20,19 @@ class WalletsNativeReceive extends React.Component {
}
componentWillMount() {
document.addEventListener('click', this.handleClickOutside, false);
document.addEventListener(
'click',
this.handleClickOutside,
false
);
}
componentWillUnmount() {
document.removeEventListener('click', this.handleClickOutside, false);
document.removeEventListener(
'click',
this.handleClickOutside,
false
);
}
handleClickOutside(e) {
@ -50,8 +58,13 @@ class WalletsNativeReceive extends React.Component {
if (this.props.ActiveCoin.addresses &&
this.props.ActiveCoin.addresses[type] &&
this.props.ActiveCoin.addresses[type].length) {
return this.props.ActiveCoin.addresses[type].map((address) =>
AddressListRender.call(this, address, type)
return this.props.ActiveCoin.addresses[type].map(
(address) =>
AddressListRender.call(
this,
address,
type
)
);
}
@ -59,7 +72,12 @@ class WalletsNativeReceive extends React.Component {
}
getNewAddress(type) {
Store.dispatch(getNewKMDAddresses(this.props.ActiveCoin.coin, type));
Store.dispatch(
getNewKMDAddresses(
this.props.ActiveCoin.coin,
type
)
);
}
render() {

24
react/src/components/dashboard/walletsNativeReceive/walletsNativeReceive.render.js

@ -6,11 +6,14 @@ export const AddressListRender = function(address, type) {
<tr key={ address.address }>
<td>
<span className={ type === 'public' ? 'label label-default' : 'label label-dark' }>
<i className={ type === 'public' ? 'icon fa-eye' : 'icon fa-eye-slash' }></i> { type === 'public' ? translate('IAPI.PUBLIC_SM') : translate('KMD_NATIVE.PRIVATE') }
<i className={ type === 'public' ? 'icon fa-eye' : 'icon fa-eye-slash' }></i>
{ type === 'public' ? translate('IAPI.PUBLIC_SM') : translate('KMD_NATIVE.PRIVATE') }
</span>
<button
className="btn btn-default btn-xs clipboard-edexaddr margin-left-10"
onClick={ () => this.copyZAddress(address.address) }><i className="icon wb-copy"></i> { translate('INDEX.COPY') }</button>
onClick={ () => this.copyZAddress(address.address) }>
<i className="icon wb-copy"></i> { translate('INDEX.COPY') }
</button>
</td>
<td>{ type === 'public' ? address.address : address.address.substring(0, 34) + '...' }</td>
<td>{ address.amount }</td>
@ -29,20 +32,25 @@ export const WalletsNativeReceiveRender = function() {
<div className="panel">
<header className="panel-heading">
<div className="panel-actions">
<div className={ 'dropdown' + (this.state.openDropMenu ? ' open' : '') } onClick={ this.openDropMenu }>
<div
className={ 'dropdown' + (this.state.openDropMenu ? ' open' : '') }
onClick={ this.openDropMenu }>
<a className="dropdown-toggle white btn btn-warning">
<i className="icon md-arrows margin-right-10"></i> { translate('INDEX.GET_NEW_ADDRESS') } <span className="caret"></span>
<i className="icon md-arrows margin-right-10"></i>
{ translate('INDEX.GET_NEW_ADDRESS') }
<span className="caret"></span>
</a>
<ul
className="dropdown-menu dropdown-menu-right">
<ul className="dropdown-menu dropdown-menu-right">
<li>
<a onClick={ () => this.getNewAddress('public') }>
<i className="icon fa-eye"></i> { translate('INDEX.TRANSPARENT_ADDRESS') }
<i className="icon fa-eye"></i>
{ translate('INDEX.TRANSPARENT_ADDRESS') }
</a>
</li>
<li>
<a onClick={ () => this.getNewAddress('private') }>
<i className="icon fa-eye-slash"></i> { translate('INDEX.PRIVATE_Z_ADDRESS') }
<i className="icon fa-eye-slash"></i>
{ translate('INDEX.PRIVATE_Z_ADDRESS') }
</a>
</li>
</ul>

51
react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js

@ -36,11 +36,19 @@ class WalletsNativeSend extends React.Component {
}
componentWillMount() {
document.addEventListener('click', this.handleClickOutside, false);
document.addEventListener(
'click',
this.handleClickOutside,
false
);
}
componentWillUnmount() {
document.removeEventListener('click', this.handleClickOutside, false);
document.removeEventListener(
'click',
this.handleClickOutside,
false
);
}
handleClickOutside(e) {
@ -71,7 +79,11 @@ class WalletsNativeSend extends React.Component {
if (this.state.sendFrom) {
return (
<span>
<i className={ this.state.addressType === 'public' ? 'icon fa-eye' : 'icon fa-eye-slash' }></i> <span className="text">[ { this.state.sendFromAmount } { this.props.ActiveCoin.coin } ] { this.state.sendFrom }</span>
<i className={ this.state.addressType === 'public' ? 'icon fa-eye' : 'icon fa-eye-slash' }></i>
<span className="text">
[ { this.state.sendFromAmount } { this.props.ActiveCoin.coin } ]
{ this.state.sendFrom }
</span>
</span>
);
} else {
@ -107,7 +119,8 @@ class WalletsNativeSend extends React.Component {
return (
<span className={ `label label-${_satatusDef[opid.status].icon}` }>
<i className="icon fa-eye"></i> <span>{ translate(`KMD_NATIVE.${_satatusDef[opid.status].label}`) }</span>
<i className="icon fa-eye"></i>
<span>{ translate(`KMD_NATIVE.${_satatusDef[opid.status].label}`) }</span>
</span>
);
}
@ -192,9 +205,19 @@ class WalletsNativeSend extends React.Component {
}
handleSubmit() {
Store.dispatch(sendNativeTx(this.props.ActiveCoin.coin, this.state));
Store.dispatch(
sendNativeTx(
this.props.ActiveCoin.coin,
this.state
)
);
setTimeout(() => {
Store.dispatch(getKMDOPID(null, this.props.ActiveCoin.coin));
Store.dispatch(
getKMDOPID(
null,
this.props.ActiveCoin.coin
)
);
}, 1000);
}
@ -218,10 +241,22 @@ class WalletsNativeSend extends React.Component {
}
if (this.state.sendTo === '') {
Store.dispatch(triggerToaster('Couldn\'t find any ' + this.props.ActiveCoin.coin + ' addresses', 'OpenAlias', 'error'));
Store.dispatch(
triggerToaster(
'Couldn\'t find any ' + this.props.ActiveCoin.coin + ' addresses',
'OpenAlias',
'error'
)
);
}
} else {
Store.dispatch(triggerToaster('Couldn\'t find any addresses', 'OpenAlias', 'error'));
Store.dispatch(
triggerToaster(
'Couldn\'t find any addresses',
'OpenAlias',
'error'
)
);
}
});
}

28
react/src/components/dashboard/walletsNativeSend/walletsNativeSend.render.js

@ -17,7 +17,8 @@ export const AddressListRender = function() {
<div className="dropdown-menu open">
<ul className="dropdown-menu inner">
<li className="selected">
<a><span className="text"> - { translate('SEND.SELECT_T_OR_Z_ADDR') } - </span><span className="glyphicon glyphicon-ok check-mark"></span></a>
<a><span className="text"> - { translate('SEND.SELECT_T_OR_Z_ADDR') } - </span>
<span className="glyphicon glyphicon-ok check-mark"></span></a>
</li>
{ this.renderAddressByType('public') }
{ this.renderAddressByType('private') }
@ -60,14 +61,19 @@ export const WalletsNativeSendRender = function() {
return (
<div id="kmd_wallet_send">
<div className="col-xlg-12 col-md-12 col-sm-12 col-xs-12">
<div className="panel" id="projects">
<div
className="panel"
id="projects">
<div className="panel-heading">
<h3 className="panel-title">
{ translate('INDEX.SEND') } { this.props.ActiveCoin.coin }
</h3>
</div>
<div className="panel-body container-fluid">
<form className="extcoin-send-form" method="post" autoComplete="off">
<form
className="extcoin-send-form"
method="post"
autoComplete="off">
<div className="row">
<div className="col-xlg-12 form-group form-material">
<label className="control-label">{ translate('INDEX.SEND_FROM') }</label>
@ -77,7 +83,9 @@ export const WalletsNativeSendRender = function() {
{ this.renderOASendUI() }
<div className="row">
<div className="col-xlg-12 form-group form-material">
<label className="control-label" htmlFor="kmdWalletSendTo">{ translate('INDEX.SEND_TO') }</label>
<label
className="control-label"
htmlFor="kmdWalletSendTo">{ translate('INDEX.SEND_TO') }</label>
<input
type="text"
className="form-control"
@ -90,7 +98,9 @@ export const WalletsNativeSendRender = function() {
required />
</div>
<div className="col-lg-6 form-group form-material">
<label className="control-label" htmlFor="kmdWalletAmount">
<label
className="control-label"
htmlFor="kmdWalletAmount">
{ this.props.ActiveCoin.coin }
</label>
<input
@ -103,7 +113,9 @@ export const WalletsNativeSendRender = function() {
autoComplete="off" />
</div>
<div className="col-lg-6 form-group form-material">
<label className="control-label" htmlFor="kmdWalletFee">{ translate('INDEX.FEE') }</label>
<label
className="control-label"
htmlFor="kmdWalletFee">{ translate('INDEX.FEE') }</label>
<input
type="text"
className="form-control"
@ -116,7 +128,9 @@ export const WalletsNativeSendRender = function() {
</div>
<div className="col-lg-12">
<span>
<strong>{ translate('INDEX.TOTAL') }:</strong> { this.state.amount } - { this.state.fee }/kb = { Number(this.state.amount) - Number(this.state.fee) } { this.props.ActiveCoin.coin }
<strong>{ translate('INDEX.TOTAL') }:</strong>
{ this.state.amount } - { this.state.fee }/kb = { Number(this.state.amount) - Number(this.state.fee) }
{ this.props.ActiveCoin.coin }
</span>
</div>
<div className="col-lg-12">

4
react/src/components/dashboard/walletsNativeSyncProgress/walletsNativeSyncProgress.render.js

@ -4,7 +4,9 @@ import { translate } from '../../../translate/translate';
export const ChainActivationNotificationRender = function() {
return (
<div className="alert alert-info alert-dismissible margin-bottom-40">
<button className="close" type="button">
<button
className="close"
type="button">
<span>×</span>
</button>
<h4>

28
react/src/components/dashboard/walletsNativeTxHistory/walletsNativeTxHistory.js

@ -27,7 +27,12 @@ class WalletsNativeTxHistory extends React.Component {
// filter based on addr
toggleTxInfoModal(display, txIndex) {
Store.dispatch(toggleDashboardTxInfoModal(display, txIndex));
Store.dispatch(
toggleDashboardTxInfoModal(
display,
txIndex
)
);
}
isFullySynced() {
@ -102,9 +107,14 @@ class WalletsNativeTxHistory extends React.Component {
if (!this.state.itemsList ||
(this.state.itemsList && !this.state.itemsList.length) ||
(props.ActiveCoin.txhistory !== this.props.ActiveCoin.txhistory)) {
if (this.props.ActiveCoin.txhistory && this.props.ActiveCoin.txhistory !== 'loading' && this.props.ActiveCoin.txhistory !== 'no data') {
if (this.props.ActiveCoin.txhistory &&
this.props.ActiveCoin.txhistory !== 'loading' &&
this.props.ActiveCoin.txhistory !== 'no data') {
let historyToSplit = sortByDate(this.props.ActiveCoin.txhistory);
historyToSplit = historyToSplit.slice((this.state.activePage - 1) * this.state.itemsPerPage, this.state.activePage * this.state.itemsPerPage);
historyToSplit = historyToSplit.slice(
(this.state.activePage - 1) * this.state.itemsPerPage,
this.state.activePage * this.state.itemsPerPage
);
this.setState(Object.assign({}, this.state, {
itemsList: historyToSplit,
@ -115,7 +125,10 @@ class WalletsNativeTxHistory extends React.Component {
updateCurrentPage(page) {
let historyToSplit = sortByDate(this.props.ActiveCoin.txhistory);
historyToSplit = historyToSplit.slice((page - 1) * this.state.itemsPerPage, page * this.state.itemsPerPage);
historyToSplit = historyToSplit.slice(
(page - 1) * this.state.itemsPerPage,
page * this.state.itemsPerPage
);
this.setState(Object.assign({}, this.state, {
activePage: page,
@ -157,7 +170,12 @@ class WalletsNativeTxHistory extends React.Component {
const _paginationEnd = this.state.activePage * this.state.itemsPerPage;
const _paginationNextState = this.state.activePage > Math.floor(this.props.ActiveCoin.txhistory.length / this.state.itemsPerPage);
return PaginationRender.call(this, _paginationStart, _paginationEnd, _paginationNextState);
return PaginationRender.call(
this,
_paginationStart,
_paginationEnd,
_paginationNextState
);
}
return null;

27
react/src/components/dashboard/walletsNativeTxHistory/walletsNativeTxHistory.render.js

@ -26,8 +26,15 @@ export const PaginationRender = function(paginationStart, paginationEnd, paginat
return (
<div className="row unselectable">
<div className="col-sm-5">
<div
className="dataTables_info">{ translate('INDEX.SHOWING') } { paginationStart } { translate('INDEX.TO') } { paginationEnd } { translate('INDEX.OF') } { this.props.ActiveCoin.txhistory.length } { translate('INDEX.ENTRIES_SM') }</div>
<div className="dataTables_info">
{ translate('INDEX.SHOWING') }
{ paginationStart }
{ translate('INDEX.TO') }
{ paginationEnd }
{ translate('INDEX.OF') }
{ this.props.ActiveCoin.txhistory.length }
{ translate('INDEX.ENTRIES_SM') }
</div>
</div>
<div className="col-sm-7">
<div className="dataTables_paginate paging_simple_numbers">
@ -36,7 +43,7 @@ export const PaginationRender = function(paginationStart, paginationEnd, paginat
=== 1 ? 'paginate_button previous disabled' : 'paginate_button previous' }>
<a onClick={ () => this.updateCurrentPage(this.state.activePage - 1) }>{ translate('INDEX.PREVIOUS') }</a>
</li>
{this.renderPaginationItems()}
{ this.renderPaginationItems() }
<li className={ paginationNextState ? 'paginate_button next disabled' : 'paginate_button next' }>
<a onClick={ () => this.updateCurrentPage(this.state.activePage + 1) }>{ translate('INDEX.NEXT') }</a>
</li>
@ -64,7 +71,9 @@ export const TxHistoryListRender = function() {
<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></button>
onClick={ () => this.toggleTxInfoModal(!this.props.ActiveCoin.showTransactionInfo, index) }>
<i className="icon fa-search"></i>
</button>
</td>
</tr>
);
@ -90,13 +99,19 @@ export const WalletsNativeTxHistoryRender = function() {
<div className="col-sm-6">
<div className="dataTables_filter">
<label>
{ translate('INDEX.SEARCH') }: <input type="search" className="form-control input-sm" disabled="true" />
{ translate('INDEX.SEARCH') }:
<input
type="search"
className="form-control input-sm"
disabled="true" />
</label>
</div>
</div>
</div>
<div className="row">
<table className="table table-hover dataTable table-striped" width="100%">
<table
className="table table-hover dataTable table-striped"
width="100%">
<thead>
<tr>
<th>{ translate('INDEX.TYPE') }</th>

6
react/src/components/dashboard/walletsNativeTxInfo/walletsNativeTxInfo.render.js

@ -5,7 +5,9 @@ import { secondsToString } from '../../../util/time';
const WalletsNativeTxInfoRender = function(txInfo) {
return (
<div onKeyDown={ (event) => this.handleKeydown(event) }>
<div className="modal show" id="kmd_txid_info_mdl">
<div
className="modal show"
id="kmd_txid_info_mdl">
<div className="modal-dialog modal-center modal-lg">
<div className="modal-content">
<div className="modal-body modal-body-container">
@ -64,7 +66,7 @@ const WalletsNativeTxInfoRender = function(txInfo) {
<tr>
<td>blockindex</td>
<td>
{txInfo.blockindex}
{ txInfo.blockindex }
</td>
</tr>
<tr>

18
react/src/components/dashboard/walletsNav/walletsNav.js

@ -29,7 +29,11 @@ class WalletsNav extends React.Component {
toggleSendReceiveCoinForms() {
if (this.props.ActiveCoin.mode === 'native') {
Store.dispatch(toggleDashboardActiveSection(this.props.ActiveCoin.nativeActiveSection === 'settings' ? 'default' : 'settings'));
Store.dispatch(
toggleDashboardActiveSection(
this.props.ActiveCoin.nativeActiveSection === 'settings' ? 'default' : 'settings'
)
);
} else {
Store.dispatch(toggleSendReceiveCoinForms());
}
@ -37,7 +41,11 @@ class WalletsNav extends React.Component {
toggleSendCoinForm(display) {
if (this.props.ActiveCoin.mode === 'native') {
Store.dispatch(toggleDashboardActiveSection(this.props.ActiveCoin.nativeActiveSection === 'send' ? 'default' : 'send'));
Store.dispatch(
toggleDashboardActiveSection(
this.props.ActiveCoin.nativeActiveSection === 'send' ? 'default' : 'send'
)
);
} else {
Store.dispatch(toggleSendCoinForm(display));
}
@ -45,7 +53,11 @@ class WalletsNav extends React.Component {
toggleReceiveCoinForm(display) {
if (this.props.ActiveCoin.mode === 'native') {
Store.dispatch(toggleDashboardActiveSection(this.props.ActiveCoin.nativeActiveSection === 'receive' ? 'default' : 'receive'));
Store.dispatch(
toggleDashboardActiveSection(
this.props.ActiveCoin.nativeActiveSection === 'receive' ? 'default' : 'receive'
)
);
} else {
Store.dispatch(toggleReceiveCoinForm(display));
}

12
react/src/components/dashboard/walletsNav/walletsNav.render.js

@ -6,7 +6,9 @@ export const WalletsNavNoWalletRender = function () {
<div>
<div className="col-xs-12 padding-top-20">
<div className="alert alert-info alert-dismissible">
<button type="button" className="close"></button>
<button
type="button"
className="close"></button>
<span className="font-size-24 text-align-center">
<i className="icon fa-paw"></i> { translate('INDEX.NO_WALLET_CAPS') }
</span>
@ -26,7 +28,13 @@ export const WalletsNavWithWalletRender = function () {
id="header-dashboard"
style={{ marginBottom: this.props.ActiveCoin.mode === 'basilisk' ? '30px' : '0' }}>
<ol className="breadcrumb">
<strong>{ translate('INDEX.MY') } { this.props && this.props.ActiveCoin ? this.props.ActiveCoin.coin : '-' } { translate('INDEX.ADDRESS') }: </strong> { this.props && this.props.Dashboard && this.props.Dashboard.activeHandle ? this.props.Dashboard.activeHandle[this.props.ActiveCoin.coin] : '-' } <button className="btn btn-default btn-xs clipboard-edexaddr" onClick={ () => this.copyMyAddress(this.props.Dashboard.activeHandle[this.props.ActiveCoin.coin]) }><i className="icon wb-copy"></i> { translate('INDEX.COPY') }</button>
<strong>{ translate('INDEX.MY') } { this.props && this.props.ActiveCoin ? this.props.ActiveCoin.coin : '-' } { translate('INDEX.ADDRESS') }: </strong>
{ this.props && this.props.Dashboard && this.props.Dashboard.activeHandle ? this.props.Dashboard.activeHandle[this.props.ActiveCoin.coin] : '-' }
<button
className="btn btn-default btn-xs clipboard-edexaddr"
onClick={ () => this.copyMyAddress(this.props.Dashboard.activeHandle[this.props.ActiveCoin.coin]) }>
<i className="icon wb-copy"></i> { translate('INDEX.COPY') }
</button>
</ol>
<div className="page-header-actions">
<div id="kmd_header_button">

4
react/src/components/dashboard/walletsNotariesList/walletsNotariesList.js

@ -40,8 +40,8 @@ class WalletsNotariesList extends React.Component {
if (this.props.ActiveCoin.notaries &&
this.props.ActiveCoin.notaries.notaries &&
this.props.ActiveCoin.notaries.notaries.length) {
return this.props.ActiveCoin.notaries.notaries.map((node, index) =>
NotariesListRender.call(this, node, index)
return this.props.ActiveCoin.notaries.notaries.map(
(node, index) => NotariesListRender.call(this, node, index)
);
} else {
return null;

24
react/src/components/dashboard/walletsNotariesList/walletsNotariesList.render.js

@ -4,17 +4,27 @@ import Tree, { TreeNode } from 'rc-tree';
import { animation } from '../../../util/rc-tree-animate';
export const NotariesListRender = function (node, index) {
<TreeNode title={ `Node ${index}` } key={ `node-${index}` }>
<TreeNode key={ `node-${index}-btc` } title={ `BTC: ${node.BTCaddress}` } />
<TreeNode key={ `node-${index}-kmd` } title={ `KMD: ${node.KMDaddress}` } />
<TreeNode key={ `node-${index}-pubkey` } title={ `Pubkey: ${node.pubkey}` } />
<TreeNode
title={ `Node ${index}` }
key={ `node-${index}` }>
<TreeNode
key={ `node-${index}-btc` }
title={ `BTC: ${node.BTCaddress}` } />
<TreeNode
key={ `node-${index}-kmd` }
title={ `KMD: ${node.KMDaddress}` } />
<TreeNode
key={ `node-${index}-pubkey` }
title={ `Pubkey: ${node.pubkey}` } />
</TreeNode>
};
export const WalletsNotariesListRender = function () {
return (
<div onKeyDown={ (event) => this.handleKeydown(event) }>
<div className="modal show" id="kmd_txid_info_mdl">
<div
className="modal show"
id="kmd_txid_info_mdl">
<div className="modal-dialog modal-center modal-lg">
<div className="modal-content">
<div className="modal-body modal-body-container">
@ -23,7 +33,9 @@ export const WalletsNotariesListRender = function () {
<div className="tab-content">
<div className="tab-pane active">
{ this.renderNotariesFetching() }
<Tree defaultExpandAll={ false } openAnimation={ animation }>
<Tree
defaultExpandAll={ false }
openAnimation={ animation }>
{ this.renderNotariesList() }
</Tree>
</div>

4
react/src/components/dashboard/walletsProgress/walletsProgress.render.js

@ -3,7 +3,9 @@ import { translate } from '../../../translate/translate';
const WalletsProgressRender = function () {
return (
<div id="edex-footer" className="margin-bottom-20">
<div
id="edex-footer"
className="margin-bottom-20">
<div className="row no-space">
<div id="currency-progressbars">
<div className="progress progress-sm">

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

@ -5,7 +5,9 @@ import { secondsToString } from '../../../util/time';
const WalletsTxInfoRender = function(txInfo) {
return (
<div onKeyDown={ (event) => this.handleKeydown(event) }>
<div className="modal show" id="kmd_txid_info_mdl">
<div
className="modal show"
id="kmd_txid_info_mdl">
<div className="modal-dialog modal-center modal-lg">
<div className="modal-content">
<div className="modal-body modal-body-container">

21
react/src/components/login/login.js

@ -50,7 +50,12 @@ class Login extends React.Component {
const _iguanaActiveHandle = setInterval(() => {
Store.dispatch(getSyncOnlyForks());
}, IGUNA_ACTIVE_HANDLE_TIMEOUT);
Store.dispatch(startInterval('syncOnly', _iguanaActiveHandle));
Store.dispatch(
startInterval(
'syncOnly',
_iguanaActiveHandle
)
);
Store.dispatch(toggleSyncOnlyModal(true));
}
@ -125,7 +130,9 @@ class Login extends React.Component {
}
loginSeed() {
Store.dispatch(iguanaWalletPassphrase(this.state.loginPassphrase));
Store.dispatch(
iguanaWalletPassphrase(this.state.loginPassphrase)
);
}
updateActiveLoginSection(name) {
@ -135,7 +142,12 @@ class Login extends React.Component {
}
execWalletCreate() {
Store.dispatch(createNewWallet(this.state.randomSeedConfirm, this.props.Dashboard.activeHandle));
Store.dispatch(
createNewWallet(
this.state.randomSeedConfirm,
this.props.Dashboard.activeHandle
)
);
this.setState({
activeLoginSection: 'activateCoin',
@ -175,7 +187,8 @@ class Login extends React.Component {
}
render() {
if ((this.state && this.state.display) || !this.props.Main) {
if ((this.state && this.state.display) ||
!this.props.Main) {
return LoginRender.call(this);
}

33
react/src/components/login/login.render.js

@ -8,11 +8,16 @@ const LoginRender = function () {
<div className="page animsition vertical-align text-center fade-in">
<div className="page-content vertical-align-middle">
<div className="brand">
<img className="brand-img" src="assets/images/easydex-logo-big.png" alt="SuperNET Iguana" />
<img
className="brand-img"
src="assets/images/easydex-logo-big.png"
alt="SuperNET Iguana" />
</div>
<div className="vertical-padding-20 horizontal-padding-0">
<span className="display-sync-only-coins-toggle" onClick={ this.openSyncOnlyModal }>
<span
className="display-sync-only-coins-toggle"
onClick={ this.openSyncOnlyModal }>
<i className="fa fa-cubes"></i> { translate('LOGIN.DISPLAY_SYNC_ONLY') }
</span>
</div>
@ -56,7 +61,9 @@ const LoginRender = function () {
<i
className={ this.state.seedInputVisibility ? 'seed-toggle fa fa-eye-slash' : 'seed-toggle fa fa-eye' }
onClick={ this.toggleSeedInputVisibility }></i>
<label className="floating-label" htmlFor="inputPassword">{ translate('INDEX.WALLET_SEED') }</label>
<label
className="floating-label"
htmlFor="inputPassword">{ translate('INDEX.WALLET_SEED') }</label>
</div>
<button
type="button"
@ -129,13 +136,15 @@ const LoginRender = function () {
</div>
</div>
<div className="form-group form-material floating">
<textarea
className="form-control placeholder-no-fix height-100"
type="text"
id="walletseed"
value={ this.state.randomSeed }
readOnly="true"></textarea>
<label className="floating-label" htmlFor="walletseed">{ translate('INDEX.WALLET_SEED') }</label>
<textarea
className="form-control placeholder-no-fix height-100"
type="text"
id="walletseed"
value={ this.state.randomSeed }
readOnly="true"></textarea>
<label
className="floating-label"
htmlFor="walletseed">{ translate('INDEX.WALLET_SEED') }</label>
</div>
<div className="form-group form-material floating">
<textarea
@ -145,7 +154,9 @@ const LoginRender = function () {
onChange={ this.updateInput }
id="rwalletseed"></textarea>
<span className={ this.state.isSeedConfirmError ? 'help-block' : 'hide' }>{ translate('LOGIN.ENTER_VALUE_AGAIN') }.</span>
<label className="floating-label" htmlFor="rwalletseed">{ translate('INDEX.CONFIRM_SEED') }</label>
<label
className="floating-label"
htmlFor="rwalletseed">{ translate('INDEX.CONFIRM_SEED') }</label>
</div>
<button
type="button"

25
react/src/components/login/login.scss

@ -15,15 +15,16 @@
margin-top: -230px;
}
button.swal2-confirm-container {
background-color: rgb(48, 133, 214);
border-left-color: rgb(48, 133, 214);
border-right-color: rgb(48, 133, 214);
}
button.swal2-cancel-container {
display: inline-block;
background-color: rgb(221, 51, 51);
button {
&.swal2-confirm-container {
background-color: rgb(48, 133, 214);
border-left-color: rgb(48, 133, 214);
border-right-color: rgb(48, 133, 214);
}
&.swal2-cancel-container {
display: inline-block;
background-color: rgb(221, 51, 51);
}
}
.vertical-padding-20 {
@ -44,6 +45,8 @@ button.swal2-cancel-container {
margin-bottom: 30px;
}
textarea.height-100 {
height: 100px;
textarea {
&.height-100 {
height: 100px;
}
}

312
react/src/components/overrides.scss

@ -1,19 +1,27 @@
/* TODO: nesting, separate */
#app > div {
height: 100%;
#app {
> div {
height: 100%;
}
}
.page-main {
background: #f3f4f5;
}
#kmd_header_button button {
margin-right: 5px;
#kmd_header_button {
button {
margin-right: 5px;
}
}
.widget.active .bg-white {
box-shadow: inset 1px 1px 10px #ccc;
.widget {
&.active {
.bg-white {
box-shadow: inset 1px 1px 10px #ccc;
}
}
}
body {
@ -26,26 +34,25 @@ body {
margin: 30px 0;
}
#section-iguana-wallet-settings .panel-title {
cursor: pointer;
cursor: hand;
}
#section-iguana-wallet-settings {
background: #f3f4f5;
#section-iguana-wallet-settings .panel-title:before {
content: '\F273';
}
#section-iguana-wallet-settings .panel-title.collapsed:before {
content: '\F278';
.panel-title {
cursor: pointer;
cursor: hand;
}
.panel-title:before {
content: '\F273';
}
.panel-title.collapsed:before {
content: '\F278';
}
}
#section-dashboard {
height: 100%;
}
#section-iguana-wallet-settings {
background: #f3f4f5;
}
#edexcoin_dashboardinfo a,
.nav-top-menu,
#kmd_txid_info_mdl .nav-tabs li,
@ -72,9 +79,11 @@ body {
cursor: hand;
}
.radio-custom input {
cursor: pointer;
cursor: hand;
.radio-custom {
input {
cursor: pointer;
cursor: hand;
}
}
.collapse {
@ -94,8 +103,12 @@ body {
a {
pointer-events: none;
}
li span.rc-tree-iconEle {
display: none;
li {
span {
&.rc-tree-iconEle {
display: none;
}
}
}
}
@ -111,19 +124,23 @@ body {
user-select: all;
}
#RefreshBasiliskConnectionsMdl .btn-close {
position: absolute;
top: 15px;
right: 15px;
#RefreshBasiliskConnectionsMdl {
.btn-close {
position: absolute;
top: 15px;
right: 15px;
}
}
.page-aside {
position: fixed;
}
.page-aside-inner .wallet-widgets-list {
overflow-y: auto;
height: 100%;
.page-aside-inner {
.wallet-widgets-list {
overflow-y: auto;
height: 100%;
}
}
.display-sync-only-coins-toggle {
@ -264,20 +281,16 @@ body {
}
}
/* The switch - the box around the slider */
.switch {
position: relative;
display: inline-block;
width: 40px;
height: 24px;
input {
display: none;
}
}
/* Hide default HTML checkbox */
.switch input {
display: none;
}
/* The slider */
.slider {
border-radius: 20px;
position: absolute;
@ -289,19 +302,19 @@ body {
background-color: #ccc;
-webkit-transition: .4s;
transition: .4s;
}
.slider:before {
border-radius: 50%;
position: absolute;
content: "";
height: 20px;
width: 20px;
left: 2px;
bottom: 2px;
background-color: white;
-webkit-transition: .4s;
transition: .4s;
&:before {
border-radius: 50%;
position: absolute;
content: '';
height: 20px;
width: 20px;
left: 2px;
bottom: 2px;
background-color: white;
-webkit-transition: .4s;
transition: .4s;
}
}
.toggle-label {
@ -326,17 +339,19 @@ input:checked + .slider:before {
transform: translateX(16px);
}
.dropdown-menu li {
cursor: pointer;
}
/* Rounded sliders */
.slider.round {
border-radius: 34px;
.dropdown-menu {
li {
cursor: pointer;
}
}
.slider.round:before {
border-radius: 50%;
.slider {
&.round {
border-radius: 34px;
&:before {
border-radius: 50%;
}
}
}
.pointer {
@ -363,59 +378,59 @@ input:checked + .slider:before {
padding: 1em 1em 1em 2em;
border-left: 4px solid #DDD;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.125);
}
.notice:before {
position: absolute;
top: 50%;
margin-top: -17px;
left: -17px;
background-color: #DDD;
color: #FFF;
width: 30px;
height: 30px;
border-radius: 100%;
text-align: center;
line-height: 30px;
font-weight: bold;
font-family: Georgia;
text-shadow: 1px 1px rgba(0, 0, 0, 0.5);
&:before {
position: absolute;
top: 50%;
margin-top: -17px;
left: -17px;
background-color: #DDD;
color: #FFF;
width: 30px;
height: 30px;
border-radius: 100%;
text-align: center;
line-height: 30px;
font-weight: bold;
font-family: Georgia;
text-shadow: 1px 1px rgba(0, 0, 0, 0.5);
}
}
.info {
border-color: #0074D9;
}
.info:before {
content: 'i';
background-color: #0074D9;
&:before {
content: 'i';
background-color: #0074D9;
}
}
.success {
border-color: #2ECC40;
}
.success:before {
content: '';
background-color: #2ECC40;
&:before {
content: '';
background-color: #2ECC40;
}
}
.warning {
border-color: #FFDC00;
}
.warning:before {
content: '!';
background-color: #FFDC00;
&:before {
content: '!';
background-color: #FFDC00;
}
}
.error {
border-color: #FF4136;
}
.error:before {
content: 'X';
background-color: #FF4136;
&:before {
content: 'X';
background-color: #FF4136;
}
}
}
@ -430,21 +445,22 @@ input:checked + .slider:before {
.badge {
margin-left: 2px;
font-weight: bold;
}
.badge.success {
color: #3c763d;
background-color: #dff0d8;
border-color: #d6e9c6;
}
.badge.pending {
color: #8a6d3b;
background-color: #fcf8e3;
border-color: #faebcc;
}
.badge.error {
color: #a94442;
background-color: #f2dede;
border-color: #ebccd1;
&.success {
color: #3c763d;
background-color: #dff0d8;
border-color: #d6e9c6;
}
&.pending {
color: #8a6d3b;
background-color: #fcf8e3;
border-color: #faebcc;
}
&.error {
color: #a94442;
background-color: #f2dede;
border-color: #ebccd1;
}
}
.spinner-hide {
@ -500,57 +516,69 @@ input:checked + .slider:before {
height: 40px;
text-align: center;
font-size: 10px;
}
.spinner > div {
background-color: #333;
height: 100%;
width: 6px;
display: inline-block;
-webkit-animation: sk-stretchdelay 1.2s infinite ease-in-out;
animation: sk-stretchdelay 1.2s infinite ease-in-out;
}
.spinner .rect2 {
-webkit-animation-delay: -1.1s;
animation-delay: -1.1s;
}
.spinner .rect3 {
-webkit-animation-delay: -1.0s;
animation-delay: -1.0s;
}
> div {
background-color: #333;
height: 100%;
width: 6px;
display: inline-block;
.spinner .rect4 {
-webkit-animation-delay: -0.9s;
animation-delay: -0.9s;
}
-webkit-animation: sk-stretchdelay 1.2s infinite ease-in-out;
animation: sk-stretchdelay 1.2s infinite ease-in-out;
}
.spinner .rect5 {
-webkit-animation-delay: -0.8s;
animation-delay: -0.8s;
.rect2 {
-webkit-animation-delay: -1.1s;
animation-delay: -1.1s;
}
.rect3 {
-webkit-animation-delay: -1.0s;
animation-delay: -1.0s;
}
.rect4 {
-webkit-animation-delay: -0.9s;
animation-delay: -0.9s;
}
.rect5 {
-webkit-animation-delay: -0.8s;
animation-delay: -0.8s;
}
}
@-webkit-keyframes sk-stretchdelay {
0%, 40%, 100% { -webkit-transform: scaleY(0.4) }
20% { -webkit-transform: scaleY(1.0) }
0%,
40%,
100% {
-webkit-transform: scaleY(0.4)
}
20% {
-webkit-transform: scaleY(1.0)
}
}
@keyframes sk-stretchdelay {
0%, 40%, 100% {
0%,
40%,
100% {
transform: scaleY(0.4);
-webkit-transform: scaleY(0.4);
} 20% {
}
20% {
transform: scaleY(1.0);
-webkit-transform: scaleY(1.0);
}
}
.bootstrap-select > .dropdown-toggle {
z-index: 0;
.bootstrap-select {
> .dropdown-toggle {
z-index: 0;
}
}
select.form-control.form-material {
color: #757575;
select{
&.form-control {
&.form-material {
color: #757575;
}
}
}

4
react/src/components/toaster/toaster-item.js

@ -22,7 +22,6 @@ class ToasterItem extends React.Component {
};
this.dismissToast = this.dismissToast.bind(this);
this.timeoutHandler = null;
}
@ -53,7 +52,8 @@ class ToasterItem extends React.Component {
renderToast() {
// ensure that setTimeout is called only once for each toast message
if (this.state.autoClose && !this.timeoutHandler) {
if (this.state.autoClose &&
!this.timeoutHandler) {
this.timeoutHandler = setTimeout(() => {
this.dismissToast(this.state.toastId);
}, DISPLAY_LENGTH_MILLIS);

58
react/src/reducers/dashboard.js

@ -13,6 +13,16 @@ import {
const HTTP_STACK_MAX_ENTRIES = 150; // limit stack mem length to N records per type
const trimHTTPLogs = (logObject) => {
const logObjectArray = Object.keys(logObject);
if (logObjectArray.length - HTTP_STACK_MAX_ENTRIES === 1) {
delete logObject[logObjectArray.shift()];
}
return logObject;
};
export function Dashboard(state = {
activeSection: 'wallets',
activeHandle: null,
@ -25,7 +35,7 @@ export function Dashboard(state = {
currentNodeName: null,
failedToConnectNodes: null,
},
guiLog: {}
guiLog: {},
}, action) {
switch (action.type) {
case DASHBOARD_SECTION_CHANGE:
@ -70,44 +80,22 @@ export function Dashboard(state = {
displayViewCacheModal: action.display,
});
case LOG_GUI_HTTP:
let _guiLogState = state.guiLog;
let _guiLogStateTrim = {
error: [],
success: [],
pending: []
};
const logState = state.guiLog;
const actionTS = action.timestamp;
let newLogState = {};
if (_guiLogState[action.timestamp]) {
_guiLogState[action.timestamp].status = action.log.status;
_guiLogState[action.timestamp].response = action.log.response;
if (logState[actionTS]) {
const logItem = { [actionTS]: logState[actionTS] };
logItem[actionTS].status = action.log.status;
logItem[actionTS].response = action.log.response;
newLogState = trimHTTPLogs(Object.assign({}, logState, logItem));
} else {
_guiLogState[action.timestamp] = action.log;
const logItem = { [actionTS]: action.log };
newLogState = trimHTTPLogs(Object.assign({}, logState, logItem));
}
for (let timestamp in _guiLogState) {
if (_guiLogState[timestamp].status === 'error') {
_guiLogStateTrim.error.push(_guiLogState[timestamp]);
}
if (_guiLogState[timestamp].status === 'success') {
_guiLogStateTrim.success.push(_guiLogState[timestamp]);
}
if (_guiLogState[timestamp].status === 'pending') {
_guiLogStateTrim.pending.push(_guiLogState[timestamp]);
}
}
let _guiLogStateNew = {};
for (let _key in _guiLogStateTrim) {
if (_guiLogStateTrim[_key].length > HTTP_STACK_MAX_ENTRIES) {
_guiLogStateTrim[_key].shift();
}
for (let i = 0; i < _guiLogStateTrim[_key].length; i++) {
_guiLogStateNew[_guiLogStateTrim[_key][i].timestamp] = _guiLogStateTrim[_key][i];
}
}
return Object.assign({}, state, {
guiLog: _guiLogStateNew,
guiLog: newLogState,
});
default:
return state;

7
react/src/reducers/toaster.js

@ -6,12 +6,15 @@ import {
export function toaster(state = {
toasts: [],
}, action) {
if (state === null) state = {toasts: []};
if (state === null) state = { toasts: [] };
switch (action.type) {
case ADD_TOASTER_MESSAGE:
return {
...state,
toasts: [...state.toasts, action]
toasts: [
...state.toasts,
action
]
};
case REMOVE_TOASTER_MESSAGE:
// filter out the toastId that should be removed

11
react/src/store.js

@ -14,16 +14,17 @@ const defaultState = {
Main: null,
};
const enhancers = compose(window.devToolsExtension ? window.devToolsExtension() : f => f);
// const enhancers = compose(window.devToolsExtension ? window.devToolsExtension() : f => f);
/* eslint-disable no-underscore-dangle */
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
const enhancers = composeEnhancers(applyMiddleware(thunkMiddleware, loggerMiddleware));
const store = createStore(
rootReducer,
defaultState,
applyMiddleware(
thunkMiddleware,
loggerMiddleware,
),
enhancers);
/* eslint-enable */
export const history = syncHistoryWithStore(browserHistory, store);

7
react/src/translate/translate.js

@ -4,10 +4,13 @@ import Config from '../config';
export function translate(langID) {
let defaultLang = Config.defaultLang;
if (langID && langID.indexOf('.') > -1) {
if (langID &&
langID.indexOf('.') > -1) {
let langIDComponents = langID.split('.');
if (_lang && langIDComponents && _lang[defaultLang][langIDComponents[0]][langIDComponents[1]]) {
if (_lang &&
langIDComponents &&
_lang[defaultLang][langIDComponents[0]][langIDComponents[1]]) {
return _lang[defaultLang][langIDComponents[0]][langIDComponents[1]];
} else {
console.log('Missing translation in js/' + defaultLang.toLowerCase() + '.js ' + langID);

4
react/src/util/cacheFormat.js

@ -9,7 +9,7 @@ export function edexGetTxIDList(getTxData) {
}
export function edexRemoveTXID(_obj, address, txidArray) {
let txidToStr = ':' + txidArray.join(':') + ':';
let txidToStr = `:${txidArray.join(':')}:`;
if (_obj, _obj.basilisk) {
if (Object.keys(_obj.basilisk).length === 0) {
@ -24,7 +24,6 @@ export function edexRemoveTXID(_obj, address, txidArray) {
_obj.basilisk[key][coinAddr].refresh.data.length > 0) {
for (let i = 0; i < _obj.basilisk[key][coinAddr].refresh.data.length; i++) {
if (txidToStr.indexOf(_obj.basilisk[key][coinAddr].refresh.data[i].txid.toString()) > -1) {
console.log('cacheformat remove node', _obj.basilisk[key][coinAddr].refresh.data[i].txid);
_obj.basilisk[key][coinAddr].refresh.data.splice(i, 1);
_obj.basilisk[key][coinAddr].refresh.timestamp = Date.now();
}
@ -35,7 +34,6 @@ export function edexRemoveTXID(_obj, address, txidArray) {
_obj.basilisk[key][coinAddr].listunspent.data.length > 0) {
for (let i = 0; i < _obj.basilisk[key][coinAddr].listunspent.data.length; i++) {
if (txidToStr.indexOf(_obj.basilisk[key][coinAddr].listunspent.data[i].txid.toString()) > -1) {
console.log('cacheformat remove node', _obj.basilisk[key][coinAddr].listunspent.data[i].txid);
_obj.basilisk[key][coinAddr].listunspent.data.splice(i, 1);
_obj.basilisk[key][coinAddr].listunspent.timestamp = Date.now();
}

6
react/src/util/copyToClipboard.js

@ -1,12 +1,12 @@
export function copyToClipboard(value) {
var result;
var copyTextarea = document.querySelector('#js-copytextarea');
let result;
let copyTextarea = document.querySelector('#js-copytextarea');
document.getElementById('js-copytextarea').value = value;
copyTextarea.select();
try {
var successful = document.execCommand('copy');
document.execCommand('copy');
result = 1;
} catch (err) {
result = 0;

61
react/src/util/time.js

@ -1,46 +1,45 @@
export function secondsToString(seconds, skipMultiply, showSeconds) {
var a = new Date(seconds * (skipMultiply ? 1 : 1000)),
months = [
'Jan',
'Feb',
'Mar',
'Apr',
'May',
'Jun',
'Jul',
'Aug',
'Sep',
'Oct',
'Nov',
'Dec'
],
year = a.getFullYear(),
month = months[a.getMonth()],
date = a.getDate(),
hour = a.getHours() < 10 ? '0' + a.getHours() : a.getHours(),
min = a.getMinutes() < 10 ? '0' + a.getMinutes() : a.getMinutes(),
sec = a.getSeconds(),
time = date + ' ' + month + ' ' + year + ' ' + hour + ':' + min + (showSeconds ? ':' + sec : '');
const a = new Date(seconds * (skipMultiply ? 1 : 1000)),
months = [
'Jan',
'Feb',
'Mar',
'Apr',
'May',
'Jun',
'Jul',
'Aug',
'Sep',
'Oct',
'Nov',
'Dec'
],
year = a.getFullYear(),
month = months[a.getMonth()],
date = a.getDate(),
hour = a.getHours() < 10 ? `0${a.getHours()}` : a.getHours(),
min = a.getMinutes() < 10 ? `0 ${a.getMinutes()}` : a.getMinutes(),
sec = a.getSeconds(),
time = `${date} ${month} ${year} ${hour}:${min}${(showSeconds ? ':' + sec : '')}`;
return time;
}
export function checkTimestamp(dateToCheck) {
var currentEpochTime = new Date(Date.now()) / 1000,
secondsElapsed = Number(currentEpochTime) - Number(dateToCheck / 1000);
const currentEpochTime = new Date(Date.now()) / 1000,
secondsElapsed = Number(currentEpochTime) - Number(dateToCheck / 1000);
return Math.floor(secondsElapsed);
}
export function secondsElapsedToString(timestamp) { // in seconds
const secondsElapsed = checkTimestamp(timestamp);
let hours = Math.floor(timestamp / 3600);
let minutes = Math.floor((timestamp - (hours * 3600)) / 60);
let seconds = timestamp - (hours * 3600) - (minutes * 60);
let returnTimeVal = (hours > 0 ? hours + ' hour(s) ' : '') +
(minutes > 0 ? minutes + ' minute(s) ' : '') +
(seconds > 0 ? seconds + ' second(s) ' : '');
const hours = Math.floor(timestamp / 3600);
const minutes = Math.floor((timestamp - (hours * 3600)) / 60);
const seconds = timestamp - (hours * 3600) - (minutes * 60);
const returnTimeVal = (hours > 0 ? hours + ' hour(s) ' : '') +
(minutes > 0 ? minutes + ' minute(s) ' : '') +
(seconds > 0 ? seconds + ' second(s) ' : '');
return returnTimeVal;
}
Loading…
Cancel
Save