diff --git a/react/src/components/dashboard/notifications.js b/react/src/components/dashboard/notifications/notifications.js
similarity index 97%
rename from react/src/components/dashboard/notifications.js
rename to react/src/components/dashboard/notifications/notifications.js
index 908aab5..8b3c9ae 100755
--- a/react/src/components/dashboard/notifications.js
+++ b/react/src/components/dashboard/notifications/notifications.js
@@ -1,7 +1,5 @@
import React from 'react';
-
-import { sortByDate } from '../../util/sort';
-
+import { sortByDate } from '../../../util/sort';
import {
NotificationsByTypeRender,
NotificationsModalRender,
diff --git a/react/src/components/dashboard/notifications.render.js b/react/src/components/dashboard/notifications/notifications.render.js
similarity index 98%
rename from react/src/components/dashboard/notifications.render.js
rename to react/src/components/dashboard/notifications/notifications.render.js
index f4adcb0..836ccab 100644
--- a/react/src/components/dashboard/notifications.render.js
+++ b/react/src/components/dashboard/notifications/notifications.render.js
@@ -1,8 +1,8 @@
import React from 'react';
import {
secondsToString
-} from '../../util/time';
-import { translate } from '../../translate/translate';
+} from '../../../util/time';
+import { translate } from '../../../translate/translate';
export const NotificationsByTypeRender = function(logItem, type, index) {
return (
diff --git a/react/src/components/dashboard/receiveCoin.js b/react/src/components/dashboard/receiveCoin/receiveCoin.js
similarity index 91%
rename from react/src/components/dashboard/receiveCoin.js
rename to react/src/components/dashboard/receiveCoin/receiveCoin.js
index 64b2023..99c5069 100644
--- a/react/src/components/dashboard/receiveCoin.js
+++ b/react/src/components/dashboard/receiveCoin/receiveCoin.js
@@ -3,8 +3,8 @@ import {
copyCoinAddress,
checkAddressBasilisk,
validateAddressBasilisk
-} from '../../actions/actionCreators';
-import Store from '../../store';
+} from '../../../actions/actionCreators';
+import Store from '../../../store';
import {
AddressActionsBasiliskModeRender,
@@ -62,10 +62,12 @@ class ReceiveCoin extends React.Component {
for (let i = 0; i < this.props.addresses.public.length; i++) {
let address = this.props.addresses.public[i];
- if (this.isBasiliskMode() && this.hasNoAmount(address)) {
+ if (this.isBasiliskMode() &&
+ this.hasNoAmount(address)) {
address.amount = this.props.cache && this.props.cache[this.props.coin][address.address] && this.props.cache[this.props.coin][address.address].getbalance.data && this.props.cache[this.props.coin][address.address].getbalance.data.balance ? this.props.cache[this.props.coin][address.address].getbalance.data.balance : 'N/A';
}
- if (this.isBasiliskMode() && this.hasNoInterest(address)) {
+ if (this.isBasiliskMode() &&
+ this.hasNoInterest(address)) {
address.interest = this.props.cache && this.props.cache[this.props.coin][address.address] && this.props.cache[this.props.coin][address.address].getbalance.data && this.props.cache[this.props.coin][address.address].getbalance.data.interest ? this.props.cache[this.props.coin][address.address].getbalance.data.interest : 'N/A';
}
diff --git a/react/src/components/dashboard/receiveCoin.render.js b/react/src/components/dashboard/receiveCoin/receiveCoin.render.js
similarity index 93%
rename from react/src/components/dashboard/receiveCoin.render.js
rename to react/src/components/dashboard/receiveCoin/receiveCoin.render.js
index 33a2208..c83f736 100644
--- a/react/src/components/dashboard/receiveCoin.render.js
+++ b/react/src/components/dashboard/receiveCoin/receiveCoin.render.js
@@ -1,5 +1,5 @@
import React from 'react';
-import { translate } from '../../translate/translate';
+import { translate } from '../../../translate/translate';
export const AddressActionsBasiliskModeRender = function(address) {
return (
@@ -27,7 +27,7 @@ export const AddressActionsBasiliskModeRender = function(address) {
);
};
-export const AddressActionsNonBasiliskModeRender = function (address) {
+export const AddressActionsNonBasiliskModeRender = function(address) {
return (
@@ -40,7 +40,7 @@ export const AddressActionsNonBasiliskModeRender = function (address) {
);
};
-export const AddressItemRender = function (address) {
+export const AddressItemRender = function(address) {
return (
{ this.renderAddressActions(address.address) }
@@ -51,7 +51,7 @@ export const AddressItemRender = function (address) {
);
};
-export const ReceiveCoinRender = function () {
+export const ReceiveCoinRender = function() {
return (
diff --git a/react/src/components/dashboard/sendCoin.js b/react/src/components/dashboard/sendCoin/sendCoin.js
similarity index 99%
rename from react/src/components/dashboard/sendCoin.js
rename to react/src/components/dashboard/sendCoin/sendCoin.js
index 36f014a..a3319c5 100644
--- a/react/src/components/dashboard/sendCoin.js
+++ b/react/src/components/dashboard/sendCoin/sendCoin.js
@@ -1,13 +1,13 @@
import React from 'react';
-import Config from '../../config';
-import { translate } from '../../translate/translate';
+import Config from '../../../config';
+import { translate } from '../../../translate/translate';
import {
checkTimestamp
-} from '../../util/time';
+} from '../../../util/time';
import {
edexGetTxIDList,
edexRemoveTXID
-} from '../../util/cacheFormat';
+} from '../../../util/cacheFormat';
import {
resolveOpenAliasAddress,
triggerToaster,
@@ -21,8 +21,8 @@ import {
clearLastSendToResponseState,
sendToAddressStateAlt,
dexSendRawTX
-} from '../../actions/actionCreators';
-import Store from '../../store';
+} from '../../../actions/actionCreators';
+import Store from '../../../store';
import {
UTXOCacheInfoRender,
SendCoinResponseRender,
diff --git a/react/src/components/dashboard/sendCoin.render.js b/react/src/components/dashboard/sendCoin/sendCoin.render.js
similarity index 99%
rename from react/src/components/dashboard/sendCoin.render.js
rename to react/src/components/dashboard/sendCoin/sendCoin.render.js
index 9672a90..80ddd6c 100644
--- a/react/src/components/dashboard/sendCoin.render.js
+++ b/react/src/components/dashboard/sendCoin/sendCoin.render.js
@@ -1,9 +1,9 @@
import React from 'react';
-import { translate } from '../../translate/translate';
+import { translate } from '../../../translate/translate';
import {
secondsElapsedToString,
secondsToString
-} from '../../util/time';
+} from '../../../util/time';
export const UTXOCacheInfoRender = function(refreshCacheData, isReadyToUpdate, waitUntilCallIsFinished, timestamp) {
return (
diff --git a/react/src/components/dashboard/settings.js b/react/src/components/dashboard/settings/settings.js
similarity index 76%
rename from react/src/components/dashboard/settings.js
rename to react/src/components/dashboard/settings/settings.js
index 93742a8..7213d80 100644
--- a/react/src/components/dashboard/settings.js
+++ b/react/src/components/dashboard/settings/settings.js
@@ -1,5 +1,5 @@
import React from 'react';
-import { translate } from '../../translate/translate';
+import { translate } from '../../../translate/translate';
import {
iguanaActiveHandle,
encryptWallet,
@@ -12,8 +12,8 @@ import {
saveAppConfig,
getAppInfo,
shepherdCli
-} from '../../actions/actionCreators';
-import Store from '../../store';
+} from '../../../actions/actionCreators';
+import Store from '../../../store';
import {
AppInfoTabRender,
@@ -26,7 +26,6 @@ import {
2) add fiat section
3) kickstart section
4) batch export/import wallet addresses
- 5) export keys, add coin selector
*/
class Settings extends React.Component {
constructor(props) {
@@ -41,6 +40,8 @@ class Settings extends React.Component {
cliCmdString: null,
cliCoin: null,
cliResponse: null,
+ exportWifKeysRaw: false,
+ seedInputVisibility: false,
};
this.exportWifKeys = this.exportWifKeys.bind(this);
this.updateInput = this.updateInput.bind(this);
@@ -52,6 +53,8 @@ class Settings extends React.Component {
this.renderPeersList = this.renderPeersList.bind(this);
this.renderSNPeersList = this.renderSNPeersList.bind(this);
this._saveAppConfig = this._saveAppConfig.bind(this);
+ this.exportWifKeysRaw = this.exportWifKeysRaw.bind(this);
+ this.toggleSeedInputVisibility = this.toggleSeedInputVisibility.bind(this);
}
componentDidMount() {
@@ -72,6 +75,12 @@ class Settings extends React.Component {
}
}
+ toggleSeedInputVisibility() {
+ this.setState({
+ seedInputVisibility: !this.state.seedInputVisibility,
+ });
+ }
+
execCliCmd() {
Store.dispatch(shepherdCli('passthru', this.state.cliCoin, this.state.cliCmd));
}
@@ -114,12 +123,14 @@ class Settings extends React.Component {
renderPeersList() {
if (this.state.getPeersCoin) {
- const coin = this.state.getPeersCoin.split('|')[0];
-
- if (this.props.Settings.rawPeers &&
- this.state.getPeersCoin &&
- this.props.Settings.rawPeers[coin]) {
- return this.props.Settings.rawPeers[coin].map((ip) =>
+ const _getPeersCoin = this.state.getPeersCoin;
+ const _rawPeers = this.props.Settings.rawPeers;
+ const coin = _getPeersCoin.split('|')[0];
+
+ if (_rawPeers &&
+ _getPeersCoin &&
+ _rawPeers[coin]) {
+ return _rawPeers[coin].map((ip) =>
{ ip }
);
} else {
@@ -142,12 +153,14 @@ class Settings extends React.Component {
renderSNPeersList() {
if (this.state.getPeersCoin) {
- const coin = this.state.getPeersCoin.split('|')[0];
-
- if (this.props.Settings.supernetPeers &&
- this.state.getPeersCoin &&
- this.props.Settings.supernetPeers[coin]) {
- return this.props.Settings.supernetPeers[coin].map((ip) =>
+ const _getPeersCoin = this.state.getPeersCoin;
+ const _supernetPeers = this.props.Settings.supernetPeers;
+ const coin = _getPeersCoin.split('|')[0];
+
+ if (_supernetPeers &&
+ _getPeersCoin &&
+ _supernetPeers[coin]) {
+ return _supernetPeers[coin].map((ip) =>
{ ip }
);
} else {
@@ -331,6 +344,60 @@ class Settings extends React.Component {
}
}
+ renderExportWifKeysRaw() {
+ const _wifKeysResponse = this.props.Settings.wifkey;
+
+ if (_wifKeysResponse &&
+ this.state.exportWifKeysRaw) {
+ return (
+ { JSON.stringify(_wifKeysResponse, null, '\t') }
+ );
+ } else {
+ return null;
+ }
+ }
+
+ renderWifKeys() {
+ let items = [];
+
+ if (this.props.Settings.wifkey) {
+ const _wifKeys = this.props.Settings.wifkey;
+
+ for (let i = 0; i < 2; i++) {
+ items.push(
+
+
+ { i === 0 ? 'Address list' : 'Wif key list' }
+ |
+ |
+
+ );
+
+ for (let _key in _wifKeys) {
+ if ((i === 0 && _key.length === 3 && _key !== 'tag') ||
+ (i === 1 && _key.indexOf('wif') > -1)) {
+ items.push(
+
+ { _key } |
+ { _wifKeys[_key] } |
+
+ );
+ }
+ }
+ }
+
+ return items;
+ } else {
+ return null;
+ }
+ }
+
+ exportWifKeysRaw() {
+ this.setState(Object.assign({}, this.state, {
+ exportWifKeysRaw: !this.state.exportWifKeysRaw,
+ }));
+ }
+
render() {
return SettingsRender.call(this);
}
diff --git a/react/src/components/dashboard/settings.render.js b/react/src/components/dashboard/settings/settings.render.js
similarity index 93%
rename from react/src/components/dashboard/settings.render.js
rename to react/src/components/dashboard/settings/settings.render.js
index a24fb37..3c806ec 100644
--- a/react/src/components/dashboard/settings.render.js
+++ b/react/src/components/dashboard/settings/settings.render.js
@@ -1,8 +1,8 @@
import React from 'react';
-import { translate } from '../../translate/translate';
-import AddCoinOptionsCrypto from '../addcoin/addcoinOptionsCrypto';
-import AddCoinOptionsAC from '../addcoin/addcoinOptionsAC';
-import AddCoinOptionsACFiat from '../addcoin/addcoinOptionsACFiat';
+import { translate } from '../../../translate/translate';
+import AddCoinOptionsCrypto from '../../addcoin/addcoinOptionsCrypto';
+import AddCoinOptionsAC from '../../addcoin/addcoinOptionsAC';
+import AddCoinOptionsACFiat from '../../addcoin/addcoinOptionsACFiat';
export const AppInfoTabRender = function() {
return (
@@ -278,7 +278,10 @@ export const SettingsRender = function() {
style={{ height: this.state.activeTab === 4 ? this.state.activeTabHeight + 'px' : '0' }}>
- { this.renderLB('INDEX.ONLY_ACTIVE_WIF_KEYS') }
+ { this.renderLB('INDEX.ONLY_ACTIVE_WIF_KEYS') }
+
+ { this.renderLB('SETTINGS.EXPORT_KEYS_NOTE') }
+
{ translate('INDEX.PLEASE_KEEP_KEYS_SAFE') }
@@ -287,11 +290,14 @@ export const SettingsRender = function() {
|