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') { if (mode === 'basilisk') {
getDexBalance(coin, mode, json.result); getDexBalance(
coin,
mode,
json.result
);
} }
return { return {

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

@ -53,18 +53,38 @@ export function addCoin(coin, mode, syncOnly, port) {
.then(function(json) { .then(function(json) {
setTimeout(function() { setTimeout(function() {
console.log(`started ${coin} / ${modeToValue[mode]} fork`, json); console.log(`started ${coin} / ${modeToValue[mode]} fork`, json);
dispatch(iguanaAddCoin(coin, mode, _acData, json.result)); dispatch(
iguanaAddCoin(
coin,
mode,
_acData,
json.result
)
);
}, 2000); }, 2000);
}); });
} }
} else { } else {
if (port) { if (port) {
return dispatch => { return dispatch => {
dispatch(iguanaAddCoin(coin, mode, _acData, port)); dispatch(
iguanaAddCoin(
coin,
mode,
_acData,
port
)
);
} }
} else { } else {
return dispatch => { 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', 'status': 'error',
'response': 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(response => response.json())
.then(json => { .then(json => {
@ -104,7 +130,13 @@ export function iguanaAddCoin(coin, mode, acData, port) {
'status': 'success', 'status': 'success',
'response': json, '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') { if (checkCoinType(coin) === 'crypto') {
acData = startCrypto(path.result, coin, mode); acData = startCrypto(
path.result,
coin,
mode
);
} }
if (checkCoinType(coin) === 'currency_ac') { if (checkCoinType(coin) === 'currency_ac') {
acData = startCurrencyAssetChain(path.result, coin, mode); acData = startCurrencyAssetChain(
path.result,
coin,
mode
);
} }
if (checkCoinType(coin) === 'ac') { if (checkCoinType(coin) === 'ac') {
acData = startAssetChain(path.result, coin, mode); const supply = startAssetChain(
const supply = startAssetChain(path.result, coin, mode, true); path.result,
coin,
mode,
true
);
acData = startAssetChain(
path.result,
coin,
mode
);
herdData.ac_options.push(`-ac_supply=${supply}`); herdData.ac_options.push(`-ac_supply=${supply}`);
} }
@ -176,10 +225,24 @@ export function shepherdHerd(coin, mode, path) {
}) })
.catch(function(error) { .catch(function(error) {
console.log(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(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 => { 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(toggleAddcoinModal(false, false));
dispatch(getDexCoins()); dispatch(getDexCoins());
} }
@ -208,10 +277,24 @@ export function _shepherdGetConfig(coin, mode) {
}) })
.catch(function(error) { .catch(function(error) {
console.log(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(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) { .catch(function(error) {
console.log(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(response => response.json())
.then(json => dispatch(shepherdHerd(coin, mode, json))) .then(
json => dispatch(
shepherdHerd(
coin,
mode,
json
)
)
)
} }
} else { } else {
return dispatch => { return dispatch => {
@ -244,10 +341,24 @@ export function shepherdGetConfig(coin, mode) {
}) })
.catch(function(error) { .catch(function(error) {
console.log(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(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) { .catch(function(error) {
console.log(error); console.log(error);
dispatch(triggerToaster('getKMDAddressesNative+addresslist+cache', 'Error', 'error')); dispatch(
triggerToaster(
'getKMDAddressesNative+addresslist+cache',
'Error',
'error'
)
);
}) })
.then(response => response.json()) .then(response => response.json())
.then(function(json) { .then(function(json) {
@ -121,7 +127,13 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
'status': 'error', 'status': 'error',
'response': error, 'response': error,
})); }));
dispatch(triggerToaster('getKMDAddressesNative', 'Error', 'error')); dispatch(
triggerToaster(
'getKMDAddressesNative',
'Error',
'error'
)
);
}) })
.then(response => response.json()) .then(response => response.json())
.then(json => { .then(json => {
@ -205,13 +217,12 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
} }
} }
if (isNewAddr) { if (isNewAddr &&
if (allAddrArray[a].substring(0, 2) === 'zc' || (allAddrArray[a].substring(0, 2) === 'zc' ||
allAddrArray[a].substring(0, 2) === 'zt') { allAddrArray[a].substring(0, 2) === 'zt')) {
result[1][result[1].length] = allAddrArray[a]; result[1][result[1].length] = allAddrArray[a];
} else { } else {
result[0][result[0].length] = allAddrArray[a]; result[0][result[0].length] = allAddrArray[a];
}
} }
} }
} }
@ -235,11 +246,6 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
sum += filteredArray[i]; sum += filteredArray[i];
} }
if (sum === 0 &&
a === 1) {
}
newAddressArray[a][b] = { newAddressArray[a][b] = {
address: result[a][b], address: result[a][b],
amount: currentAddress === result[a][b] || mode === 'native' ? sum : 'N/A', amount: currentAddress === result[a][b] || mode === 'native' ? sum : 'N/A',
@ -256,7 +262,8 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
const _timestamp = Date.now(); const _timestamp = Date.now();
let ajaxDataToHex = `["${_address}"]`; let ajaxDataToHex = `["${_address}"]`;
iguanaHashHex(ajaxDataToHex, dispatch).then((hashHexJson) => { iguanaHashHex(ajaxDataToHex, dispatch)
.then((hashHexJson) => {
if (getPassthruAgent(coin) === 'iguana') { if (getPassthruAgent(coin) === 'iguana') {
payload = { payload = {
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`, 'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
@ -296,7 +303,13 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
'status': 'error', 'status': 'error',
'response': error, 'response': error,
})); }));
dispatch(triggerToaster('getKMDAddressesNative+ZBalance', 'Error', 'error')); dispatch(
triggerToaster(
'getKMDAddressesNative+ZBalance',
'Error',
'error'
)
);
}) })
.then(response => response.json()) .then(response => response.json())
.then(function(json) { .then(function(json) {
@ -308,7 +321,13 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
'status': 'error', 'status': 'error',
'response': json, 'response': json,
})); }));
dispatch(triggerToaster('getKMDAddressesNative+ZBalance', 'Error', 'error')); dispatch(
triggerToaster(
'getKMDAddressesNative+ZBalance',
'Error',
'error'
)
);
} else { } else {
resolve(json); resolve(json);
newAddressArray[1][index] = { newAddressArray[1][index] = {
@ -351,7 +370,13 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
}) })
.catch(function(error) { .catch(function(error) {
console.log(error); console.log(error);
dispatch(triggerToaster('getKMDAddressesNative+addresslist+cache', 'Error', 'error')); dispatch(
triggerToaster(
'getKMDAddressesNative+addresslist+cache',
'Error',
'error'
)
);
}) })
.then(response => response.json()) .then(response => response.json())
.then(function(json) { .then(function(json) {
@ -383,7 +408,13 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
'status': 'error', 'status': 'error',
'response': error, 'response': error,
})); }));
dispatch(triggerToaster('getKMDAddressesNative+Balance', 'Error', 'error')); dispatch(
triggerToaster(
'getKMDAddressesNative+Balance',
'Error',
'error'
)
);
}) })
.then(response => response.json()) .then(response => response.json())
.then(function(json) { .then(function(json) {
@ -398,7 +429,12 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
'timestamp': Date.now(), 'timestamp': Date.now(),
}; };
dispatch(shepherdGroomPost(pubkey, updatedCache)); 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', 'status': 'error',
'response': error, 'response': error,
})); }));
dispatch(triggerToaster('getKMDAddressesNative+Balance', 'Error', 'error')); dispatch(
triggerToaster(
'getKMDAddressesNative+Balance',
'Error',
'error'
)
);
}) })
.then(response => response.json()) .then(response => response.json())
.then(function(json) { .then(function(json) {
@ -433,7 +475,12 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
'status': 'success', 'status': 'success',
'response': json, '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', 'status': 'error',
'response': error, 'response': error,
})); }));
dispatch(triggerToaster(payload.method, 'Atomic Explorer error', 'error')); dispatch(
triggerToaster(
payload.method,
'Atomic Explorer error',
'error'
)
);
}) })
.then(response => response.json()) .then(response => response.json())
.then(json => { .then(json => {

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

@ -19,10 +19,20 @@ export function deleteCacheFile(_payload) {
}) })
.catch(function(error) { .catch(function(error) {
console.log(error); console.log(error);
dispatch(triggerToaster('deleteCacheFile', 'Error', 'error')) dispatch(
triggerToaster(
'deleteCacheFile',
'Error',
'error'
)
);
}) })
.then(response => response.json()) .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) { .catch(function(error) {
console.log(error); console.log(error);
dispatch(triggerToaster('getCacheFile', 'Error', 'error')) dispatch(
triggerToaster(
'getCacheFile',
'Error',
'error'
)
);
}) })
.then(response => response.json()) .then(response => response.json())
.then(json => resolve(json)) .then(json => resolve(json))
@ -63,7 +79,13 @@ export function fetchNewCacheData(_payload) {
}) })
.catch(function(error) { .catch(function(error) {
console.log(error); console.log(error);
dispatch(triggerToaster('fetchNewCacheData', 'Error', 'error')); dispatch(
triggerToaster(
'fetchNewCacheData',
'Error',
'error'
)
);
}) })
.then(response => response.json()) .then(response => response.json())
.then(json => console.log(json)) .then(json => console.log(json))
@ -80,10 +102,24 @@ export function getShepherdCache(pubkey, coin) {
}) })
.catch(function(error) { .catch(function(error) {
console.log(error); console.log(error);
dispatch(triggerToaster('getShepherdCache', 'Error', 'error')); dispatch(
triggerToaster(
'getShepherdCache',
'Error',
'error'
)
);
}) })
.then(response => response.json()) .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) { .catch(function(error) {
console.log(error); console.log(error);
dispatch(triggerToaster('fetchNewCacheData', 'Error', 'error')); dispatch(
triggerToaster(
'fetchNewCacheData',
'Error',
'error'
)
);
}) })
.then(response => response.json()) .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) { .catch(function(error) {
console.log(error); console.log(error);
dispatch(triggerToaster('shepherdGroomPost', 'Error', 'error')); dispatch(
triggerToaster(
'shepherdGroomPost',
'Error',
'error'
)
);
}) })
.then(response => response.json()) .then(response => response.json())
.then(json => console.log(json)) .then(json => console.log(json))
@ -167,7 +219,13 @@ export function shepherdGroomPostPromise(_filename, _payload) {
}) })
.catch(function(error) { .catch(function(error) {
console.log(error); console.log(error);
dispatch(triggerToaster('shepherdGroomPostPromise', 'Error', 'error')); dispatch(
triggerToaster(
'shepherdGroomPostPromise',
'Error',
'error'
)
);
}) })
.then(response => response.json()) .then(response => response.json())
.then(json => resolve(json)) .then(json => resolve(json))

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

@ -39,7 +39,13 @@ export function checkAddressBasilisk(coin, address) {
'status': 'error', 'status': 'error',
'response': error, 'response': error,
})); }));
dispatch(triggerToaster('checkAddressBasilisk', 'Error', 'error')); dispatch(
triggerToaster(
'checkAddressBasilisk',
'Error',
'error'
)
);
}) })
.then(response => response.json()) .then(response => response.json())
.then(json => { .then(json => {
@ -57,7 +63,13 @@ function checkAddressBasiliskHandle(json) {
if (json && if (json &&
json.error) { json.error) {
return dispatch => { 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.coin &&
json.randipbits) { json.randipbits) {
return dispatch => { 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', 'status': 'error',
'response': error, 'response': error,
})); }));
dispatch(triggerToaster('validateAddressBasilisk', 'Error', 'error')); dispatch(
triggerToaster(
'validateAddressBasilisk',
'Error',
'error'
)
);
}) })
.then(response => response.json()) .then(response => response.json())
.then(json => { .then(json => {
@ -118,16 +142,40 @@ export function validateAddressBasilisk(coin, address) {
function validateAddressBasiliskHandle(json) { function validateAddressBasiliskHandle(json) {
return dispatch => { return dispatch => {
if (json.iswatchonly === true) { 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) { 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) { 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') { 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) { .catch(function(error) {
console.log(error); console.log(error);
dispatch(triggerToaster('getBasiliskTransactionsList+cache', 'Error', 'error')); dispatch(
triggerToaster(
'getBasiliskTransactionsList+cache',
'Error',
'error'
)
);
}) })
.then(response => response.json()) .then(response => response.json())
.then(function(json) { .then(function(json) {

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

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

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

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

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

@ -7,11 +7,23 @@ export function copyCoinAddress(address) {
if (_result) { if (_result) {
return dispatch => { 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 { } else {
return dispatch => { 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 &&
json.result === 'success') { json.result === 'success') {
return dispatch => { 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 { } else {
return dispatch => { 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', 'status': 'error',
'response': error, 'response': error,
})); }));
dispatch(triggerToaster('createNewWallet', 'Error', 'error')); dispatch(
triggerToaster(
'createNewWallet',
'Error',
'error'
)
);
}) })
.then(response => response.json()) .then(response => response.json())
.then(json => { .then(json => {

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -77,7 +77,13 @@ export function getKMDBalanceTotal(coin) {
'status': 'error', 'status': 'error',
'response': error, 'response': error,
})); }));
dispatch(triggerToaster('getKMDBalanceTotal', 'Error', 'error')); dispatch(
triggerToaster(
'getKMDBalanceTotal',
'Error',
'error'
)
);
}) })
.then(response => response.json()) .then(response => response.json())
.then(function(json) { // TODO: figure out why komodod spits out "parse error" .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'; } from './log';
function handleGetNewKMDAddresses(pubpriv, coin, dispatch) { 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)); dispatch(getKMDAddressesNative(coin));
return {}; return {};
@ -69,7 +75,13 @@ export function getNewKMDAddresses(coin, pubpriv) {
'status': 'error', 'status': 'error',
'response': error, 'response': error,
})); }));
dispatch(triggerToaster('getNewKMDAddresses', 'Error', 'error')); dispatch(
triggerToaster(
'getNewKMDAddresses',
'Error',
'error'
)
);
}) })
.then(response => response.json()) .then(response => response.json())
.then(json => { .then(json => {
@ -78,10 +90,22 @@ export function getNewKMDAddresses(coin, pubpriv) {
'status': 'success', 'status': 'success',
'response': json, 'response': json,
})); }));
dispatch(handleGetNewKMDAddresses(pubpriv, coin, dispatch)); dispatch(
handleGetNewKMDAddresses(
pubpriv,
coin,
dispatch
)
);
}) })
.catch(function(ex) { .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', 'status': 'error',
'response': error, 'response': error,
})); }));
dispatch(triggerToaster('sendNativeTx', 'Error', 'error')); dispatch(
triggerToaster(
'sendNativeTx',
'Error',
'error'
)
);
}) })
.then(function(response) { .then(function(response) {
const _response = response.text().then(function(text) { return text; }); const _response = response.text().then(function(text) { return text; });
@ -82,13 +88,34 @@ export function sendNativeTx(coin, _payload) {
if (json.indexOf('"code":') > -1) { if (json.indexOf('"code":') > -1) {
const _message = json.substring(json.indexOf('"message":"') + 11, json.indexOf('"},"id":"jl777"')); 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) { 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 { } 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', 'status': 'error',
'response': error, 'response': error,
})); }));
dispatch(triggerToaster('getKMDOPID', 'Error', 'error')); dispatch(
triggerToaster(
'getKMDOPID',
'Error',
'error'
)
);
}) })
.then(response => response.json()) .then(response => response.json())
.then(json => { .then(json => {

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

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

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

@ -44,7 +44,13 @@ function initNotaryNodesConSequence(nodes) {
'status': 'error', 'status': 'error',
'response': error, 'response': error,
})); }));
dispatch(triggerToaster(`getInfoDexNode+${node}`, 'Error', 'error')); dispatch(
triggerToaster(
`getInfoDexNode+${node}`,
'Error',
'error'
)
);
}) })
.then(response => response.json()) .then(response => response.json())
.then(json => { .then(json => {
@ -53,7 +59,14 @@ function initNotaryNodesConSequence(nodes) {
'status': 'success', 'status': 'success',
'response': json, '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) { .catch(function(error) {
console.log(error); console.log(error);
dispatch(triggerToaster('connectNotaries', 'Error', 'error')); dispatch(
triggerToaster(
'connectNotaries',
'Error',
'error'
)
);
}) })
.then(response => response.json()) .then(response => response.json())
.then(json => dispatch(connectAllNotaryNodes(json, dispatch))) .then(
json => dispatch(
connectAllNotaryNodes(json, dispatch)
)
)
} }
} }
function getDexNotariesState(json) { function getDexNotariesState(json) {
if (json.error === 'less than required responses') { if (json.error === 'less than required responses') {
return dispatch => { 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 { } else {
return { return {
@ -163,7 +192,13 @@ export function getDexNotaries(coin) {
'status': 'error', 'status': 'error',
'response': error, 'response': error,
})); }));
dispatch(triggerToaster('getDexNotaries', 'Error', 'error')); dispatch(
triggerToaster(
'getDexNotaries',
'Error',
'error'
)
);
}) })
.then(response => response.json()) .then(response => response.json())
.then(json => { .then(json => {

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

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

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

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

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

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

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

@ -53,7 +53,13 @@ export function getSyncInfo(coin) {
'status': 'error', 'status': 'error',
'response': error, 'response': error,
})); }));
dispatch(triggerToaster('getSyncInfo', 'Error', 'error')); dispatch(
triggerToaster(
'getSyncInfo',
'Error',
'error'
)
);
}) })
.then(function(response) { .then(function(response) {
const _response = response.text().then(function(text) { return text; }); 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) { .catch(function(error) {
console.log(error); console.log(error);
dispatch(triggerToaster('getSyncOnlyForks', 'Error', 'error')); dispatch(
triggerToaster(
'getSyncOnlyForks',
'Error',
'error'
)
);
}) })
.then(response => response.json()) .then(response => response.json())
.then(json => dispatch(getSyncOnlyForksState(json))) .then(json => dispatch(getSyncOnlyForksState(json)))
@ -53,9 +59,23 @@ export function stopIguanaFork(pmid) {
}) })
.catch(function(error) { .catch(function(error) {
console.log(error); console.log(error);
dispatch(triggerToaster('stopIguanaFork', 'Error', 'error')); dispatch(
triggerToaster(
'stopIguanaFork',
'Error',
'error'
)
);
}) })
.then(response => response.json()) .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) { .catch(function(error) {
console.log(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(response => response.json())
.then(json => console.log(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', 'status': 'error',
'response': error, 'response': error,
})); }));
dispatch(triggerToaster('encryptWallet', 'Error', 'error')); dispatch(
triggerToaster(
'encryptWallet',
'Error',
'error'
)
);
}) })
.then(dispatch(walletPassphrase(_passphrase))) .then(dispatch(walletPassphrase(_passphrase)))
.then(response => response.json()) .then(response => response.json())
@ -54,7 +60,13 @@ export function encryptWallet(_passphrase, cb, coin) {
'status': 'success', 'status': 'success',
'response': json, 'response': json,
})); }));
dispatch(cb.call(this, json, coin)); dispatch(
cb.call(
this,
json,
coin
)
);
}); });
} }
} }
@ -90,7 +102,13 @@ export function walletPassphrase(_passphrase) {
'status': 'error', 'status': 'error',
'response': error, 'response': error,
})); }));
dispatch(triggerToaster('walletPassphrase', 'Error', 'error')); dispatch(
triggerToaster(
'walletPassphrase',
'Error',
'error'
)
);
}) })
.then(json => { .then(json => {
dispatch(logGuiHttp({ dispatch(logGuiHttp({
@ -134,7 +152,13 @@ export function iguanaWalletPassphrase(_passphrase) {
'status': 'error', 'status': 'error',
'response': error, 'response': error,
})); }));
dispatch(triggerToaster('Error iguanaWalletPassphrase', 'Error', 'error')); dispatch(
triggerToaster(
'Error iguanaWalletPassphrase',
'Error',
'error'
)
);
}) })
.then(response => response.json()) .then(response => response.json())
.then(json => { .then(json => {
@ -178,7 +202,13 @@ export function iguanaActiveHandle(getMainAddress) {
'response': error, 'response': error,
})); }));
dispatch(updateErrosStack('activeHandle')); 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(response => response.json())
.then(json => { .then(json => {
@ -194,7 +224,13 @@ export function iguanaActiveHandle(getMainAddress) {
function iguanaWalletPassphraseState(json, dispatch) { function iguanaWalletPassphraseState(json, dispatch) {
sessionStorage.setItem('IguanaActiveAccount', JSON.stringify(json)); 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(getMainAddressState(json));
dispatch(iguanaActiveHandleState(json)); dispatch(iguanaActiveHandleState(json));

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

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

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

@ -14,7 +14,9 @@ const AddCoinRender = function() {
onClick={ this.dismiss }> onClick={ this.dismiss }>
<span>×</span> <span>×</span>
</button> </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>
<div className="modal-body"> <div className="modal-body">
<button <button
@ -28,18 +30,23 @@ const AddCoinRender = function() {
<span className={ !this.state.actionsMenu ? 'hide' : '' }> <span className={ !this.state.actionsMenu ? 'hide' : '' }>
<button <button
className="btn btn-outline-primary btn-save-coin-selection" 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 <button
className="btn btn-outline-primary btn-load-coin-selection" 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> </span>
{ this.renderCoinSelectors() } { this.renderCoinSelectors() }
<div <div className={ 'text-align-center vertical-margin-20 horizontal-margin-0 ' + (this.hasMoreThanOneCoin() ? 'col-sm-12' : 'hide') }>
className={ 'text-align-center vertical-margin-20 horizontal-margin-0 ' + (this.hasMoreThanOneCoin() ? 'col-sm-12' : 'hide') }>
<button <button
type="button" type="button"
className="btn btn-primary col-sm-4 float-none" 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>
<div className="col-sm-12"> <div className="col-sm-12">
<p> <p>
@ -49,13 +56,20 @@ const AddCoinRender = function() {
<strong>{ translate('INDEX.BASILISK_MODE') }:</strong> { translate('INDEX.BASILISK_MODE_DESC') } <strong>{ translate('INDEX.BASILISK_MODE') }:</strong> { translate('INDEX.BASILISK_MODE_DESC') }
</p> </p>
<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> </p>
<div className="alert alert-icon alert-primary"> <div className="alert alert-icon alert-primary">
<button type="button" className="close"> <button
type="button"
className="close">
<span>×</span> <span>×</span>
</button> </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> </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 AddCoinOptionsAC from '../addcoin/addcoinOptionsAC';
import AddCoinOptionsACFiat from '../addcoin/addcoinOptionsACFiat'; import AddCoinOptionsACFiat from '../addcoin/addcoinOptionsACFiat';
const CoinSelectorsRender = function(item, coin, i) { const CoinSelectorsRender = function(item, coin, i) {
return ( return (
<div <div
@ -30,7 +29,9 @@ const CoinSelectorsRender = function(item, coin, i) {
type="button" type="button"
className="btn btn-primary" className="btn btn-primary"
onClick={ () => this.activateCoin(i) } onClick={ () => this.activateCoin(i) }
disabled={ item.mode === -2 }>{ translate('INDEX.ACTIVATE_COIN') }</button> disabled={ item.mode === -2 }>
{ translate('INDEX.ACTIVATE_COIN') }
</button>
</div> </div>
<div className="col-sm-12 text-center"> <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"> <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> style={{ display: item.fullMode.checked ? 'none' : 'inline-block' }}></span>
<span <span
className="labelauty-unchecked" 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 <span
className="labelauty-checked-image" className="labelauty-checked-image"
style={{ display: item.fullMode.checked ? 'inline-block' : 'none' }}></span> style={{ display: item.fullMode.checked ? 'inline-block' : 'none' }}></span>
<span <span
className="labelauty-checked" 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> </label>
</div> </div>
<div className="form-group col-lg-4 col-md-4 col-sm-6 col-xs-6 style-addcoin-lbl-mdl-login"> <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> style={{ display: item.basiliskMode.checked ? 'none' : 'inline-block' }}></span>
<span <span
className="labelauty-unchecked" 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 <span
className="labelauty-checked-image" className="labelauty-checked-image"
style={{ display: item.basiliskMode.checked ? 'inline-block' : 'none' }}></span> style={{ display: item.basiliskMode.checked ? 'inline-block' : 'none' }}></span>
<span <span
className="labelauty-checked" 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> </label>
</div> </div>
<div className="form-group col-lg-4 col-md-4 col-sm-12 col-xs-12 style-addcoin-lbl-mdl-login"> <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> style={{ display: item.nativeMode.checked ? 'none' : 'inline-block' }}></span>
<span <span
className="labelauty-unchecked" 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 <span
className="labelauty-checked-image" className="labelauty-checked-image"
style={{ display: item.nativeMode.checked ? 'inline-block' : 'none' }}></span> style={{ display: item.nativeMode.checked ? 'inline-block' : 'none' }}></span>
<span <span
className="labelauty-checked" 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> </label>
</div> </div>
</div> </div>
@ -117,19 +130,25 @@ const CoinSelectorsRender = function(item, coin, i) {
type="button" type="button"
className="btn btn-primary" className="btn btn-primary"
onClick={ () => this.removeCoin(i) }> onClick={ () => this.removeCoin(i) }>
<i className="fa fa-trash-o"></i> <i className="fa fa-trash-o"></i>
</button> </button>
</div> </div>
<div className={ item.mode === '1' || item.mode === 1 ? 'col-sm-12' : 'hide' }> <div className={ item.mode === '1' || item.mode === 1 ? 'col-sm-12' : 'hide' }>
<div className="toggle-box padding-top-3 padding-bottom-10"> <div className="toggle-box padding-top-3 padding-bottom-10">
<span className="pointer"> <span className="pointer">
<label className="switch"> <label className="switch">
<input type="checkbox" checked={ item.syncOnly } /> <input
<div className="slider" onClick={ () => this.toggleSyncOnlyMode(i) }></div> type="checkbox"
checked={ item.syncOnly } />
<div
className="slider"
onClick={ () => this.toggleSyncOnlyMode(i) }></div>
</label> </label>
<div <div
className="toggle-label" className="toggle-label"
onClick={ () => this.toggleSyncOnlyMode(i) }>{ translate('ADD_COIN.SYNC_ONLY') }</div> onClick={ () => this.toggleSyncOnlyMode(i) }>
{ translate('ADD_COIN.SYNC_ONLY') }
</div>
</span> </span>
</div> </div>
</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') { 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++) { for (let i = 0; i < _options.length; i++) {
items.push( 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="page-content">
<div className="row"> <div className="row">
<div className="col-xlg-12 col-md-12"> <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 panel-bordered">
<div className="panel-body"> <div className="panel-body">
<div className="col-sm-4 col-xs-12"> <div className="col-sm-4 col-xs-12">
@ -46,7 +48,9 @@ const AtomicRender = function () {
<button <button
type="button" type="button"
className="btn btn-primary waves-effect waves-light" 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> </div>
</div> </div>
@ -54,11 +58,15 @@ const AtomicRender = function () {
<div className="col-xlg-4 col-md-12"> <div className="col-xlg-4 col-md-12">
<div className="panel"> <div className="panel">
<div className="panel-heading"> <div className="panel-heading">
<h3 className="panel-title">{ translate('ATOMIC.RAW_OUTPUT') }</h3> <h3 className="panel-title">
{ translate('ATOMIC.RAW_OUTPUT') }
</h3>
</div> </div>
<div className="panel-body"> <div className="panel-body">
<div className="tab-content"> <div className="tab-content">
<pre>{ this.state.output }</pre> <pre>
{ this.state.output }
</pre>
</div> </div>
</div> </div>
</div> </div>

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

@ -52,7 +52,11 @@ class CoinTile extends React.Component {
return ( return (
items.map((item, i) => 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-heading">
<div className="panel-actions"> <div className="panel-actions">
<div className="input-search input-group-sm"> <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> <i className="icon md-search"></i>
</button> </button>
<input type="text" className="form-control" placeholder="Search..." disabled /> <input
type="text"
className="form-control"
placeholder="Search..."
disabled />
</div> </div>
</div> </div>
<h3 className="panel-title">{ translate('INDEX.ACTIVE_COINS') }</h3> <h3 className="panel-title">
{ translate('INDEX.ACTIVE_COINS') }
</h3>
</div> </div>
</div> </div>
<div className="wallet-widgets-list"> <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]; const useAddress = this.props.ActiveCoin.mainBasiliskAddress ? this.props.ActiveCoin.mainBasiliskAddress : this.props.Dashboard.activeHandle[coin];
Store.dispatch(iguanaActiveHandle(true)); Store.dispatch(iguanaActiveHandle(true));
Store.dispatch(getKMDAddressesNative(coin, mode, useAddress)); Store.dispatch(
Store.dispatch(getShepherdCache(JSON.parse(sessionStorage.getItem('IguanaActiveAccount')).pubkey, coin)); getKMDAddressesNative(
coin,
mode,
useAddress
)
);
Store.dispatch(
getShepherdCache(
JSON.parse(sessionStorage.getItem('IguanaActiveAccount')).pubkey,
coin
)
);
if (this.props && if (this.props &&
this.props.Dashboard && this.props.Dashboard &&
@ -86,8 +97,18 @@ class CoinTileItem extends React.Component {
dashboardChangeActiveCoin(coin, mode) { dashboardChangeActiveCoin(coin, mode) {
if (coin !== this.props.ActiveCoin.coin) { if (coin !== this.props.ActiveCoin.coin) {
Store.dispatch(stopInterval('sync', this.props.Interval.interval)); Store.dispatch(
Store.dispatch(stopInterval('basilisk', this.props.Interval.interval)); stopInterval(
'sync',
this.props.Interval.interval
)
);
Store.dispatch(
stopInterval(
'basilisk',
this.props.Interval.interval
)
);
Store.dispatch(dashboardChangeActiveCoin(coin, mode)); Store.dispatch(dashboardChangeActiveCoin(coin, mode));
this.dispatchCoinActions(coin, mode); this.dispatchCoinActions(coin, mode);
@ -96,7 +117,12 @@ class CoinTileItem extends React.Component {
const _iguanaActiveHandle = setInterval(() => { const _iguanaActiveHandle = setInterval(() => {
this.dispatchCoinActions(coin, mode); this.dispatchCoinActions(coin, mode);
}, IGUNA_ACTIVE_HANDLE_TIMEOUT); }, IGUNA_ACTIVE_HANDLE_TIMEOUT);
Store.dispatch(startInterval('sync', _iguanaActiveHandle)); Store.dispatch(
startInterval(
'sync',
_iguanaActiveHandle
)
);
} }
if (mode === 'native') { if (mode === 'native') {
const _iguanaActiveHandle = setInterval(() => { const _iguanaActiveHandle = setInterval(() => {
@ -130,8 +156,18 @@ class CoinTileItem extends React.Component {
'address': _basiliskMainAddress, 'address': _basiliskMainAddress,
})); }));
}, BASILISK_CACHE_UPDATE_TIMEOUT); }, BASILISK_CACHE_UPDATE_TIMEOUT);
Store.dispatch(startInterval('sync', _iguanaActiveHandle)); Store.dispatch(
Store.dispatch(startInterval('basilisk', _basiliskCache)); 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" className="img-responsive"
src={ `assets/images/cryptologo/${item.coinlogo}.png` } src={ `assets/images/cryptologo/${item.coinlogo}.png` }
alt={ item.coinname }/> alt={ item.coinname }/>
<span className={ `badge up badge-${item.modecolor}` }>{ item.modecode }</span> <span className={ `badge up badge-${item.modecolor}` }>
{ item.modecode }
</span>
</a> </a>
<div className="coin-name">{ item.coinname } ({ item.coinlogo.toUpperCase() })</div> <div className="coin-name">
{ item.coinname } ({ item.coinlogo.toUpperCase() })
</div>
</div> </div>
</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="row">
<div className="col-xs-12"> <div className="col-xs-12">
<div className="alert alert-danger"> <div className="alert alert-danger">
<button type="button" className="close"> <button
type="button"
className="close">
<span>×</span> <span>×</span>
</button> </button>
<span className="jumblr-header"> <span className="jumblr-header">
<i className="icon fa-paw"></i> { translate('JUMBLR.NOTICE') } <i className="icon fa-paw"></i> { translate('JUMBLR.NOTICE') }
</span> </span>
<br /> <br />
{ translate('JUMBLR.DESCRIPTION') } { translate('JUMBLR.DESCRIPTION') }
</div> </div>
@ -24,12 +26,14 @@ const JumblrRender = function() {
<div className="col-xs-12"> <div className="col-xs-12">
<div className="alert alert-info alert-dismissible"> <div className="alert alert-info alert-dismissible">
<button type="button" className="close"> <button
type="button"
className="close">
<span>×</span> <span>×</span>
</button> </button>
<span className="jumblr-header"> <span className="jumblr-header">
<i className="icon fa-paw"></i> { translate('JUMBLR.NEED_NATIVE') } <i className="icon fa-paw"></i> { translate('JUMBLR.NEED_NATIVE') }
</span> </span>
<br /> <br />
{ translate('JUMBLR.TO_USE_JUMBLR') } { translate('JUMBLR.TO_USE_JUMBLR') }
<br /> <br />
@ -96,7 +100,9 @@ const JumblrRender = function() {
</div> </div>
</div> </div>
<div className="panel"> <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> <a className={ this.state.activeTab === 2 ? 'panel-title' : 'panel-title collapsed' }>{ translate('JUMBLR.USING_JUMBLR') }</a>
</div> </div>
<div className={ this.state.activeTab === 2 ? 'panel-collapse collapse in' : 'panel-collapse collapse' }> <div className={ this.state.activeTab === 2 ? 'panel-collapse collapse in' : 'panel-collapse collapse' }>
@ -127,44 +133,46 @@ const JumblrRender = function() {
<div className="table-responsive"> <div className="table-responsive">
<table className="table table-striped"> <table className="table table-striped">
<tbody> <tbody>
<tr> <tr>
<td width="20%">{ translate('JUMBLR.BTC_DEPOSIT') }</td> <td width="20%">{ translate('JUMBLR.BTC_DEPOSIT') }</td>
<td> <td>
<span></span> <span></span>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>BTC Jumblr</td> <td>BTC Jumblr</td>
<td> <td>
<button type="button" className="btn btn-animate btn-animate-side btn-default btn-sm waves-effect waves-light"> <button
<span> type="button"
<i className="icon fa-eye"></i> { translate('JUMBLR.SHOW_HIDE') } className="btn btn-animate btn-animate-side btn-default btn-sm waves-effect waves-light">
</span> <span>
</button> <i className="icon fa-eye"></i> { translate('JUMBLR.SHOW_HIDE') }
<span </span>
className="label label-lg label-outline label-success" </button>
style={{ display: 'none' }}></span> <span className="label label-lg label-outline label-success hide"></span>
<span className="label label-lg label-outline label-default">{ translate('JUMBLR.HIDDEN') }</span> <span className="label label-lg label-outline label-default">{ translate('JUMBLR.HIDDEN') }</span>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>{ translate('JUMBLR.KMD_DEPOSIT') }</td> <td>{ translate('JUMBLR.KMD_DEPOSIT') }</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>KMD Jumblr</td> <td>KMD Jumblr</td>
<td> <td>
<button type="button" className="btn btn-animate btn-animate-side btn-default btn-sm waves-effect waves-light"> <button
<span> type="button"
<i className="icon fa-eye"></i> { translate('JUMBLR.SHOW_HIDE') } 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> </span>
</button> </td>
<span </tr>
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>
</tbody> </tbody>
</table> </table>
</div> </div>
@ -172,41 +180,43 @@ const JumblrRender = function() {
</div> </div>
<div className="col-xlg-12 col-md-12"> <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="panel">
<div className="table-responsive"> <div className="table-responsive">
<table className="table table-striped"> <table className="table table-striped">
<tbody> <tbody>
<tr> <tr>
<td width="20%">{ translate('JUMBLR.RESULT') }</td> <td width="20%">{ translate('JUMBLR.RESULT') }</td>
<td> <td>
<span className="label label-success"></span> <span className="label label-success"></span>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>{ translate('JUMBLR.DEPOSITED') }</td> <td>{ translate('JUMBLR.DEPOSITED') }</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>{ translate('JUMBLR.PUB_TO_PRIV') }</td> <td>{ translate('JUMBLR.PUB_TO_PRIV') }</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>{ translate('JUMBLR.PRIV_TO_PRIV') }</td> <td>{ translate('JUMBLR.PRIV_TO_PRIV') }</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>{ translate('JUMBLR.PRIV_TO_PUB') }</td> <td>{ translate('JUMBLR.PRIV_TO_PUB') }</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>{ translate('JUMBLR.FINISHED') }</td> <td>{ translate('JUMBLR.FINISHED') }</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>{ translate('JUMBLR.PENDING') }</td> <td>{ translate('JUMBLR.PENDING') }</td>
<td></td> <td></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>

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

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

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

@ -5,16 +5,21 @@ const NavbarRender = function() {
return ( return (
<nav className="site-navbar navbar navbar-default navbar-fixed-top navbar-mega"> <nav className="site-navbar navbar navbar-default navbar-fixed-top navbar-mega">
<div className="navbar-header"> <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="sr-only">{ translate('INDEX.TOGGLE_NAV') }</span>
<span className="hamburger-bar"></span> <span className="hamburger-bar"></span>
</button> </button>
<button type="button" className="navbar-toggle collapsed"> <button
type="button"
className="navbar-toggle collapsed">
<i className="icon md-more"></i> <i className="icon md-more"></i>
</button> </button>
<div className="navbar-brand navbar-brand-center site-gridmenu-toggle"> <div className="navbar-brand navbar-brand-center site-gridmenu-toggle">
<img <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" /> title="SuperNET Iguana" />
<img <img
className="navbar-brand-logo hidden-md hidden-sm hidden-lg" className="navbar-brand-logo hidden-md hidden-sm hidden-lg"
@ -22,7 +27,9 @@ const NavbarRender = function() {
title="SuperNET Iguana white" /> title="SuperNET Iguana white" />
<span className="navbar-brand-text hidden-xs"></span> <span className="navbar-brand-text hidden-xs"></span>
</div> </div>
<button type="button" className="navbar-toggle collapsed"> <button
type="button"
className="navbar-toggle collapsed">
<span className="sr-only">{ translate('INDEX.TOGGLE_SEARCH') }</span> <span className="sr-only">{ translate('INDEX.TOGGLE_SEARCH') }</span>
<i className="icon md-search"></i> <i className="icon md-search"></i>
</button> </button>
@ -65,7 +72,9 @@ const NavbarRender = function() {
className="pointer padding-bottom-10 padding-top-16" className="pointer padding-bottom-10 padding-top-16"
onClick={ this.toggleAddCoinModal }> onClick={ this.toggleAddCoinModal }>
<span> <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> </span>
</a> </a>
</li> </li>
@ -74,7 +83,9 @@ const NavbarRender = function() {
onClick={ this.openDropMenu }> onClick={ this.openDropMenu }>
<a className="navbar-avatar dropdown-toggle"> <a className="navbar-avatar dropdown-toggle">
<span className="avatar avatar-online"> <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> <i></i>
</span> </span>
</a> </a>

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

@ -65,15 +65,20 @@ class Notifications extends React.Component {
if (this.state.guiLog && if (this.state.guiLog &&
this.state.guiLog.length) { this.state.guiLog.length) {
let _guiLog = this.state.guiLog; let _guiLog = this.state.guiLog;
_guiLog = sortByDate(_guiLog);
let items = []; let items = [];
_guiLog = sortByDate(_guiLog);
for (let i = 0; i < _guiLog.length; i++) { for (let i = 0; i < _guiLog.length; i++) {
if (_guiLog[i].status === type) { if (_guiLog[i].status === type) {
const _logItem = _guiLog[i]; const _logItem = _guiLog[i];
items.push( 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"> <div className="panel nav-tabs-horizontal">
<ul className="nav nav-tabs nav-tabs-line"> <ul className="nav nav-tabs nav-tabs-line">
<li className={ this.state.activeTab === 0 ? 'active' : 'pointer' }> <li className={ this.state.activeTab === 0 ? 'active' : 'pointer' }>
<a <a onClick={ () => this.openTab(0) }>
onClick={ () => this.openTab(0) }>
<i className="icon fa fa-thumbs-o-up"></i> Success ({ this.state.calls.success }) <i className="icon fa fa-thumbs-o-up"></i> Success ({ this.state.calls.success })
</a> </a>
</li> </li>
<li className={ this.state.activeTab === 1 ? 'active' : 'pointer' }> <li className={ this.state.activeTab === 1 ? 'active' : 'pointer' }>
<a <a onClick={ () => this.openTab(1) }>
onClick={ () => this.openTab(1) }>
<i className="icon fa fa-exclamation-triangle"></i> Error ({ this.state.calls.error }) <i className="icon fa fa-exclamation-triangle"></i> Error ({ this.state.calls.error })
</a> </a>
</li> </li>
<li className={ this.state.activeTab === 2 ? 'active' : 'pointer' }> <li className={ this.state.activeTab === 2 ? 'active' : 'pointer' }>
<a <a onClick={ () => this.openTab(2) }>
onClick={ () => this.openTab(2) }>
<i className="icon fa fa-clock-o"></i> Pending ({ this.state.calls.pending }) <i className="icon fa fa-clock-o"></i> Pending ({ this.state.calls.pending })
</a> </a>
</li> </li>
</ul> </ul>
<div className="panel-body panel-body-container"> <div className="panel-body panel-body-container">
<div className="tab-content"> <div className="tab-content">
<div <div className={ this.state.activeTab === 0 ? 'tab-pane active' : 'tab-pane' }>
className={ this.state.activeTab === 0 ? 'tab-pane active' : 'tab-pane' }>
{ this.renderNotificationsByType('success') } { this.renderNotificationsByType('success') }
</div> </div>
<div <div className={ this.state.activeTab === 1 ? 'tab-pane active' : 'tab-pane' }>
className={ this.state.activeTab === 1 ? 'tab-pane active' : 'tab-pane' }>
{ this.renderNotificationsByType('error') } { this.renderNotificationsByType('error') }
</div> </div>
<div <div className={ this.state.activeTab === 2 ? 'tab-pane active' : 'tab-pane' }>
className={ this.state.activeTab === 2 ? 'tab-pane active' : 'tab-pane' }>
{ this.renderNotificationsByType('pending') } { this.renderNotificationsByType('pending') }
</div> </div>
</div> </div>
@ -81,7 +75,9 @@ export const NotificationsModalRender = function() {
<button <button
type="button" type="button"
className="btn btn-default" className="btn btn-default"
onClick={ this.toggleNotificationsModal }>{ translate('INDEX.CLOSE') }</button> onClick={ this.toggleNotificationsModal }>
{ translate('INDEX.CLOSE') }
</button>
</div> </div>
</div> </div>
</div> </div>
@ -97,9 +93,15 @@ export const NotificationsRender = function() {
<div <div
className={ this.props.Dashboard.activeHandle && this.props.Dashboard.activeHandle.status === 'unlocked' ? 'notifications-badge stick-to-top' : 'notifications-badge' } className={ this.props.Dashboard.activeHandle && this.props.Dashboard.activeHandle.status === 'unlocked' ? 'notifications-badge stick-to-top' : 'notifications-badge' }
onClick={ this.toggleNotificationsModal }> onClick={ this.toggleNotificationsModal }>
<span className="badge success">{ this.state.calls.success }</span> <span className="badge success">
<span className="badge error">{ this.state.calls.error }</span> { this.state.calls.success }
<span className="badge pending">{ this.state.calls.pending }</span> </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={ this.state.calls.pending === 0 ? 'spinner spinner-hide' : 'spinner' }>
<div className="rect1"></div> <div className="rect1"></div>
<div className="rect2"></div> <div className="rect2"></div>

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

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

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

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

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

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

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

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

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

@ -82,7 +82,13 @@ class Settings extends React.Component {
} }
execCliCmd() { execCliCmd() {
Store.dispatch(shepherdCli('passthru', this.state.cliCoin, this.state.cliCmd)); Store.dispatch(
shepherdCli(
'passthru',
this.state.cliCoin,
this.state.cliCmd
)
);
} }
openTab(elemId, tab) { openTab(elemId, tab) {
@ -98,7 +104,13 @@ class Settings extends React.Component {
} }
exportWifKeys() { exportWifKeys() {
Store.dispatch(encryptWallet(this.state.wifkeysPassphrase, settingsWifkeyState, this.props.ActiveCoin.coin)); Store.dispatch(
encryptWallet(
this.state.wifkeysPassphrase,
settingsWifkeyState,
this.props.ActiveCoin.coin
)
);
} }
importWifKey() { importWifKey() {
@ -106,7 +118,12 @@ class Settings extends React.Component {
} }
readDebugLog() { readDebugLog() {
Store.dispatch(getDebugLog(this.state.debugTarget, this.state.debugLinesCount)); Store.dispatch(
getDebugLog(
this.state.debugTarget,
this.state.debugLinesCount
)
);
} }
checkNodes() { checkNodes() {
@ -117,7 +134,12 @@ class Settings extends React.Component {
addNode() { addNode() {
if (this.state.addNodeCoin) { 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) { modes.map(function(mode) {
allCoins[mode].map(function(coin) { allCoins[mode].map(function(coin) {
items.push( items.push(
<option value={ coin } key={ coin }>{ coin } ({ mode })</option> <option
value={ coin }
key={ coin }>
{ coin } ({ mode })
</option>
); );
}); });
}); });
} else { } else {
allCoins[mode].map(function(coin) { allCoins[mode].map(function(coin) {
items.push( 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 && if (_wifKeysResponse &&
this.state.exportWifKeysRaw) { this.state.exportWifKeysRaw) {
return ( 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 { } else {
return null; return null;

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

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

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

@ -62,7 +62,14 @@ class SyncOnly extends React.Component {
this.setState({ this.setState({
autoRestartedForks: _autoRestartedForks, autoRestartedForks: _autoRestartedForks,
}); });
Store.dispatch(addCoin(forkInfo.registry.coin, '1', null, port)); Store.dispatch(
addCoin(
forkInfo.registry.coin,
'1',
null,
port
)
);
setTimeout(() => { setTimeout(() => {
let _autoRestartedForks = Object.assign({}, this.state.autoRestartedForks); let _autoRestartedForks = Object.assign({}, this.state.autoRestartedForks);
@ -78,7 +85,12 @@ class SyncOnly extends React.Component {
} }
closeSyncOnlyModal() { closeSyncOnlyModal() {
Store.dispatch(stopInterval('syncOnly', this.props.Interval.interval)); Store.dispatch(
stopInterval(
'syncOnly',
this.props.Interval.interval
)
);
Store.dispatch(toggleSyncOnlyModal(false)); Store.dispatch(toggleSyncOnlyModal(false));
} }
@ -90,8 +102,14 @@ class SyncOnly extends React.Component {
restartIguanaInstance(pmid) restartIguanaInstance(pmid)
.then(function(json) { .then(function(json) {
setTimeout(function() { setTimeout(function() {
Store.dispatch(addCoin(coin, '1', null, port)); Store.dispatch(
console.log('restartSyncOnlyInstance', json); addCoin(
coin,
'1',
null,
port
)
);
}, 2000); }, 2000);
}); });
} }
@ -110,7 +128,11 @@ class SyncOnly extends React.Component {
forkInfo.registry && forkInfo.registry &&
forkInfo.getinfo) { forkInfo.getinfo) {
items.push( 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>
</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 progress-sm">
<div <div
className="progress-bar progress-bar-warning progress-bar-striped active font-size-80-percent" 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) { export const ForkItemRender = function (forkInfo, port) {
return ( return (
<div key={ port } className="padding-bottom-60 full-width"> <div
key={ port }
className="padding-bottom-60 full-width">
<div className="avatar"> <div className="avatar">
<img <img
className="img-responsive margin-bottom-5" 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="col-xs-12">
<div className={ this.isActiveCoinMode('native') || (this.isActiveCoinMode('full') && !this.isFullySynced()) ? 'col-xs-12' : 'col-xs-12 hide' }> <div className={ this.isActiveCoinMode('native') || (this.isActiveCoinMode('full') && !this.isFullySynced()) ? 'col-xs-12' : 'col-xs-12 hide' }>
<div className="alert alert-info alert-dismissible"> <div className="alert alert-info alert-dismissible">
<button className="close" type="button"> <button
className="close"
type="button">
<span>×</span> <span>×</span>
</button> </button>
<h4>{ translate('INDEX.ACTIVATING_WALLET_RT') }</h4> <h4>{ translate('INDEX.ACTIVATING_WALLET_RT') }</h4>
@ -17,7 +19,9 @@ const WalletsBalanceRender = function() {
</div> </div>
<div className="alert alert-info alert-dismissible"> <div className="alert alert-info alert-dismissible">
<button className="close" type="button"> <button
className="close"
type="button">
<span>×</span> <span>×</span>
</button> </button>
<h4>{ translate('INDEX.FETCHING_COIN_DATA') }</h4> <h4>{ translate('INDEX.FETCHING_COIN_DATA') }</h4>
@ -33,7 +37,8 @@ const WalletsBalanceRender = function() {
<div className="padding-20 padding-top-10"> <div className="padding-20 padding-top-10">
<div className="clearfix"> <div className="clearfix">
<div className="pull-left padding-vertical-10"> <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> </div>
<span className="pull-right padding-top-10 font-size-22"> <span className="pull-right padding-top-10 font-size-22">
{ this.renderBalance('main') } { this.props.ActiveCoin.coin } { this.renderBalance('main') } { this.props.ActiveCoin.coin }
@ -50,7 +55,8 @@ const WalletsBalanceRender = function() {
<div className="padding-20 padding-top-10"> <div className="padding-20 padding-top-10">
<div className="clearfix"> <div className="clearfix">
<div className="pull-left padding-vertical-10"> <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> </div>
<span className="pull-right padding-top-10 font-size-22"> <span className="pull-right padding-top-10 font-size-22">
{ this.renderBalance('interest') } { this.props.ActiveCoin.coin } { this.renderBalance('interest') } { this.props.ActiveCoin.coin }
@ -67,7 +73,8 @@ const WalletsBalanceRender = function() {
<div className="padding-20 padding-top-10"> <div className="padding-20 padding-top-10">
<div className="clearfix"> <div className="clearfix">
<div className="pull-left padding-vertical-10"> <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> </div>
<span className="pull-right padding-top-10 font-size-22"> <span className="pull-right padding-top-10 font-size-22">
{ this.renderBalance('total') } { this.props.ActiveCoin.coin } { 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() { const WalletsBasiliskConnectionRender = function() {
return ( return (
<div onKeyDown={ (event) => this.handleKeydown(event) }> <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-dialog modal-center modal-md">
<div className="modal-content"> <div className="modal-content">
<div className="modal-header bg-orange-a400 wallet-send-header"> <div className="modal-header bg-orange-a400 wallet-send-header">
<h4 className="modal-title white"> <h4 className="modal-title white">
<span className="icon fa-refresh no-margin"></span> { translate('INDEX.REFRESHING_BASILISK_NET') }... <span className="icon fa-refresh no-margin"></span> { translate('INDEX.REFRESHING_BASILISK_NET') }...
</h4> </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>&times;</span>
<span className="sr-only">{ translate('INDEX.CLOSE') }</span> <span className="sr-only">{ translate('INDEX.CLOSE') }</span>
</button> </button>
@ -56,12 +61,14 @@ const WalletsBasiliskConnectionRender = function() {
</div> </div>
</div> </div>
<h5 className="text-left"> <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> </h5>
<div className="progress progress-sm"> <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> </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 } { this.props.Dashboard.connectedNotaries.failedToConnectNodes ? `Failed: ${this.props.Dashboard.connectedNotaries.failedToConnectNodes}` : null }
</pre> </pre>
</div> </div>

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

@ -43,21 +43,29 @@ class WalletsCacheData extends React.Component {
if (_sourceObj.data[0] && if (_sourceObj.data[0] &&
Object.keys(_sourceObj.data[0]).length) { Object.keys(_sourceObj.data[0]).length) {
return _sourceObj.data.map((key, value) => 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) } { this.renderArrayNode(`${pre}-array-${value}`, key) }
</TreeNode>); </TreeNode>);
} else { } 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) { 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) { renderKeyValue(pre, key, value) {
return ( 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 && if (sourceObj[call].data &&
(sourceObj[call].data.length || Object.keys(sourceObj[call].data).length)) { (sourceObj[call].data.length || Object.keys(sourceObj[call].data).length)) {
return ( return (
<TreeNode title={ `${call}`} key={`${coin}-${address}-${call}` }> <TreeNode
<TreeNode title={ `status: ${sourceObj[call].status}` } key={ `${coin}-${address}-${call}-status` } /> title={ `${call}`}
<TreeNode title={ `updated @: ${secondsToString(sourceObj[call].timestamp, true)}` } key={ `${coin}-${address}-${call}-timestamp` } /> key={`${coin}-${address}-${call}` }>
<TreeNode title="data" key={ `${coin}-${address}-${call}-data` }> <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]) } { this.renderKeyValueParent(`${coin}-${address}-${call}`, sourceObj[call]) }
</TreeNode> </TreeNode>
</TreeNode> </TreeNode>
); );
} else { } else {
return ( 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-content">
<div className="tab-pane active"> <div className="tab-pane active">
{ this.renderNotariesFetching() } { this.renderNotariesFetching() }
<Tree defaultExpandAll={ false } openAnimation={ animation }> <Tree
defaultExpandAll={ false }
openAnimation={ animation }>
{ this.renderCoinRootNodes() } { this.renderCoinRootNodes() }
</Tree> </Tree>
</div> </div>

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

@ -65,11 +65,19 @@ class WalletsData extends React.Component {
} }
componentWillMount() { componentWillMount() {
document.addEventListener('click', this.handleClickOutside, false); document.addEventListener(
'click',
this.handleClickOutside,
false
);
} }
componentWillUnmount() { componentWillUnmount() {
document.removeEventListener('click', this.handleClickOutside, false); document.removeEventListener(
'click',
this.handleClickOutside,
false
);
} }
handleClickOutside(e) { handleClickOutside(e) {
@ -217,7 +225,10 @@ class WalletsData extends React.Component {
(this.state.itemsList && !this.state.itemsList.length) || (this.state.itemsList && !this.state.itemsList.length) ||
(props.ActiveCoin.txhistory !== this.props.ActiveCoin.txhistory)) { (props.ActiveCoin.txhistory !== this.props.ActiveCoin.txhistory)) {
let historyToSplit = sortByDate(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, { this.setState(Object.assign({}, this.state, {
itemsList: historyToSplit, itemsList: historyToSplit,
@ -239,7 +250,10 @@ class WalletsData extends React.Component {
updateCurrentPage(page) { updateCurrentPage(page) {
let historyToSplit = sortByDate(this.props.ActiveCoin.txhistory); 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, { this.setState(Object.assign({}, this.state, {
activePage: page, activePage: page,
@ -250,7 +264,7 @@ class WalletsData extends React.Component {
renderPaginationItems() { renderPaginationItems() {
let items = []; 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( items.push(
PaginationItemRender.call(this, i) PaginationItemRender.call(this, i)
); );
@ -276,7 +290,11 @@ class WalletsData extends React.Component {
const _paginationFrom = ((this.state.activePage - 1) * this.state.itemsPerPage) + 1; const _paginationFrom = ((this.state.activePage - 1) * this.state.itemsPerPage) + 1;
const _paginationTo = this.state.activePage * this.state.itemsPerPage; const _paginationTo = this.state.activePage * this.state.itemsPerPage;
return PaginationRender.call(this, _paginationFrom, _paginationTo); return PaginationRender.call(
this,
_paginationFrom,
_paginationTo
);
} else { } else {
return null; return null;
} }
@ -336,7 +354,11 @@ class WalletsData extends React.Component {
this.state.itemsList.length && this.state.itemsList.length &&
this.state.itemsList !== 'no data') { this.state.itemsList !== 'no data') {
return this.state.itemsList.map((tx, index) => 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') { if (this.props.ActiveCoin.mode === 'basilisk') {
setTimeout(() => { setTimeout(() => {
Store.dispatch(changeMainBasiliskAddress(address)); Store.dispatch(changeMainBasiliskAddress(address));
Store.dispatch(getBasiliskTransactionsList(this.props.ActiveCoin.coin, address)); Store.dispatch(
getBasiliskTransactionsList(
this.props.ActiveCoin.coin,
address
)
);
}, 100); }, 100);
Store.dispatch(fetchNewCacheData({ 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) { renderAddressByType(type) {
if (this.props.ActiveCoin.addresses && if (this.props.ActiveCoin.addresses &&
this.props.ActiveCoin.addresses[type] && 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 ( return (
<div className="row unselectable"> <div className="row unselectable">
<div className="col-sm-5"> <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>
<div className="col-sm-7"> <div className="col-sm-7">
<div className="dataTables_paginate paging_simple_numbers"> <div className="dataTables_paginate paging_simple_numbers">

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

@ -6,12 +6,19 @@ const WalletsHeaderRender = function() {
<div <div
className="page-header page-header-bordered header-easydex margin-bottom-0" className="page-header page-header-bordered header-easydex margin-bottom-0"
id="easydex-header-div" 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> <h1 className={ this.isActiveSectionJumblr() ? 'hide' : 'page-title' }>EasyDEX</h1>
<ol className="breadcrumb"> <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' }> <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> </li>
</ol> </ol>
<div className="page-header-actions z-index-1 hide"> <div className="page-header-actions z-index-1 hide">
@ -38,7 +45,9 @@ const WalletsHeaderRender = function() {
</ul> </ul>
</div> </div>
<div id="zec_header_button" className="hide"> <div
id="zec_header_button"
className="hide">
<button <button
type="button" type="button"
className="bg-yellow-600 btn btn-floating white waves-effect waves-float waves-light"> className="bg-yellow-600 btn btn-floating white waves-effect waves-float waves-light">
@ -69,7 +78,9 @@ const WalletsHeaderRender = function() {
</button> </button>
</div> </div>
<div id="kmd_header_button" className="hide"> <div
id="kmd_header_button"
className="hide">
<button <button
type="button" type="button"
className="bg-teal-500 btn btn-floating white waves-effect waves-float waves-light"> 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 ( return (
<div className="page margin-left-0"> <div className="page margin-left-0">
<div className="padding-top-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"> <ol className="breadcrumb">
<li className="header-easydex-section"> <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> </li>
</ol> </ol>
</div> </div>

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

@ -4,7 +4,9 @@ import { translate } from '../../../translate/translate';
const WalletsNativeAlertRender = function() { const WalletsNativeAlertRender = function() {
return ( return (
<div className="alert alert-danger alert-dismissible"> <div className="alert alert-danger alert-dismissible">
<button className="close" type="button"> <button
className="close"
type="button">
<span>×</span> <span>×</span>
</button> </button>
<h4>{ translate('INDEX.OOPS_ERROR') }</h4> <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="padding-20 padding-top-10">
<div className="clearfix"> <div className="clearfix">
<div className="pull-left padding-vertical-10"> <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> </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> </div>
</div> </div>
@ -25,9 +28,12 @@ const WalletsNativeBalanceRender = function() {
<div className="padding-20 padding-top-10"> <div className="padding-20 padding-top-10">
<div className="clearfix"> <div className="clearfix">
<div className="pull-left padding-vertical-10"> <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> </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> </div>
</div> </div>
@ -40,9 +46,12 @@ const WalletsNativeBalanceRender = function() {
<div className="padding-20 padding-top-10"> <div className="padding-20 padding-top-10">
<div className="clearfix"> <div className="clearfix">
<div className="pull-left padding-vertical-10"> <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> </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> </div>
</div> </div>
@ -55,9 +64,12 @@ const WalletsNativeBalanceRender = function() {
<div className="padding-20 padding-top-10"> <div className="padding-20 padding-top-10">
<div className="clearfix"> <div className="clearfix">
<div className="pull-left padding-vertical-10"> <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> </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> </div>
</div> </div>

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

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

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

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

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

@ -6,11 +6,14 @@ export const AddressListRender = function(address, type) {
<tr key={ address.address }> <tr key={ address.address }>
<td> <td>
<span className={ type === 'public' ? 'label label-default' : 'label label-dark' }> <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> </span>
<button <button
className="btn btn-default btn-xs clipboard-edexaddr margin-left-10" 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>
<td>{ type === 'public' ? address.address : address.address.substring(0, 34) + '...' }</td> <td>{ type === 'public' ? address.address : address.address.substring(0, 34) + '...' }</td>
<td>{ address.amount }</td> <td>{ address.amount }</td>
@ -29,20 +32,25 @@ export const WalletsNativeReceiveRender = function() {
<div className="panel"> <div className="panel">
<header className="panel-heading"> <header className="panel-heading">
<div className="panel-actions"> <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"> <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> </a>
<ul <ul className="dropdown-menu dropdown-menu-right">
className="dropdown-menu dropdown-menu-right">
<li> <li>
<a onClick={ () => this.getNewAddress('public') }> <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> </a>
</li> </li>
<li> <li>
<a onClick={ () => this.getNewAddress('private') }> <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> </a>
</li> </li>
</ul> </ul>

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

@ -36,11 +36,19 @@ class WalletsNativeSend extends React.Component {
} }
componentWillMount() { componentWillMount() {
document.addEventListener('click', this.handleClickOutside, false); document.addEventListener(
'click',
this.handleClickOutside,
false
);
} }
componentWillUnmount() { componentWillUnmount() {
document.removeEventListener('click', this.handleClickOutside, false); document.removeEventListener(
'click',
this.handleClickOutside,
false
);
} }
handleClickOutside(e) { handleClickOutside(e) {
@ -71,7 +79,11 @@ class WalletsNativeSend extends React.Component {
if (this.state.sendFrom) { if (this.state.sendFrom) {
return ( return (
<span> <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> </span>
); );
} else { } else {
@ -107,7 +119,8 @@ class WalletsNativeSend extends React.Component {
return ( return (
<span className={ `label label-${_satatusDef[opid.status].icon}` }> <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> </span>
); );
} }
@ -192,9 +205,19 @@ class WalletsNativeSend extends React.Component {
} }
handleSubmit() { handleSubmit() {
Store.dispatch(sendNativeTx(this.props.ActiveCoin.coin, this.state)); Store.dispatch(
sendNativeTx(
this.props.ActiveCoin.coin,
this.state
)
);
setTimeout(() => { setTimeout(() => {
Store.dispatch(getKMDOPID(null, this.props.ActiveCoin.coin)); Store.dispatch(
getKMDOPID(
null,
this.props.ActiveCoin.coin
)
);
}, 1000); }, 1000);
} }
@ -218,10 +241,22 @@ class WalletsNativeSend extends React.Component {
} }
if (this.state.sendTo === '') { 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 { } 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"> <div className="dropdown-menu open">
<ul className="dropdown-menu inner"> <ul className="dropdown-menu inner">
<li className="selected"> <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> </li>
{ this.renderAddressByType('public') } { this.renderAddressByType('public') }
{ this.renderAddressByType('private') } { this.renderAddressByType('private') }
@ -60,14 +61,19 @@ export const WalletsNativeSendRender = function() {
return ( return (
<div id="kmd_wallet_send"> <div id="kmd_wallet_send">
<div className="col-xlg-12 col-md-12 col-sm-12 col-xs-12"> <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"> <div className="panel-heading">
<h3 className="panel-title"> <h3 className="panel-title">
{ translate('INDEX.SEND') } { this.props.ActiveCoin.coin } { translate('INDEX.SEND') } { this.props.ActiveCoin.coin }
</h3> </h3>
</div> </div>
<div className="panel-body container-fluid"> <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="row">
<div className="col-xlg-12 form-group form-material"> <div className="col-xlg-12 form-group form-material">
<label className="control-label">{ translate('INDEX.SEND_FROM') }</label> <label className="control-label">{ translate('INDEX.SEND_FROM') }</label>
@ -77,7 +83,9 @@ export const WalletsNativeSendRender = function() {
{ this.renderOASendUI() } { this.renderOASendUI() }
<div className="row"> <div className="row">
<div className="col-xlg-12 form-group form-material"> <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 <input
type="text" type="text"
className="form-control" className="form-control"
@ -90,7 +98,9 @@ export const WalletsNativeSendRender = function() {
required /> required />
</div> </div>
<div className="col-lg-6 form-group form-material"> <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 } { this.props.ActiveCoin.coin }
</label> </label>
<input <input
@ -103,7 +113,9 @@ export const WalletsNativeSendRender = function() {
autoComplete="off" /> autoComplete="off" />
</div> </div>
<div className="col-lg-6 form-group form-material"> <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 <input
type="text" type="text"
className="form-control" className="form-control"
@ -116,7 +128,9 @@ export const WalletsNativeSendRender = function() {
</div> </div>
<div className="col-lg-12"> <div className="col-lg-12">
<span> <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> </span>
</div> </div>
<div className="col-lg-12"> <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() { export const ChainActivationNotificationRender = function() {
return ( return (
<div className="alert alert-info alert-dismissible margin-bottom-40"> <div className="alert alert-info alert-dismissible margin-bottom-40">
<button className="close" type="button"> <button
className="close"
type="button">
<span>×</span> <span>×</span>
</button> </button>
<h4> <h4>

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

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

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

@ -26,8 +26,15 @@ export const PaginationRender = function(paginationStart, paginationEnd, paginat
return ( return (
<div className="row unselectable"> <div className="row unselectable">
<div className="col-sm-5"> <div className="col-sm-5">
<div <div className="dataTables_info">
className="dataTables_info">{ translate('INDEX.SHOWING') } { paginationStart } { translate('INDEX.TO') } { paginationEnd } { translate('INDEX.OF') } { this.props.ActiveCoin.txhistory.length } { translate('INDEX.ENTRIES_SM') }</div> { translate('INDEX.SHOWING') }
{ paginationStart }
{ translate('INDEX.TO') }
{ paginationEnd }
{ translate('INDEX.OF') }
{ this.props.ActiveCoin.txhistory.length }
{ translate('INDEX.ENTRIES_SM') }
</div>
</div> </div>
<div className="col-sm-7"> <div className="col-sm-7">
<div className="dataTables_paginate paging_simple_numbers"> <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' }> === 1 ? 'paginate_button previous disabled' : 'paginate_button previous' }>
<a onClick={ () => this.updateCurrentPage(this.state.activePage - 1) }>{ translate('INDEX.PREVIOUS') }</a> <a onClick={ () => this.updateCurrentPage(this.state.activePage - 1) }>{ translate('INDEX.PREVIOUS') }</a>
</li> </li>
{this.renderPaginationItems()} { this.renderPaginationItems() }
<li className={ paginationNextState ? 'paginate_button next disabled' : 'paginate_button next' }> <li className={ paginationNextState ? 'paginate_button next disabled' : 'paginate_button next' }>
<a onClick={ () => this.updateCurrentPage(this.state.activePage + 1) }>{ translate('INDEX.NEXT') }</a> <a onClick={ () => this.updateCurrentPage(this.state.activePage + 1) }>{ translate('INDEX.NEXT') }</a>
</li> </li>
@ -64,7 +71,9 @@ export const TxHistoryListRender = function() {
<button <button
type="button" type="button"
className="btn btn-xs white btn-info waves-effect waves-light btn-kmdtxid" 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> </td>
</tr> </tr>
); );
@ -90,13 +99,19 @@ export const WalletsNativeTxHistoryRender = function() {
<div className="col-sm-6"> <div className="col-sm-6">
<div className="dataTables_filter"> <div className="dataTables_filter">
<label> <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> </label>
</div> </div>
</div> </div>
</div> </div>
<div className="row"> <div className="row">
<table className="table table-hover dataTable table-striped" width="100%"> <table
className="table table-hover dataTable table-striped"
width="100%">
<thead> <thead>
<tr> <tr>
<th>{ translate('INDEX.TYPE') }</th> <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) { const WalletsNativeTxInfoRender = function(txInfo) {
return ( return (
<div onKeyDown={ (event) => this.handleKeydown(event) }> <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-dialog modal-center modal-lg">
<div className="modal-content"> <div className="modal-content">
<div className="modal-body modal-body-container"> <div className="modal-body modal-body-container">
@ -64,7 +66,7 @@ const WalletsNativeTxInfoRender = function(txInfo) {
<tr> <tr>
<td>blockindex</td> <td>blockindex</td>
<td> <td>
{txInfo.blockindex} { txInfo.blockindex }
</td> </td>
</tr> </tr>
<tr> <tr>

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

@ -29,7 +29,11 @@ class WalletsNav extends React.Component {
toggleSendReceiveCoinForms() { toggleSendReceiveCoinForms() {
if (this.props.ActiveCoin.mode === 'native') { 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 { } else {
Store.dispatch(toggleSendReceiveCoinForms()); Store.dispatch(toggleSendReceiveCoinForms());
} }
@ -37,7 +41,11 @@ class WalletsNav extends React.Component {
toggleSendCoinForm(display) { toggleSendCoinForm(display) {
if (this.props.ActiveCoin.mode === 'native') { 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 { } else {
Store.dispatch(toggleSendCoinForm(display)); Store.dispatch(toggleSendCoinForm(display));
} }
@ -45,7 +53,11 @@ class WalletsNav extends React.Component {
toggleReceiveCoinForm(display) { toggleReceiveCoinForm(display) {
if (this.props.ActiveCoin.mode === 'native') { 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 { } else {
Store.dispatch(toggleReceiveCoinForm(display)); Store.dispatch(toggleReceiveCoinForm(display));
} }

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

@ -6,7 +6,9 @@ export const WalletsNavNoWalletRender = function () {
<div> <div>
<div className="col-xs-12 padding-top-20"> <div className="col-xs-12 padding-top-20">
<div className="alert alert-info alert-dismissible"> <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"> <span className="font-size-24 text-align-center">
<i className="icon fa-paw"></i> { translate('INDEX.NO_WALLET_CAPS') } <i className="icon fa-paw"></i> { translate('INDEX.NO_WALLET_CAPS') }
</span> </span>
@ -26,7 +28,13 @@ export const WalletsNavWithWalletRender = function () {
id="header-dashboard" id="header-dashboard"
style={{ marginBottom: this.props.ActiveCoin.mode === 'basilisk' ? '30px' : '0' }}> style={{ marginBottom: this.props.ActiveCoin.mode === 'basilisk' ? '30px' : '0' }}>
<ol className="breadcrumb"> <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> </ol>
<div className="page-header-actions"> <div className="page-header-actions">
<div id="kmd_header_button"> <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 && if (this.props.ActiveCoin.notaries &&
this.props.ActiveCoin.notaries.notaries && this.props.ActiveCoin.notaries.notaries &&
this.props.ActiveCoin.notaries.notaries.length) { this.props.ActiveCoin.notaries.notaries.length) {
return this.props.ActiveCoin.notaries.notaries.map((node, index) => return this.props.ActiveCoin.notaries.notaries.map(
NotariesListRender.call(this, node, index) (node, index) => NotariesListRender.call(this, node, index)
); );
} else { } else {
return null; 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'; import { animation } from '../../../util/rc-tree-animate';
export const NotariesListRender = function (node, index) { export const NotariesListRender = function (node, index) {
<TreeNode title={ `Node ${index}` } key={ `node-${index}` }> <TreeNode
<TreeNode key={ `node-${index}-btc` } title={ `BTC: ${node.BTCaddress}` } /> title={ `Node ${index}` }
<TreeNode key={ `node-${index}-kmd` } title={ `KMD: ${node.KMDaddress}` } /> key={ `node-${index}` }>
<TreeNode key={ `node-${index}-pubkey` } title={ `Pubkey: ${node.pubkey}` } /> <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> </TreeNode>
}; };
export const WalletsNotariesListRender = function () { export const WalletsNotariesListRender = function () {
return ( return (
<div onKeyDown={ (event) => this.handleKeydown(event) }> <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-dialog modal-center modal-lg">
<div className="modal-content"> <div className="modal-content">
<div className="modal-body modal-body-container"> <div className="modal-body modal-body-container">
@ -23,7 +33,9 @@ export const WalletsNotariesListRender = function () {
<div className="tab-content"> <div className="tab-content">
<div className="tab-pane active"> <div className="tab-pane active">
{ this.renderNotariesFetching() } { this.renderNotariesFetching() }
<Tree defaultExpandAll={ false } openAnimation={ animation }> <Tree
defaultExpandAll={ false }
openAnimation={ animation }>
{ this.renderNotariesList() } { this.renderNotariesList() }
</Tree> </Tree>
</div> </div>

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

@ -3,7 +3,9 @@ import { translate } from '../../../translate/translate';
const WalletsProgressRender = function () { const WalletsProgressRender = function () {
return ( return (
<div id="edex-footer" className="margin-bottom-20"> <div
id="edex-footer"
className="margin-bottom-20">
<div className="row no-space"> <div className="row no-space">
<div id="currency-progressbars"> <div id="currency-progressbars">
<div className="progress progress-sm"> <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) { const WalletsTxInfoRender = function(txInfo) {
return ( return (
<div onKeyDown={ (event) => this.handleKeydown(event) }> <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-dialog modal-center modal-lg">
<div className="modal-content"> <div className="modal-content">
<div className="modal-body modal-body-container"> <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(() => { const _iguanaActiveHandle = setInterval(() => {
Store.dispatch(getSyncOnlyForks()); Store.dispatch(getSyncOnlyForks());
}, IGUNA_ACTIVE_HANDLE_TIMEOUT); }, IGUNA_ACTIVE_HANDLE_TIMEOUT);
Store.dispatch(startInterval('syncOnly', _iguanaActiveHandle)); Store.dispatch(
startInterval(
'syncOnly',
_iguanaActiveHandle
)
);
Store.dispatch(toggleSyncOnlyModal(true)); Store.dispatch(toggleSyncOnlyModal(true));
} }
@ -125,7 +130,9 @@ class Login extends React.Component {
} }
loginSeed() { loginSeed() {
Store.dispatch(iguanaWalletPassphrase(this.state.loginPassphrase)); Store.dispatch(
iguanaWalletPassphrase(this.state.loginPassphrase)
);
} }
updateActiveLoginSection(name) { updateActiveLoginSection(name) {
@ -135,7 +142,12 @@ class Login extends React.Component {
} }
execWalletCreate() { execWalletCreate() {
Store.dispatch(createNewWallet(this.state.randomSeedConfirm, this.props.Dashboard.activeHandle)); Store.dispatch(
createNewWallet(
this.state.randomSeedConfirm,
this.props.Dashboard.activeHandle
)
);
this.setState({ this.setState({
activeLoginSection: 'activateCoin', activeLoginSection: 'activateCoin',
@ -175,7 +187,8 @@ class Login extends React.Component {
} }
render() { render() {
if ((this.state && this.state.display) || !this.props.Main) { if ((this.state && this.state.display) ||
!this.props.Main) {
return LoginRender.call(this); 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 animsition vertical-align text-center fade-in">
<div className="page-content vertical-align-middle"> <div className="page-content vertical-align-middle">
<div className="brand"> <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>
<div className="vertical-padding-20 horizontal-padding-0"> <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') } <i className="fa fa-cubes"></i> { translate('LOGIN.DISPLAY_SYNC_ONLY') }
</span> </span>
</div> </div>
@ -56,7 +61,9 @@ const LoginRender = function () {
<i <i
className={ this.state.seedInputVisibility ? 'seed-toggle fa fa-eye-slash' : 'seed-toggle fa fa-eye' } className={ this.state.seedInputVisibility ? 'seed-toggle fa fa-eye-slash' : 'seed-toggle fa fa-eye' }
onClick={ this.toggleSeedInputVisibility }></i> 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> </div>
<button <button
type="button" type="button"
@ -129,13 +136,15 @@ const LoginRender = function () {
</div> </div>
</div> </div>
<div className="form-group form-material floating"> <div className="form-group form-material floating">
<textarea <textarea
className="form-control placeholder-no-fix height-100" className="form-control placeholder-no-fix height-100"
type="text" type="text"
id="walletseed" id="walletseed"
value={ this.state.randomSeed } value={ this.state.randomSeed }
readOnly="true"></textarea> readOnly="true"></textarea>
<label className="floating-label" htmlFor="walletseed">{ translate('INDEX.WALLET_SEED') }</label> <label
className="floating-label"
htmlFor="walletseed">{ translate('INDEX.WALLET_SEED') }</label>
</div> </div>
<div className="form-group form-material floating"> <div className="form-group form-material floating">
<textarea <textarea
@ -145,7 +154,9 @@ const LoginRender = function () {
onChange={ this.updateInput } onChange={ this.updateInput }
id="rwalletseed"></textarea> id="rwalletseed"></textarea>
<span className={ this.state.isSeedConfirmError ? 'help-block' : 'hide' }>{ translate('LOGIN.ENTER_VALUE_AGAIN') }.</span> <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> </div>
<button <button
type="button" type="button"

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

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

312
react/src/components/overrides.scss

@ -1,19 +1,27 @@
/* TODO: nesting, separate */ /* TODO: nesting, separate */
#app > div { #app {
height: 100%; > div {
height: 100%;
}
} }
.page-main { .page-main {
background: #f3f4f5; background: #f3f4f5;
} }
#kmd_header_button button { #kmd_header_button {
margin-right: 5px; button {
margin-right: 5px;
}
} }
.widget.active .bg-white { .widget {
box-shadow: inset 1px 1px 10px #ccc; &.active {
.bg-white {
box-shadow: inset 1px 1px 10px #ccc;
}
}
} }
body { body {
@ -26,26 +34,25 @@ body {
margin: 30px 0; margin: 30px 0;
} }
#section-iguana-wallet-settings .panel-title { #section-iguana-wallet-settings {
cursor: pointer; background: #f3f4f5;
cursor: hand;
}
#section-iguana-wallet-settings .panel-title:before { .panel-title {
content: '\F273'; cursor: pointer;
} cursor: hand;
#section-iguana-wallet-settings .panel-title.collapsed:before { }
content: '\F278'; .panel-title:before {
content: '\F273';
}
.panel-title.collapsed:before {
content: '\F278';
}
} }
#section-dashboard { #section-dashboard {
height: 100%; height: 100%;
} }
#section-iguana-wallet-settings {
background: #f3f4f5;
}
#edexcoin_dashboardinfo a, #edexcoin_dashboardinfo a,
.nav-top-menu, .nav-top-menu,
#kmd_txid_info_mdl .nav-tabs li, #kmd_txid_info_mdl .nav-tabs li,
@ -72,9 +79,11 @@ body {
cursor: hand; cursor: hand;
} }
.radio-custom input { .radio-custom {
cursor: pointer; input {
cursor: hand; cursor: pointer;
cursor: hand;
}
} }
.collapse { .collapse {
@ -94,8 +103,12 @@ body {
a { a {
pointer-events: none; pointer-events: none;
} }
li span.rc-tree-iconEle { li {
display: none; span {
&.rc-tree-iconEle {
display: none;
}
}
} }
} }
@ -111,19 +124,23 @@ body {
user-select: all; user-select: all;
} }
#RefreshBasiliskConnectionsMdl .btn-close { #RefreshBasiliskConnectionsMdl {
position: absolute; .btn-close {
top: 15px; position: absolute;
right: 15px; top: 15px;
right: 15px;
}
} }
.page-aside { .page-aside {
position: fixed; position: fixed;
} }
.page-aside-inner .wallet-widgets-list { .page-aside-inner {
overflow-y: auto; .wallet-widgets-list {
height: 100%; overflow-y: auto;
height: 100%;
}
} }
.display-sync-only-coins-toggle { .display-sync-only-coins-toggle {
@ -264,20 +281,16 @@ body {
} }
} }
/* The switch - the box around the slider */
.switch { .switch {
position: relative; position: relative;
display: inline-block; display: inline-block;
width: 40px; width: 40px;
height: 24px; height: 24px;
input {
display: none;
}
} }
/* Hide default HTML checkbox */
.switch input {
display: none;
}
/* The slider */
.slider { .slider {
border-radius: 20px; border-radius: 20px;
position: absolute; position: absolute;
@ -289,19 +302,19 @@ body {
background-color: #ccc; background-color: #ccc;
-webkit-transition: .4s; -webkit-transition: .4s;
transition: .4s; transition: .4s;
}
.slider:before { &:before {
border-radius: 50%; border-radius: 50%;
position: absolute; position: absolute;
content: ""; content: '';
height: 20px; height: 20px;
width: 20px; width: 20px;
left: 2px; left: 2px;
bottom: 2px; bottom: 2px;
background-color: white; background-color: white;
-webkit-transition: .4s; -webkit-transition: .4s;
transition: .4s; transition: .4s;
}
} }
.toggle-label { .toggle-label {
@ -326,17 +339,19 @@ input:checked + .slider:before {
transform: translateX(16px); transform: translateX(16px);
} }
.dropdown-menu li { .dropdown-menu {
cursor: pointer; li {
} cursor: pointer;
}
/* Rounded sliders */
.slider.round {
border-radius: 34px;
} }
.slider.round:before { .slider {
border-radius: 50%; &.round {
border-radius: 34px;
&:before {
border-radius: 50%;
}
}
} }
.pointer { .pointer {
@ -363,59 +378,59 @@ input:checked + .slider:before {
padding: 1em 1em 1em 2em; padding: 1em 1em 1em 2em;
border-left: 4px solid #DDD; border-left: 4px solid #DDD;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.125); box-shadow: 0 1px 1px rgba(0, 0, 0, 0.125);
}
.notice:before { &:before {
position: absolute; position: absolute;
top: 50%; top: 50%;
margin-top: -17px; margin-top: -17px;
left: -17px; left: -17px;
background-color: #DDD; background-color: #DDD;
color: #FFF; color: #FFF;
width: 30px; width: 30px;
height: 30px; height: 30px;
border-radius: 100%; border-radius: 100%;
text-align: center; text-align: center;
line-height: 30px; line-height: 30px;
font-weight: bold; font-weight: bold;
font-family: Georgia; font-family: Georgia;
text-shadow: 1px 1px rgba(0, 0, 0, 0.5); text-shadow: 1px 1px rgba(0, 0, 0, 0.5);
}
} }
.info { .info {
border-color: #0074D9; border-color: #0074D9;
}
.info:before { &:before {
content: 'i'; content: 'i';
background-color: #0074D9; background-color: #0074D9;
}
} }
.success { .success {
border-color: #2ECC40; border-color: #2ECC40;
}
.success:before { &:before {
content: ''; content: '';
background-color: #2ECC40; background-color: #2ECC40;
}
} }
.warning { .warning {
border-color: #FFDC00; border-color: #FFDC00;
}
&:before {
.warning:before { content: '!';
content: '!'; background-color: #FFDC00;
background-color: #FFDC00; }
} }
.error { .error {
border-color: #FF4136; border-color: #FF4136;
}
.error:before { &:before {
content: 'X'; content: 'X';
background-color: #FF4136; background-color: #FF4136;
}
} }
} }
@ -430,21 +445,22 @@ input:checked + .slider:before {
.badge { .badge {
margin-left: 2px; margin-left: 2px;
font-weight: bold; font-weight: bold;
}
.badge.success { &.success {
color: #3c763d; color: #3c763d;
background-color: #dff0d8; background-color: #dff0d8;
border-color: #d6e9c6; border-color: #d6e9c6;
} }
.badge.pending { &.pending {
color: #8a6d3b; color: #8a6d3b;
background-color: #fcf8e3; background-color: #fcf8e3;
border-color: #faebcc; border-color: #faebcc;
} }
.badge.error { &.error {
color: #a94442; color: #a94442;
background-color: #f2dede; background-color: #f2dede;
border-color: #ebccd1; border-color: #ebccd1;
}
} }
.spinner-hide { .spinner-hide {
@ -500,57 +516,69 @@ input:checked + .slider:before {
height: 40px; height: 40px;
text-align: center; text-align: center;
font-size: 10px; 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 { > div {
-webkit-animation-delay: -1.1s; background-color: #333;
animation-delay: -1.1s; height: 100%;
} width: 6px;
display: inline-block;
.spinner .rect3 {
-webkit-animation-delay: -1.0s;
animation-delay: -1.0s;
}
.spinner .rect4 { -webkit-animation: sk-stretchdelay 1.2s infinite ease-in-out;
-webkit-animation-delay: -0.9s; animation: sk-stretchdelay 1.2s infinite ease-in-out;
animation-delay: -0.9s; }
}
.spinner .rect5 { .rect2 {
-webkit-animation-delay: -0.8s; -webkit-animation-delay: -1.1s;
animation-delay: -0.8s; 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 { @-webkit-keyframes sk-stretchdelay {
0%, 40%, 100% { -webkit-transform: scaleY(0.4) } 0%,
20% { -webkit-transform: scaleY(1.0) } 40%,
100% {
-webkit-transform: scaleY(0.4)
}
20% {
-webkit-transform: scaleY(1.0)
}
} }
@keyframes sk-stretchdelay { @keyframes sk-stretchdelay {
0%, 40%, 100% { 0%,
40%,
100% {
transform: scaleY(0.4); transform: scaleY(0.4);
-webkit-transform: scaleY(0.4); -webkit-transform: scaleY(0.4);
} 20% { }
20% {
transform: scaleY(1.0); transform: scaleY(1.0);
-webkit-transform: scaleY(1.0); -webkit-transform: scaleY(1.0);
} }
} }
.bootstrap-select > .dropdown-toggle { .bootstrap-select {
z-index: 0; > .dropdown-toggle {
z-index: 0;
}
} }
select.form-control.form-material { select{
color: #757575; &.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.dismissToast = this.dismissToast.bind(this);
this.timeoutHandler = null; this.timeoutHandler = null;
} }
@ -53,7 +52,8 @@ class ToasterItem extends React.Component {
renderToast() { renderToast() {
// ensure that setTimeout is called only once for each toast message // 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.timeoutHandler = setTimeout(() => {
this.dismissToast(this.state.toastId); this.dismissToast(this.state.toastId);
}, DISPLAY_LENGTH_MILLIS); }, 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 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 = { export function Dashboard(state = {
activeSection: 'wallets', activeSection: 'wallets',
activeHandle: null, activeHandle: null,
@ -25,7 +35,7 @@ export function Dashboard(state = {
currentNodeName: null, currentNodeName: null,
failedToConnectNodes: null, failedToConnectNodes: null,
}, },
guiLog: {} guiLog: {},
}, action) { }, action) {
switch (action.type) { switch (action.type) {
case DASHBOARD_SECTION_CHANGE: case DASHBOARD_SECTION_CHANGE:
@ -70,44 +80,22 @@ export function Dashboard(state = {
displayViewCacheModal: action.display, displayViewCacheModal: action.display,
}); });
case LOG_GUI_HTTP: case LOG_GUI_HTTP:
let _guiLogState = state.guiLog; const logState = state.guiLog;
let _guiLogStateTrim = { const actionTS = action.timestamp;
error: [], let newLogState = {};
success: [],
pending: []
};
if (_guiLogState[action.timestamp]) { if (logState[actionTS]) {
_guiLogState[action.timestamp].status = action.log.status; const logItem = { [actionTS]: logState[actionTS] };
_guiLogState[action.timestamp].response = action.log.response; logItem[actionTS].status = action.log.status;
logItem[actionTS].response = action.log.response;
newLogState = trimHTTPLogs(Object.assign({}, logState, logItem));
} else { } 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, { return Object.assign({}, state, {
guiLog: _guiLogStateNew, guiLog: newLogState,
}); });
default: default:
return state; return state;

7
react/src/reducers/toaster.js

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

11
react/src/store.js

@ -14,16 +14,17 @@ const defaultState = {
Main: null, 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( const store = createStore(
rootReducer, rootReducer,
defaultState, defaultState,
applyMiddleware(
thunkMiddleware,
loggerMiddleware,
),
enhancers); enhancers);
/* eslint-enable */
export const history = syncHistoryWithStore(browserHistory, store); export const history = syncHistoryWithStore(browserHistory, store);

7
react/src/translate/translate.js

@ -4,10 +4,13 @@ import Config from '../config';
export function translate(langID) { export function translate(langID) {
let defaultLang = Config.defaultLang; let defaultLang = Config.defaultLang;
if (langID && langID.indexOf('.') > -1) { if (langID &&
langID.indexOf('.') > -1) {
let langIDComponents = langID.split('.'); 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]]; return _lang[defaultLang][langIDComponents[0]][langIDComponents[1]];
} else { } else {
console.log('Missing translation in js/' + defaultLang.toLowerCase() + '.js ' + langID); 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) { export function edexRemoveTXID(_obj, address, txidArray) {
let txidToStr = ':' + txidArray.join(':') + ':'; let txidToStr = `:${txidArray.join(':')}:`;
if (_obj, _obj.basilisk) { if (_obj, _obj.basilisk) {
if (Object.keys(_obj.basilisk).length === 0) { 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) { _obj.basilisk[key][coinAddr].refresh.data.length > 0) {
for (let i = 0; i < _obj.basilisk[key][coinAddr].refresh.data.length; i++) { 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) { 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.data.splice(i, 1);
_obj.basilisk[key][coinAddr].refresh.timestamp = Date.now(); _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) { _obj.basilisk[key][coinAddr].listunspent.data.length > 0) {
for (let i = 0; i < _obj.basilisk[key][coinAddr].listunspent.data.length; i++) { 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) { 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.data.splice(i, 1);
_obj.basilisk[key][coinAddr].listunspent.timestamp = Date.now(); _obj.basilisk[key][coinAddr].listunspent.timestamp = Date.now();
} }

6
react/src/util/copyToClipboard.js

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

61
react/src/util/time.js

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