From 61a94b556becfa635f964ee260bf475c5ea7808a Mon Sep 17 00:00:00 2001 From: chirag-parmar Date: Thu, 30 Jan 2020 16:45:18 +0100 Subject: [PATCH 01/16] copy minimal in3 and change "import" to "require" --- .../controllers/network/createIn3Client.js | 64 +++++++++++++++++++ app/scripts/controllers/network/network.js | 19 +++++- 2 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 app/scripts/controllers/network/createIn3Client.js diff --git a/app/scripts/controllers/network/createIn3Client.js b/app/scripts/controllers/network/createIn3Client.js new file mode 100644 index 000000000..8795b30e3 --- /dev/null +++ b/app/scripts/controllers/network/createIn3Client.js @@ -0,0 +1,64 @@ +const mergeMiddleware = require('json-rpc-engine/src/mergeMiddleware') +const createScaffoldMiddleware = require('json-rpc-engine/src/createScaffoldMiddleware') +const createBlockReRefMiddleware = require('eth-json-rpc-middleware/block-ref') +const createRetryOnEmptyMiddleware = require('eth-json-rpc-middleware/retryOnEmpty') +const createBlockCacheMiddleware = require('eth-json-rpc-middleware/block-cache') +const createInflightMiddleware = require('eth-json-rpc-middleware/inflight-cache') +const createBlockTrackerInspectorMiddleware = require('eth-json-rpc-middleware/block-tracker-inspector') +const providerFromMiddleware = require('eth-json-rpc-middleware/providerFromMiddleware') +const createIn3Middleware = require('eth-json-rpc-in3') +const BlockTracker = require('eth-block-tracker') + +module.exports = createIn3Client + +function createIn3Client ({ network }) { + const in3Middleware = createIn3Middleware({ chainId: network }) + const in3Provider = providerFromMiddleware(in3Middleware) + const blockTracker = new BlockTracker({ provider: in3Provider }) + + const networkMiddleware = mergeMiddleware([ + createNetworkAndChainIdMiddleware({ network }), + createBlockCacheMiddleware({ blockTracker }), + createInflightMiddleware(), + createBlockReRefMiddleware({ blockTracker, provider: in3Provider }), + createRetryOnEmptyMiddleware({ blockTracker, provider: in3Provider }), + createBlockTrackerInspectorMiddleware({ blockTracker }), + in3Middleware, + ]) + return { networkMiddleware, blockTracker } +} + +function createNetworkAndChainIdMiddleware ({ network }) { + let chainId + let netId + + switch (network) { + case 'mainnet': + netId = '1' + chainId = '0x01' + break + case 'ropsten': + netId = '3' + chainId = '0x03' + break + case 'rinkeby': + netId = '4' + chainId = '0x04' + break + case 'kovan': + netId = '42' + chainId = '0x2a' + break + case 'goerli': + netId = '5' + chainId = '0x05' + break + default: + throw new Error(`createIn3Client - unknown network "${network}"`) + } + + return createScaffoldMiddleware({ + eth_chainId: chainId, + net_version: netId, + }) +} diff --git a/app/scripts/controllers/network/network.js b/app/scripts/controllers/network/network.js index 7b5d8ef38..4da59d504 100644 --- a/app/scripts/controllers/network/network.js +++ b/app/scripts/controllers/network/network.js @@ -8,6 +8,7 @@ const providerFromEngine = require('eth-json-rpc-middleware/providerFromEngine') const log = require('loglevel') const createMetamaskMiddleware = require('./createMetamaskMiddleware') const createInfuraClient = require('./createInfuraClient') +const createIn3Client = require ('./createIn3Client') const createJsonRpcClient = require('./createJsonRpcClient') const createLocalhostClient = require('./createLocalhostClient') const { createSwappableProxy, createEventEmitterProxy } = require('swappable-obj-proxy') @@ -175,9 +176,12 @@ module.exports = class NetworkController extends EventEmitter { const { type, rpcTarget, chainId, ticker, nickname } = opts // infura type-based endpoints const isInfura = INFURA_PROVIDER_TYPES.includes(type) - if (isInfura) { + const useIn3 = true + if (isInfura && !useIn3) { this._configureInfuraProvider(opts) // other type-based rpc endpoints + } else if (isInfura && useIn3) { + this._configureIn3Provider(opts) } else if (type === LOCALHOST) { this._configureLocalhostProvider() // url-based rpc endpoints @@ -202,6 +206,19 @@ module.exports = class NetworkController extends EventEmitter { this.networkConfig.putState(settings) } + _configureIn3Provider ({ type }) { + log.info('NetworkController - configureIn3Provider', type) + const networkClient = createIn3Client({ + network: type, + }) + this._setNetworkClient(networkClient) + // setup networkConfig + const settings = { + ticker: 'ETH', + } + this.networkConfig.putState(settings) + } + _configureLocalhostProvider () { log.info('NetworkController - configureLocalhostProvider') const networkClient = createLocalhostClient() From 1d2b93a48fc6f940eafc8e823597fb242ba81aed Mon Sep 17 00:00:00 2001 From: chirag-parmar Date: Thu, 30 Jan 2020 17:19:34 +0100 Subject: [PATCH 02/16] UI changes from metamask for in3 --- app/_locales/en/messages.json | 6 +++ app/scripts/controllers/network/enums.js | 5 +++ app/scripts/controllers/network/network.js | 29 +++++++++---- app/scripts/controllers/preferences.js | 15 +++++++ app/scripts/metamask-controller.js | 26 ++++++++++++ development/states/navigate-txs.json | 1 + test/data/2-state.json | 1 + .../controllers/metamask-controller-test.js | 14 +++++++ test/unit/migrations/035-test.js | 1 + test/unit/ui/app/actions.spec.js | 42 +++++++++++++++++++ test/unit/ui/app/reducers/metamask.spec.js | 14 ++++++- ui/app/ducks/metamask/metamask.js | 10 +++++ .../advanced-tab/advanced-tab.component.js | 29 +++++++++++++ .../advanced-tab/advanced-tab.container.js | 8 ++++ .../tests/advanced-tab-component.test.js | 2 +- ui/app/store/actions.js | 25 +++++++++++ 16 files changed, 216 insertions(+), 12 deletions(-) diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index e9e42f560..bd537dadb 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -1486,6 +1486,12 @@ "usedByClients": { "message": "Used by a variety of different clients" }, + "useIn3": { + "message": "Use In3 Network" + }, + "useIn3Description": { + "message": "Substitutes Infura for In3, a decentralized alternative." + }, "userName": { "message": "Username" }, diff --git a/app/scripts/controllers/network/enums.js b/app/scripts/controllers/network/enums.js index 472adce54..613665071 100644 --- a/app/scripts/controllers/network/enums.js +++ b/app/scripts/controllers/network/enums.js @@ -17,6 +17,9 @@ const KOVAN_DISPLAY_NAME = 'Kovan' const MAINNET_DISPLAY_NAME = 'Main Ethereum Network' const GOERLI_DISPLAY_NAME = 'Goerli' +const INFURA = 'infura' +const IN3 = 'in3' + module.exports = { ROPSTEN, RINKEBY, @@ -34,4 +37,6 @@ module.exports = { KOVAN_DISPLAY_NAME, MAINNET_DISPLAY_NAME, GOERLI_DISPLAY_NAME, + INFURA, + IN3, } diff --git a/app/scripts/controllers/network/network.js b/app/scripts/controllers/network/network.js index 4da59d504..77550da38 100644 --- a/app/scripts/controllers/network/network.js +++ b/app/scripts/controllers/network/network.js @@ -22,9 +22,13 @@ const { MAINNET, LOCALHOST, GOERLI, + INFURA, + IN3 } = require('./enums') const INFURA_PROVIDER_TYPES = [ROPSTEN, RINKEBY, KOVAN, MAINNET, GOERLI] +const RPC_PROVIDER_TYPES = [INFURA, IN3] + const env = process.env.METAMASK_ENV const METAMASK_DEBUG = process.env.METAMASK_DEBUG @@ -130,7 +134,7 @@ module.exports = class NetworkController extends EventEmitter { }) } - setRpcTarget (rpcTarget, chainId, ticker = 'ETH', nickname = '', rpcPrefs) { + setRpcTarget (rpcTarget, chainId, ticker = 'ETH', nickname = '', rpcPrefs = {}) { const providerConfig = { type: 'rpc', rpcTarget, @@ -142,11 +146,14 @@ module.exports = class NetworkController extends EventEmitter { this.providerConfig = providerConfig } - async setProviderType (type, rpcTarget = '', ticker = 'ETH', nickname = '') { + async setProviderType (type, rpcTarget = '', ticker = 'ETH', nickname = '', rpcPrefs = {}, rpcType = '') { assert.notEqual(type, 'rpc', `NetworkController - cannot call "setProviderType" with type 'rpc'. use "setRpcTarget"`) assert(INFURA_PROVIDER_TYPES.includes(type) || type === LOCALHOST, `NetworkController - Unknown rpc type "${type}"`) - const providerConfig = { type, rpcTarget, ticker, nickname } - this.providerConfig = providerConfig + if (!RPC_PROVIDER_TYPES.includes(rpcType)) { + rpcType = this.getProviderConfig().rpcType + } + this.providerConfig = { type, rpcTarget, ticker, nickname, rpcPrefs, rpcType } + } resetConnection () { @@ -173,14 +180,18 @@ module.exports = class NetworkController extends EventEmitter { } _configureProvider (opts) { - const { type, rpcTarget, chainId, ticker, nickname } = opts + const { type, rpcTarget, chainId, ticker, nickname, rpcPrefs, rpcType } = opts + console.log(opts) // infura type-based endpoints - const isInfura = INFURA_PROVIDER_TYPES.includes(type) + const isDefaultRpcNetwork = INFURA_PROVIDER_TYPES.includes(type) const useIn3 = true - if (isInfura && !useIn3) { + + if (isDefaultRpcNetwork && rpcType !== IN3) { + console.log('Infura') this._configureInfuraProvider(opts) - // other type-based rpc endpoints - } else if (isInfura && useIn3) { + // in3 + } else if (isDefaultRpcNetwork && rpcType === IN3) { + console.log("In3") this._configureIn3Provider(opts) } else if (type === LOCALHOST) { this._configureLocalhostProvider() diff --git a/app/scripts/controllers/preferences.js b/app/scripts/controllers/preferences.js index 1cfbb4d4c..b445d37ed 100644 --- a/app/scripts/controllers/preferences.js +++ b/app/scripts/controllers/preferences.js @@ -17,6 +17,7 @@ class PreferencesController { * @property {object} store.accountTokens The tokens stored per account and then per network type * @property {object} store.assetImages Contains assets objects related to assets added * @property {boolean} store.useBlockie The users preference for blockie identicons within the UI + * @property {boolean} store.useIn3 True to use In3 instead of Infura * @property {boolean} store.useNonceField The users preference for nonce field within the UI * @property {object} store.featureFlags A key-boolean map, where keys refer to features and booleans to whether the * user wishes to see that feature. @@ -36,6 +37,7 @@ class PreferencesController { tokens: [], suggestedTokens: {}, useBlockie: false, + useIn3: false, useNonceField: false, // WARNING: Do not use feature flags for security-sensitive things. @@ -92,6 +94,19 @@ class PreferencesController { this.store.updateState({ useBlockie: val }) } + /** + * Setter for the `useIn3` property + * + * @param {boolean} val - True to use In3 instead of Infura + * + */ + setUseIn3 (val) { + this.store.updateState({ useIn3: val }) + console.log('preferences.js') + console.log(this.store.getState()) + } + + /** * Setter for the `useNonceField` property * diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 9a43b8a80..f8c508313 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -64,6 +64,7 @@ const { PhishingController, } = require('gaba') const backEndMetaMetricsEvent = require('./lib/backend-metametrics') +const { IN3, INFURA } = require('./controllers/network/enums') module.exports = class MetamaskController extends EventEmitter { @@ -486,6 +487,7 @@ module.exports = class MetamaskController extends EventEmitter { setCustomRpc: nodeify(this.setCustomRpc, this), updateAndSetCustomRpc: nodeify(this.updateAndSetCustomRpc, this), delCustomRpc: nodeify(this.delCustomRpc, this), + setUseIn3Network: this.setUseIn3Network.bind(this), // PreferencesController setSelectedAddress: nodeify(preferencesController.setSelectedAddress, preferencesController), @@ -1743,6 +1745,30 @@ module.exports = class MetamaskController extends EventEmitter { await this.threeBoxController.init() } + /** + * Sets whether or not to use IN3 NEtwork provider instead of infura + * @param {boolean} useIn3 - True for IN3, false for Infura. + * @param {Function} cb - A callback function called when complete. + */ + setUseIn3Network (useIn3, cb) { + try { + this.preferencesController.setUseIn3(useIn3) + const cfg = this.networkController.getProviderConfig() + if (useIn3) { + this.networkController.setProviderType(cfg.type, cfg.rpcTarget, cfg.ticker, cfg.nickname, cfg.rpcPrefs, IN3) + } else { + this.networkController.setProviderType(cfg.type, cfg.rpcTarget, cfg.ticker, cfg.nickname, cfg.rpcPrefs, INFURA) + } + console.log('metamask-controller.js') + console.log(this.preferencesController.store.getState()) + console.log(this.networkController.store.getState()) + cb(useIn3, null) + } catch (err) { + cb(null, err) + } + } + + /** * Sets whether or not to use the blockie identicon format. * @param {boolean} val - True for bockie, false for jazzicon. diff --git a/development/states/navigate-txs.json b/development/states/navigate-txs.json index 39d24c1ea..e6684e8d3 100644 --- a/development/states/navigate-txs.json +++ b/development/states/navigate-txs.json @@ -140,6 +140,7 @@ }, "coinOptions": {}, "useBlockie": false, + "useIn3": false, "featureFlags": { "betaUI": true, "skipAnnounceBetaUI": true diff --git a/test/data/2-state.json b/test/data/2-state.json index 9d6dc9af5..fb30a4f95 100644 --- a/test/data/2-state.json +++ b/test/data/2-state.json @@ -39,6 +39,7 @@ "currentAccountTab": "history", "tokens": [], "useBlockie": false, + "useIn3": false, "featureFlags": {}, "currentLocale": null, "identities": { diff --git a/test/unit/app/controllers/metamask-controller-test.js b/test/unit/app/controllers/metamask-controller-test.js index 7eac91a9b..89c7bfd1c 100644 --- a/test/unit/app/controllers/metamask-controller-test.js +++ b/test/unit/app/controllers/metamask-controller-test.js @@ -338,6 +338,20 @@ describe('MetaMaskController', function () { }) + describe('preferencesControllerIn3', function () { + + it('defaults useIn3 to false', function () { + assert.equal(metamaskController.preferencesController.store.getState().useIn3, false) + }) + + it('setUseIn3 to true', function () { + metamaskController.setUseIn3Network(true, noop) + assert.equal(metamaskController.preferencesController.store.getState().useIn3, true) + }) + + }) + + describe('#selectFirstIdentity', function () { let identities, address diff --git a/test/unit/migrations/035-test.js b/test/unit/migrations/035-test.js index a6ab09864..634ee9f78 100644 --- a/test/unit/migrations/035-test.js +++ b/test/unit/migrations/035-test.js @@ -68,6 +68,7 @@ describe('migration #35', () => { tokens: [], suggestedTokens: {}, useBlockie: false, + useIn3: false, knownMethodData: {}, participateInMetaMetrics: null, firstTimeFlowType: null, diff --git a/test/unit/ui/app/actions.spec.js b/test/unit/ui/app/actions.spec.js index 9ed21e729..8a3cdae16 100644 --- a/test/unit/ui/app/actions.spec.js +++ b/test/unit/ui/app/actions.spec.js @@ -1499,6 +1499,48 @@ describe('Actions', () => { }) }) + describe('#setUseIn3', () => { + let setUseIn3Spy + + beforeEach(() => { + setUseIn3Spy = sinon.stub(background, 'setUseIn3Network') + }) + + afterEach(() => { + setUseIn3Spy.restore() + }) + + it('calls setUseIn3 in background', () => { + const store = mockStore() + + store.dispatch(actions.setUseIn3()) + assert(setUseIn3Spy.calledOnce) + }) + + it('errors when setUseIn3 in background throws', () => { + const store = mockStore() + const expectedActions = [ + { type: 'SHOW_LOADING_INDICATION', value: undefined }, + { type: 'SET_USE_IN3', value: 'Error: error' }, + { type: 'DISPLAY_WARNING', value: undefined }, + { type: 'HIDE_LOADING_INDICATION', value: 'Error: error' }, + ] + + setUseIn3Spy.callsFake((_, callback) => { + callback(new Error('error')) + }) + + store.dispatch(actions.setUseIn3()) + + const rola = store.getActions() + for (let i = 0; i < expectedActions.length; ++i) { + assert.strictEqual(JSON.stringify(rola[i]), JSON.stringify(expectedActions[i])) + } + // assert.deepEqual(store.getActions(), expectedActions) + }) + }) + + describe('#updateCurrentLocale', () => { let setCurrentLocaleSpy diff --git a/test/unit/ui/app/reducers/metamask.spec.js b/test/unit/ui/app/reducers/metamask.spec.js index 6b3dd7193..2ca7b4fdf 100644 --- a/test/unit/ui/app/reducers/metamask.spec.js +++ b/test/unit/ui/app/reducers/metamask.spec.js @@ -417,14 +417,24 @@ describe('MetaMask Reducers', () => { }) it('sets blockies', () => { + const state = reduceMetamask({}, { + type: actions.SET_USE_BLOCKIE, + value: true, + }) + + assert.equal(state.useBlockie, true) + }) + + it('sets use In3', () => { const state = reduceMetamask({}, { - type: actions.SET_USE_BLOCKIE, + type: actions.SET_USE_IN3, value: true, }) - assert.equal(state.useBlockie, true) + assert.equal(state.useIn3, true) }) + it('updates an arbitrary feature flag', () => { const state = reduceMetamask({}, { type: actions.UPDATE_FEATURE_FLAGS, diff --git a/ui/app/ducks/metamask/metamask.js b/ui/app/ducks/metamask/metamask.js index 8a9739af7..5eb590231 100644 --- a/ui/app/ducks/metamask/metamask.js +++ b/ui/app/ducks/metamask/metamask.js @@ -45,6 +45,7 @@ function reduceMetamask (state, action) { }, coinOptions: {}, useBlockie: false, + useIn3: false, featureFlags: {}, networkEndpointType: OLD_UI_NETWORK_TYPE, welcomeScreenSeen: false, @@ -367,6 +368,15 @@ function reduceMetamask (state, action) { useBlockie: action.value, }) + case actions.SET_USE_IN3: + console.log('metamask.js') + console.log(!metamaskState.useIn3) + return { + ...metamaskState, + useIn3: !metamaskState.useIn3, + } + + case actions.UPDATE_FEATURE_FLAGS: return extend(metamaskState, { featureFlags: action.value, diff --git a/ui/app/pages/settings/advanced-tab/advanced-tab.component.js b/ui/app/pages/settings/advanced-tab/advanced-tab.component.js index 5df85c027..62c153584 100644 --- a/ui/app/pages/settings/advanced-tab/advanced-tab.component.js +++ b/ui/app/pages/settings/advanced-tab/advanced-tab.component.js @@ -31,6 +31,8 @@ export default class AdvancedTab extends PureComponent { setShowFiatConversionOnTestnetsPreference: PropTypes.func.isRequired, threeBoxSyncingAllowed: PropTypes.bool.isRequired, setThreeBoxSyncingPermission: PropTypes.func.isRequired, + useIn3: PropTypes.bool, + setUseIn3: PropTypes.func.isRequired, threeBoxDisabled: PropTypes.bool.isRequired, } @@ -352,6 +354,32 @@ export default class AdvancedTab extends PureComponent { ) } + renderIn3Switch () { + const { t } = this.context + const { useIn3, setUseIn3 } = this.props + + return ( +
+
+ { t('useIn3') } +
+ { t('useIn3Description') } +
+
+
+
+ setUseIn3(!value)} + offLabel={t('off')} + onLabel={t('on')} + /> +
+
+
+ ) + } + renderContent () { const { warning } = this.props @@ -367,6 +395,7 @@ export default class AdvancedTab extends PureComponent { { this.renderUseNonceOptIn() } { this.renderAutoLogoutTimeLimit() } { this.renderThreeBoxControl() } + { this.renderIn3Switch() } ) } diff --git a/ui/app/pages/settings/advanced-tab/advanced-tab.container.js b/ui/app/pages/settings/advanced-tab/advanced-tab.container.js index 8b64e864f..4f41cb536 100644 --- a/ui/app/pages/settings/advanced-tab/advanced-tab.container.js +++ b/ui/app/pages/settings/advanced-tab/advanced-tab.container.js @@ -11,6 +11,7 @@ import { setAutoLogoutTimeLimit, setThreeBoxSyncingPermission, turnThreeBoxSyncingOnAndInitialize, + setUseIn3, setUseNonceField, } from '../../../store/actions' import {preferencesSelector} from '../../../selectors/selectors' @@ -24,8 +25,11 @@ export const mapStateToProps = state => { } = {}, threeBoxSyncingAllowed, threeBoxDisabled, + useIn3, useNonceField, } = metamask + console.log('adanved-tab.container.js') + console.log(metamask) const { showFiatInTestnets, autoLogoutTimeLimit } = preferencesSelector(state) return { @@ -36,6 +40,7 @@ export const mapStateToProps = state => { autoLogoutTimeLimit, threeBoxSyncingAllowed, threeBoxDisabled, + useIn3, useNonceField, } } @@ -51,6 +56,9 @@ export const mapDispatchToProps = dispatch => { setShowFiatConversionOnTestnetsPreference: value => { return dispatch(setShowFiatConversionOnTestnetsPreference(value)) }, + setUseIn3: value => { + return dispatch(setUseIn3(value)) + }, setAutoLogoutTimeLimit: value => { return dispatch(setAutoLogoutTimeLimit(value)) }, diff --git a/ui/app/pages/settings/advanced-tab/tests/advanced-tab-component.test.js b/ui/app/pages/settings/advanced-tab/tests/advanced-tab-component.test.js index 924602ace..15e5306c2 100644 --- a/ui/app/pages/settings/advanced-tab/tests/advanced-tab-component.test.js +++ b/ui/app/pages/settings/advanced-tab/tests/advanced-tab-component.test.js @@ -16,7 +16,7 @@ describe('AdvancedTab Component', () => { } ) - assert.equal(root.find('.settings-page__content-row').length, 9) + assert.equal(root.find('.settings-page__content-row').length, 10) }) it('should update autoLogoutTimeLimit', () => { diff --git a/ui/app/store/actions.js b/ui/app/store/actions.js index 2642e89e9..089bcabf3 100644 --- a/ui/app/store/actions.js +++ b/ui/app/store/actions.js @@ -345,6 +345,7 @@ var actions = { retryTransaction, SET_PENDING_TOKENS: 'SET_PENDING_TOKENS', CLEAR_PENDING_TOKENS: 'CLEAR_PENDING_TOKENS', + SET_USE_IN3: 'SET_USE_IN3', setPendingTokens, clearPendingTokens, @@ -2436,6 +2437,8 @@ function setPreference (preference, value) { dispatch(actions.showLoadingIndication()) return new Promise((resolve, reject) => { background.setPreference(preference, value, (err, updatedPreferences) => { + console.log(err) + console.log(updatedPreferences) dispatch(actions.hideLoadingIndication()) if (err) { @@ -2465,6 +2468,28 @@ function setShowFiatConversionOnTestnetsPreference (value) { return setPreference('showFiatInTestnets', value) } +export function setUseIn3 (value) { + log.debug(`background.setUseIn3Network: ${value}`) + return (dispatch) => { + dispatch(showLoadingIndication()) + if (typeof variable === 'boolean') { + dispatch(displayWarning('useIn3 must be boolean')) + return 'error' + } + background.setUseIn3Network(value, (result, error) => { + if (!error) { + dispatch({ + type: actionConstants.SET_USE_IN3, + value: result, + }) + } else { + dispatch(displayWarning(error.message)) + } + dispatch(hideLoadingIndication()) + }) + } +} + function setAutoLogoutTimeLimit (value) { return setPreference('autoLogoutTimeLimit', value) } From 5bd2c8635c28724664a62c2d20f6d9be91dd4a49 Mon Sep 17 00:00:00 2001 From: chirag-parmar Date: Thu, 30 Jan 2020 18:12:12 +0100 Subject: [PATCH 03/16] remove "export" and add to module.exports --- ui/app/store/actions.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/app/store/actions.js b/ui/app/store/actions.js index 089bcabf3..26be7b7d8 100644 --- a/ui/app/store/actions.js +++ b/ui/app/store/actions.js @@ -346,6 +346,7 @@ var actions = { SET_PENDING_TOKENS: 'SET_PENDING_TOKENS', CLEAR_PENDING_TOKENS: 'CLEAR_PENDING_TOKENS', SET_USE_IN3: 'SET_USE_IN3', + setUseIn3, setPendingTokens, clearPendingTokens, @@ -2468,7 +2469,7 @@ function setShowFiatConversionOnTestnetsPreference (value) { return setPreference('showFiatInTestnets', value) } -export function setUseIn3 (value) { +function setUseIn3 (value) { log.debug(`background.setUseIn3Network: ${value}`) return (dispatch) => { dispatch(showLoadingIndication()) From 43d29a0e57293b9af85afc98c67bface7008313e Mon Sep 17 00:00:00 2001 From: chirag-parmar Date: Thu, 30 Jan 2020 18:27:47 +0100 Subject: [PATCH 04/16] autogenerated on brave build --- app/scripts/background.js | 8 ++++---- app/scripts/contentscript.js | 2 +- app/scripts/lib/ens-ipfs/setup.js | 2 +- app/scripts/lib/get-first-preferred-lang-code.js | 2 +- app/scripts/lib/local-store.js | 2 +- app/scripts/lib/notification-manager.js | 2 +- app/scripts/metamask-controller.js | 8 ++++---- app/scripts/phishing-detect.js | 2 +- app/scripts/platforms/extension.js | 2 +- app/scripts/ui.js | 4 ++-- .../app/account-details/account-details.container.js | 2 +- .../components/app/account-menu/account-menu.component.js | 4 ++-- .../components/app/account-menu/account-menu.container.js | 2 +- ui/app/components/app/app-header/app-header.component.js | 2 +- ui/app/components/app/app-header/app-header.container.js | 2 +- ui/app/components/app/customize-gas-modal/index.js | 2 +- .../dai-migration-notification.container.js | 2 +- .../components/app/dropdowns/account-details-dropdown.js | 4 ++-- ui/app/components/app/dropdowns/network-dropdown.js | 4 ++-- ui/app/components/app/dropdowns/tests/menu.test.js | 2 +- ui/app/components/app/dropdowns/token-menu-dropdown.js | 4 ++-- .../advanced-gas-inputs/advanced-gas-inputs.container.js | 2 +- .../gas-modal-page-container.container.js | 2 +- .../tests/gas-modal-page-container-container.test.js | 2 +- ui/app/components/app/index.scss | 1 + .../loading-network-screen.container.js | 2 +- ui/app/components/app/menu-bar/menu-bar.container.js | 2 +- .../account-details-modal.container.js | 2 +- ui/app/components/app/modals/account-modal-container.js | 2 +- .../add-to-addressbook-modal.container.js | 2 +- .../cancel-transaction/cancel-transaction.container.js | 2 +- .../clear-approved-origins.container.js | 2 +- .../confirm-delete-network.container.js | 2 +- .../confirm-remove-account.component.js | 2 +- .../confirm-remove-account.container.js | 2 +- .../confirm-reset-account.container.js | 2 +- ui/app/components/app/modals/deposit-ether-modal.js | 2 +- ui/app/components/app/modals/export-private-key-modal.js | 2 +- .../app/modals/hide-token-confirmation-modal.js | 2 +- .../metametrics-opt-in-modal.container.js | 2 +- ui/app/components/app/modals/modal.js | 2 +- ui/app/components/app/modals/notification-modal.js | 2 +- .../app/modals/qr-scanner/qr-scanner.container.js | 4 ++-- .../provider-page-container-content.component.js | 2 +- ui/app/components/app/shift-list-item.js | 2 +- ui/app/components/app/signature-request-original.js | 4 ++-- .../app/signature-request/signature-request.container.js | 2 +- ui/app/components/app/token-cell.js | 4 ++-- .../transaction-list-item-details.container.js | 2 +- .../transaction-list-item.component.js | 2 +- .../transaction-list-item.container.js | 2 +- .../app/transaction-list/transaction-list.container.js | 2 +- .../tests/token-view-balance.component.test.js | 2 +- .../transaction-view-balance.component.js | 2 +- .../transaction-view-balance.container.js | 2 +- ui/app/components/app/wallet-view.js | 4 ++-- ui/app/components/ui/metafox-logo/index.js | 2 +- ui/app/ducks/app/app.js | 2 +- ui/app/ducks/index.js | 2 +- ui/app/ducks/locale/locale.js | 2 +- ui/app/ducks/metamask/metamask.js | 2 +- .../authenticated/authenticated.component.js | 2 +- .../initialized/initialized.component.js | 2 +- .../with-modal-props/with-modal-props.js | 2 +- ui/app/pages/add-token/add-token.component.js | 2 +- ui/app/pages/add-token/add-token.container.js | 2 +- .../confirm-add-suggested-token.component.js | 2 +- .../confirm-add-suggested-token.container.js | 2 +- .../confirm-add-token/confirm-add-token.component.js | 2 +- .../confirm-add-token/confirm-add-token.container.js | 2 +- ui/app/pages/confirm-approve/confirm-approve.container.js | 2 +- .../confirm-send-ether/confirm-send-ether.component.js | 2 +- .../confirm-send-ether/confirm-send-ether.container.js | 2 +- .../confirm-send-token/confirm-send-token.component.js | 2 +- .../confirm-send-token/confirm-send-token.container.js | 2 +- .../confirm-transaction-base.component.js | 2 +- .../confirm-transaction-base.container.js | 2 +- .../confirm-transaction-switch.component.js | 2 +- ui/app/pages/confirm-transaction/conf-tx.js | 4 ++-- .../confirm-transaction/confirm-transaction.component.js | 2 +- .../confirm-transaction/confirm-transaction.container.js | 2 +- ui/app/pages/create-account/connect-hardware/index.js | 6 +++--- ui/app/pages/create-account/create-account.component.js | 2 +- ui/app/pages/create-account/create-account.container.js | 2 +- ui/app/pages/create-account/import-account/index.js | 2 +- ui/app/pages/create-account/import-account/json.js | 4 ++-- ui/app/pages/create-account/import-account/private-key.js | 4 ++-- ui/app/pages/create-account/new-account.component.js | 2 +- ui/app/pages/create-account/new-account.container.js | 2 +- .../create-password/create-password.component.js | 2 +- .../import-with-seed-phrase.component.js | 2 +- .../import-with-seed-phrase.container.js | 4 ++-- .../tests/import-with-seed-phrase.component.test.js | 2 +- .../first-time-flow/create-password/new-account/index.js | 2 +- .../create-password/new-account/new-account.component.js | 2 +- .../unique-image/unique-image.component.js | 2 +- .../first-time-flow/end-of-flow/end-of-flow.component.js | 4 ++-- .../first-time-flow/end-of-flow/end-of-flow.container.js | 2 +- .../first-time-flow-switch.component.js | 2 +- ui/app/pages/first-time-flow/first-time-flow.component.js | 2 +- ui/app/pages/first-time-flow/first-time-flow.container.js | 4 ++-- ui/app/pages/first-time-flow/first-time-flow.selectors.js | 2 +- .../metametrics-opt-in/metametrics-opt-in.container.js | 2 +- .../confirm-seed-phrase/confirm-seed-phrase.component.js | 2 +- .../confirm-seed-phrase/confirm-seed-phrase.container.js | 4 ++-- .../reveal-seed-phrase/reveal-seed-phrase.component.js | 2 +- .../reveal-seed-phrase/reveal-seed-phrase.container.js | 4 ++-- .../first-time-flow/seed-phrase/seed-phrase.component.js | 2 +- .../tests/confirm-seed-phrase-component.test.js | 2 +- .../select-action/select-action.component.js | 2 +- .../select-action/select-action.container.js | 4 ++-- ui/app/pages/first-time-flow/welcome/welcome.component.js | 4 ++-- ui/app/pages/first-time-flow/welcome/welcome.container.js | 4 ++-- ui/app/pages/home/home.component.js | 2 +- ui/app/pages/home/home.container.js | 2 +- ui/app/pages/index.js | 2 +- ui/app/pages/keychains/restore-vault.js | 4 ++-- ui/app/pages/keychains/reveal-seed.js | 4 ++-- ui/app/pages/lock/lock.component.js | 2 +- ui/app/pages/lock/lock.container.js | 2 +- ui/app/pages/mobile-sync/index.js | 6 +++--- .../provider-approval/provider-approval.container.js | 2 +- ui/app/pages/routes/index.js | 8 ++++---- .../send-content/add-recipient/add-recipient.container.js | 2 +- .../add-recipient/tests/add-recipient-container.test.js | 2 +- .../amount-max-button/amount-max-button.container.js | 2 +- .../tests/amount-max-button-container.test.js | 2 +- .../send-amount-row/send-amount-row.container.js | 2 +- .../tests/send-amount-row-container.test.js | 2 +- .../send-asset-row/send-asset-row.container.js | 2 +- ui/app/pages/send/send-content/send-content.container.js | 2 +- .../send-content/send-gas-row/send-gas-row.container.js | 2 +- .../send-gas-row/tests/send-gas-row-container.test.js | 2 +- .../send-hex-data-row/send-hex-data-row.container.js | 2 +- ui/app/pages/send/send-footer/send-footer.component.js | 2 +- ui/app/pages/send/send-footer/send-footer.container.js | 2 +- .../send/send-footer/tests/send-footer-component.test.js | 2 +- .../send/send-footer/tests/send-footer-container.test.js | 2 +- ui/app/pages/send/send-header/send-header.component.js | 2 +- ui/app/pages/send/send-header/send-header.container.js | 2 +- .../send/send-header/tests/send-header-component.test.js | 2 +- .../send/send-header/tests/send-header-container.test.js | 2 +- ui/app/pages/send/send.container.js | 4 ++-- ui/app/pages/send/tests/send-container.test.js | 2 +- .../pages/settings/advanced-tab/advanced-tab.component.js | 2 +- .../pages/settings/advanced-tab/advanced-tab.container.js | 4 ++-- .../advanced-tab/tests/advanced-tab-component.test.js | 2 +- .../settings/connections-tab/connections-tab.container.js | 2 +- .../contact-list-tab/add-contact/add-contact.component.js | 2 +- .../contact-list-tab/add-contact/add-contact.container.js | 4 ++-- .../contact-list-tab/contact-list-tab.component.js | 2 +- .../contact-list-tab/contact-list-tab.container.js | 2 +- .../edit-contact/edit-contact.container.js | 4 ++-- .../contact-list-tab/my-accounts/my-accounts.component.js | 2 +- .../view-contact/view-contact.container.js | 4 ++-- .../pages/settings/networks-tab/networks-tab.component.js | 2 +- .../pages/settings/networks-tab/networks-tab.container.js | 4 ++-- .../pages/settings/security-tab/security-tab.component.js | 2 +- .../pages/settings/security-tab/security-tab.container.js | 4 ++-- .../pages/settings/settings-tab/settings-tab.container.js | 2 +- ui/app/pages/settings/settings.component.js | 2 +- ui/app/pages/settings/settings.container.js | 2 +- ui/app/pages/unlock-page/unlock-page.component.js | 4 ++-- ui/app/pages/unlock-page/unlock-page.container.js | 4 ++-- ui/app/store/actions.js | 2 +- 165 files changed, 209 insertions(+), 208 deletions(-) diff --git a/app/scripts/background.js b/app/scripts/background.js index 2639d7703..29cab5348 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -14,7 +14,7 @@ const endOfStream = require('end-of-stream') const pump = require('pump') const debounce = require('debounce-stream') const log = require('loglevel') -const extension = require('extensionizer') +const extension = require('~/brave/lib/extensionizer') const LocalStore = require('./lib/local-store') const storeTransform = require('obs-store/lib/transform') const asStream = require('obs-store/lib/asStream') @@ -24,11 +24,11 @@ const migrations = require('./migrations/') const PortStream = require('extension-port-stream') const createStreamSink = require('./lib/createStreamSink') const NotificationManager = require('./lib/notification-manager.js') -const MetamaskController = require('./metamask-controller') +const MetamaskController = require('~/brave/app/scripts/metamask-controller') const rawFirstTimeState = require('./first-time-state') -const setupSentry = require('./lib/setupSentry') +const setupSentry = require('~/brave/app/scripts/lib/setupSentry') const reportFailedTxToSentry = require('./lib/reportFailedTxToSentry') -const setupMetamaskMeshMetrics = require('./lib/setupMetamaskMeshMetrics') +const setupMetamaskMeshMetrics = require('~/brave/app/scripts/lib/setupMetamaskMeshMetrics') const EdgeEncryptor = require('./edge-encryptor') const getFirstPreferredLangCode = require('./lib/get-first-preferred-lang-code') const getObjStructure = require('./lib/getObjStructure') diff --git a/app/scripts/contentscript.js b/app/scripts/contentscript.js index db4d5fd63..728c487ab 100644 --- a/app/scripts/contentscript.js +++ b/app/scripts/contentscript.js @@ -6,7 +6,7 @@ const Dnode = require('dnode') const querystring = require('querystring') const LocalMessageDuplexStream = require('post-message-stream') const ObjectMultiplex = require('obj-multiplex') -const extension = require('extensionizer') +const extension = require('~/brave/lib/extensionizer') const PortStream = require('extension-port-stream') const inpageContent = fs.readFileSync(path.join(__dirname, '..', '..', 'dist', 'chrome', 'inpage.js')).toString() diff --git a/app/scripts/lib/ens-ipfs/setup.js b/app/scripts/lib/ens-ipfs/setup.js index 8f19510c7..e3a0d8678 100644 --- a/app/scripts/lib/ens-ipfs/setup.js +++ b/app/scripts/lib/ens-ipfs/setup.js @@ -1,5 +1,5 @@ const urlUtil = require('url') -const extension = require('extensionizer') +const extension = require('~/brave/lib/extensionizer') const resolveEnsToIpfsContentId = require('./resolver.js') const supportedTopLevelDomains = ['eth'] diff --git a/app/scripts/lib/get-first-preferred-lang-code.js b/app/scripts/lib/get-first-preferred-lang-code.js index 469235357..80062e3e1 100644 --- a/app/scripts/lib/get-first-preferred-lang-code.js +++ b/app/scripts/lib/get-first-preferred-lang-code.js @@ -1,4 +1,4 @@ -const extension = require('extensionizer') +const extension = require('~/brave/lib/extensionizer') const promisify = require('pify') const allLocales = require('../../_locales/index.json') diff --git a/app/scripts/lib/local-store.js b/app/scripts/lib/local-store.js index 8fde2e911..a109a218c 100644 --- a/app/scripts/lib/local-store.js +++ b/app/scripts/lib/local-store.js @@ -1,4 +1,4 @@ -const extension = require('extensionizer') +const extension = require('~/brave/lib/extensionizer') const log = require('loglevel') /** diff --git a/app/scripts/lib/notification-manager.js b/app/scripts/lib/notification-manager.js index 721d109a1..8570f2832 100644 --- a/app/scripts/lib/notification-manager.js +++ b/app/scripts/lib/notification-manager.js @@ -1,4 +1,4 @@ -const extension = require('extensionizer') +const extension = require('~/brave/lib/extensionizer') const NOTIFICATION_HEIGHT = 620 const NOTIFICATION_WIDTH = 360 diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index f8c508313..86ae4203d 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -25,12 +25,12 @@ const {setupMultiplex} = require('./lib/stream-utils.js') const KeyringController = require('eth-keyring-controller') const EnsController = require('./controllers/ens') const NetworkController = require('./controllers/network') -const PreferencesController = require('./controllers/preferences') +const PreferencesController = require('~/brave/app/scripts/controllers/preferences') const AppStateController = require('./controllers/app-state') -const InfuraController = require('./controllers/infura') +const InfuraController = require('~/brave/app/scripts/controllers/infura') const CachedBalancesController = require('./controllers/cached-balances') const OnboardingController = require('./controllers/onboarding') -const ThreeBoxController = require('./controllers/threebox') +const ThreeBoxController = require('~/brave/app/scripts/controllers/threebox') const RecentBlocksController = require('./controllers/recent-blocks') const IncomingTransactionsController = require('./controllers/incoming-transactions') const MessageManager = require('./lib/message-manager') @@ -63,7 +63,7 @@ const { ShapeShiftController, PhishingController, } = require('gaba') -const backEndMetaMetricsEvent = require('./lib/backend-metametrics') +const backEndMetaMetricsEvent = require('~/brave/app/scripts/lib/backend-metametrics') const { IN3, INFURA } = require('./controllers/network/enums') module.exports = class MetamaskController extends EventEmitter { diff --git a/app/scripts/phishing-detect.js b/app/scripts/phishing-detect.js index 266e4fc31..c8edfb319 100644 --- a/app/scripts/phishing-detect.js +++ b/app/scripts/phishing-detect.js @@ -2,7 +2,7 @@ const querystring = require('querystring') const dnode = require('dnode') const { EventEmitter } = require('events') const PortStream = require('extension-port-stream') -const extension = require('extensionizer') +const extension = require('~/brave/lib/extensionizer') const {setupMultiplex} = require('./lib/stream-utils.js') const { getEnvironmentType } = require('./lib/util') const ExtensionPlatform = require('./platforms/extension') diff --git a/app/scripts/platforms/extension.js b/app/scripts/platforms/extension.js index d54a8a7b3..6c7c6595d 100644 --- a/app/scripts/platforms/extension.js +++ b/app/scripts/platforms/extension.js @@ -1,4 +1,4 @@ -const extension = require('extensionizer') +const extension = require('~/brave/lib/extensionizer') const {createExplorerLink: explorerLink} = require('etherscan-link') const {getEnvironmentType} = require('../lib/util') diff --git a/app/scripts/ui.js b/app/scripts/ui.js index f9a8dc16a..813dd1114 100644 --- a/app/scripts/ui.js +++ b/app/scripts/ui.js @@ -8,11 +8,11 @@ import 'abortcontroller-polyfill/dist/polyfill-patch-fetch' const PortStream = require('extension-port-stream') const { getEnvironmentType } = require('./lib/util') const { ENVIRONMENT_TYPE_NOTIFICATION, ENVIRONMENT_TYPE_FULLSCREEN, ENVIRONMENT_TYPE_POPUP } = require('./lib/enums') -const extension = require('extensionizer') +const extension = require('~/brave/lib/extensionizer') const ExtensionPlatform = require('./platforms/extension') const NotificationManager = require('./lib/notification-manager') const notificationManager = new NotificationManager() -const setupSentry = require('./lib/setupSentry') +const setupSentry = require('~/brave/app/scripts/lib/setupSentry') const {EventEmitter} = require('events') const Dnode = require('dnode') const Eth = require('ethjs') diff --git a/ui/app/components/app/account-details/account-details.container.js b/ui/app/components/app/account-details/account-details.container.js index 581ff1e2f..27c22119b 100644 --- a/ui/app/components/app/account-details/account-details.container.js +++ b/ui/app/components/app/account-details/account-details.container.js @@ -1,5 +1,5 @@ import { connect } from 'react-redux' -import { hideSidebar, showModal } from '../../../store/actions' +import { hideSidebar, showModal } from '~/brave/ui/app/store/actions' import AccountDetails from './account-details.component' function mapDispatchToProps (dispatch) { diff --git a/ui/app/components/app/account-menu/account-menu.component.js b/ui/app/components/app/account-menu/account-menu.component.js index 1b81e33a2..132d22478 100644 --- a/ui/app/components/app/account-menu/account-menu.component.js +++ b/ui/app/components/app/account-menu/account-menu.component.js @@ -1,7 +1,7 @@ import React, { PureComponent } from 'react' import PropTypes from 'prop-types' import debounce from 'lodash.debounce' -import { Menu, Item, Divider, CloseArea } from '../dropdowns/components/menu' +import { Menu, Item, Divider, CloseArea } from '~/brave/ui/app/components/app/dropdowns/components/menu' import { ENVIRONMENT_TYPE_POPUP } from '../../../../../app/scripts/lib/enums' import { getEnvironmentType } from '../../../../../app/scripts/lib/util' import Tooltip from '../../ui/tooltip' @@ -15,7 +15,7 @@ import { IMPORT_ACCOUNT_ROUTE, CONNECT_HARDWARE_ROUTE, DEFAULT_ROUTE, -} from '../../../helpers/constants/routes' +} from '~/brave/ui/app/helpers/constants/routes' export default class AccountMenu extends PureComponent { static contextTypes = { diff --git a/ui/app/components/app/account-menu/account-menu.container.js b/ui/app/components/app/account-menu/account-menu.container.js index ae2e28e76..c27928102 100644 --- a/ui/app/components/app/account-menu/account-menu.container.js +++ b/ui/app/components/app/account-menu/account-menu.container.js @@ -10,7 +10,7 @@ import { showConfigPage, showInfoPage, showModal, -} from '../../../store/actions' +} from '~/brave/ui/app/store/actions' import { getMetaMaskAccounts } from '../../../selectors/selectors' import AccountMenu from './account-menu.component' diff --git a/ui/app/components/app/app-header/app-header.component.js b/ui/app/components/app/app-header/app-header.component.js index e1bc0cf24..6988c5612 100644 --- a/ui/app/components/app/app-header/app-header.component.js +++ b/ui/app/components/app/app-header/app-header.component.js @@ -3,7 +3,7 @@ import PropTypes from 'prop-types' import classnames from 'classnames' import Identicon from '../../ui/identicon' import MetaFoxLogo from '../../ui/metafox-logo' -import { DEFAULT_ROUTE } from '../../../helpers/constants/routes' +import { DEFAULT_ROUTE } from '~/brave/ui/app/helpers/constants/routes' const NetworkIndicator = require('../network') export default class AppHeader extends PureComponent { diff --git a/ui/app/components/app/app-header/app-header.container.js b/ui/app/components/app/app-header/app-header.container.js index b67338245..8fc4981cf 100644 --- a/ui/app/components/app/app-header/app-header.container.js +++ b/ui/app/components/app/app-header/app-header.container.js @@ -3,7 +3,7 @@ import { withRouter } from 'react-router-dom' import { compose } from 'recompose' import AppHeader from './app-header.component' -const actions = require('../../../store/actions') +const actions = require('~/brave/ui/app/store/actions') const mapStateToProps = state => { const { appState, metamask } = state diff --git a/ui/app/components/app/customize-gas-modal/index.js b/ui/app/components/app/customize-gas-modal/index.js index 1f9436810..21630ded2 100644 --- a/ui/app/components/app/customize-gas-modal/index.js +++ b/ui/app/components/app/customize-gas-modal/index.js @@ -4,7 +4,7 @@ const h = require('react-hyperscript') const inherits = require('util').inherits const connect = require('react-redux').connect const BigNumber = require('bignumber.js') -const actions = require('../../../store/actions') +const actions = require('~/brave/ui/app/store/actions') const GasModalCard = require('./gas-modal-card') import Button from '../../ui/button' diff --git a/ui/app/components/app/dai-migration-component/dai-migration-notification.container.js b/ui/app/components/app/dai-migration-component/dai-migration-notification.container.js index 175083bce..472174bd5 100644 --- a/ui/app/components/app/dai-migration-component/dai-migration-notification.container.js +++ b/ui/app/components/app/dai-migration-component/dai-migration-notification.container.js @@ -3,7 +3,7 @@ import { compose } from 'recompose' import DaiMigrationNotification from './dai-migration-notification.component' import withTokenTracker from '../../../helpers/higher-order-components/with-token-tracker' import { getSelectedAddress, getDaiV1Token } from '../../../selectors/selectors' -import { setMkrMigrationReminderTimestamp } from '../../../store/actions' +import { setMkrMigrationReminderTimestamp } from '~/brave/ui/app/store/actions' const mapStateToProps = (state) => { const { diff --git a/ui/app/components/app/dropdowns/account-details-dropdown.js b/ui/app/components/app/dropdowns/account-details-dropdown.js index cf2aa8ae8..634c98da5 100644 --- a/ui/app/components/app/dropdowns/account-details-dropdown.js +++ b/ui/app/components/app/dropdowns/account-details-dropdown.js @@ -3,10 +3,10 @@ const PropTypes = require('prop-types') const h = require('react-hyperscript') const inherits = require('util').inherits const connect = require('react-redux').connect -const actions = require('../../../store/actions') +const actions = require('~/brave/ui/app/store/actions') const { getSelectedIdentity, getRpcPrefsForCurrentProvider } = require('../../../selectors/selectors') const genAccountLink = require('../../../../lib/account-link.js') -const { Menu, Item, CloseArea } = require('./components/menu') +const { Menu, Item, CloseArea } = require('~/brave/ui/app/components/app/dropdowns/components/menu') AccountDetailsDropdown.contextTypes = { t: PropTypes.func, diff --git a/ui/app/components/app/dropdowns/network-dropdown.js b/ui/app/components/app/dropdowns/network-dropdown.js index e6a24ef11..aace94f57 100644 --- a/ui/app/components/app/dropdowns/network-dropdown.js +++ b/ui/app/components/app/dropdowns/network-dropdown.js @@ -5,12 +5,12 @@ const inherits = require('util').inherits const connect = require('react-redux').connect const { withRouter } = require('react-router-dom') const { compose } = require('recompose') -const actions = require('../../../store/actions') +const actions = require('~/brave/ui/app/store/actions') const Dropdown = require('./components/dropdown').Dropdown const DropdownMenuItem = require('./components/dropdown').DropdownMenuItem const NetworkDropdownIcon = require('./components/network-dropdown-icon') const R = require('ramda') -const { NETWORKS_ROUTE } = require('../../../helpers/constants/routes') +const { NETWORKS_ROUTE } = require('~/brave/ui/app/helpers/constants/routes') // classes from nodes of the toggle element. const notToggleElementClassnames = [ diff --git a/ui/app/components/app/dropdowns/tests/menu.test.js b/ui/app/components/app/dropdowns/tests/menu.test.js index 6413c0c2c..a10c117cf 100644 --- a/ui/app/components/app/dropdowns/tests/menu.test.js +++ b/ui/app/components/app/dropdowns/tests/menu.test.js @@ -2,7 +2,7 @@ import React from 'react' import assert from 'assert' import sinon from 'sinon' import { shallow } from 'enzyme' -import { Menu, Item, Divider, CloseArea } from '../components/menu' +import { Menu, Item, Divider, CloseArea } from '~/brave/ui/app/components/app/dropdowns/components/menu' describe('Dropdown Menu Components', () => { diff --git a/ui/app/components/app/dropdowns/token-menu-dropdown.js b/ui/app/components/app/dropdowns/token-menu-dropdown.js index e2730aea2..baeec63fa 100644 --- a/ui/app/components/app/dropdowns/token-menu-dropdown.js +++ b/ui/app/components/app/dropdowns/token-menu-dropdown.js @@ -3,9 +3,9 @@ const PropTypes = require('prop-types') const h = require('react-hyperscript') const inherits = require('util').inherits const connect = require('react-redux').connect -const actions = require('../../../store/actions') +const actions = require('~/brave/ui/app/store/actions') const genAccountLink = require('etherscan-link').createAccountLink -const { Menu, Item, CloseArea } = require('./components/menu') +const { Menu, Item, CloseArea } = require('~/brave/ui/app/components/app/dropdowns/components/menu') TokenMenuDropdown.contextTypes = { t: PropTypes.func, diff --git a/ui/app/components/app/gas-customization/advanced-gas-inputs/advanced-gas-inputs.container.js b/ui/app/components/app/gas-customization/advanced-gas-inputs/advanced-gas-inputs.container.js index 4fa0d4d94..f522e37fb 100644 --- a/ui/app/components/app/gas-customization/advanced-gas-inputs/advanced-gas-inputs.container.js +++ b/ui/app/components/app/gas-customization/advanced-gas-inputs/advanced-gas-inputs.container.js @@ -1,5 +1,5 @@ import { connect } from 'react-redux' -import { showModal } from '../../../../store/actions' +import { showModal } from '~/brave/ui/app/store/actions' import { decGWEIToHexWEI, decimalToHex, diff --git a/ui/app/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js b/ui/app/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js index c3d214b63..a5442ba24 100644 --- a/ui/app/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js +++ b/ui/app/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js @@ -11,7 +11,7 @@ import { updateSendAmount, setGasTotal, updateTransaction, -} from '../../../../store/actions' +} from '~/brave/ui/app/store/actions' import { setCustomGasPrice, setCustomGasLimit, diff --git a/ui/app/components/app/gas-customization/gas-modal-page-container/tests/gas-modal-page-container-container.test.js b/ui/app/components/app/gas-customization/gas-modal-page-container/tests/gas-modal-page-container-container.test.js index 8e3d14ea4..29d6370b3 100644 --- a/ui/app/components/app/gas-customization/gas-modal-page-container/tests/gas-modal-page-container-container.test.js +++ b/ui/app/components/app/gas-customization/gas-modal-page-container/tests/gas-modal-page-container-container.test.js @@ -40,7 +40,7 @@ proxyquire('../gas-modal-page-container.container.js', { getRenderableBasicEstimateData: (s) => `mockRenderableBasicEstimateData:${Object.keys(s).length}`, getDefaultActiveButtonIndex: (a, b) => a + b, }, - '../../../../store/actions': actionSpies, + '~/brave/ui/app/store/actions': actionSpies, '../../../../ducks/gas/gas.duck': gasActionSpies, '../../../../ducks/confirm-transaction/confirm-transaction.duck': confirmTransactionActionSpies, '../../../../ducks/send/send.duck': sendActionSpies, diff --git a/ui/app/components/app/index.scss b/ui/app/components/app/index.scss index 1afbebd00..126181d4b 100644 --- a/ui/app/components/app/index.scss +++ b/ui/app/components/app/index.scss @@ -87,3 +87,4 @@ @import 'multiple-notifications/index'; @import 'signature-request/index'; +/*BRAVE*/@import '../../../../brave/ui/app/components/app/connect-wallet/index.scss';@import '../../../../brave/ui/app/components/app/header/index.scss';@import '../../../../brave/ui/app/components/app/multiple-notifications/index.scss';@import '../../../../brave/ui/app/components/app/provider-page-container/index.scss';@import '../../../../brave/ui/app/components/app/request-signature/index.scss';@import '../../../../brave/ui/app/components/app/style/fonts.scss';@import '../../../../brave/ui/app/components/ui/theme/dark.scss';@import '../../../../brave/ui/app/pages/first-time-flow/create-password/index.scss';@import '../../../../brave/ui/app/pages/first-time-flow/index.scss';@import '../../../../brave/ui/app/pages/first-time-flow/seed-phrase/reveal-seed-phrase/index.scss';@import '../../../../brave/ui/app/pages/first-time-flow/welcome-modal/index.scss';@import '../../../../brave/ui/app/pages/first-time-flow/welcome/index.scss';@import '../../../../brave/ui/app/pages/routes/index.scss';@import '../../../../brave/ui/app/pages/settings/index.scss';@import '../../../../brave/ui/app/pages/settings/networks-tab/network-form/index.scss'; \ No newline at end of file diff --git a/ui/app/components/app/loading-network-screen/loading-network-screen.container.js b/ui/app/components/app/loading-network-screen/loading-network-screen.container.js index 87f1397ce..970d8fa62 100644 --- a/ui/app/components/app/loading-network-screen/loading-network-screen.container.js +++ b/ui/app/components/app/loading-network-screen/loading-network-screen.container.js @@ -1,6 +1,6 @@ import { connect } from 'react-redux' import LoadingNetworkScreen from './loading-network-screen.component' -import actions from '../../../store/actions' +import actions from '~/brave/ui/app/store/actions' import { getNetworkIdentifier } from '../../../selectors/selectors' const mapStateToProps = state => { diff --git a/ui/app/components/app/menu-bar/menu-bar.container.js b/ui/app/components/app/menu-bar/menu-bar.container.js index 059263ff3..edda3cea5 100644 --- a/ui/app/components/app/menu-bar/menu-bar.container.js +++ b/ui/app/components/app/menu-bar/menu-bar.container.js @@ -1,7 +1,7 @@ import { connect } from 'react-redux' import { WALLET_VIEW_SIDEBAR } from '../sidebars/sidebar.constants' import MenuBar from './menu-bar.component' -import { showSidebar, hideSidebar } from '../../../store/actions' +import { showSidebar, hideSidebar } from '~/brave/ui/app/store/actions' const mapStateToProps = state => { const { appState: { sidebar: { isOpen } } } = state diff --git a/ui/app/components/app/modals/account-details-modal/account-details-modal.container.js b/ui/app/components/app/modals/account-details-modal/account-details-modal.container.js index 4b2283ced..4759fbe86 100644 --- a/ui/app/components/app/modals/account-details-modal/account-details-modal.container.js +++ b/ui/app/components/app/modals/account-details-modal/account-details-modal.container.js @@ -1,5 +1,5 @@ import { connect } from 'react-redux' -import actions from '../../../../store/actions' +import actions from '~/brave/ui/app/store/actions' import { getSelectedIdentity, getRpcPrefsForCurrentProvider } from '../../../../selectors/selectors' import AccountDetailsModal from './account-details-modal.component' diff --git a/ui/app/components/app/modals/account-modal-container.js b/ui/app/components/app/modals/account-modal-container.js index b7ae0b5b8..9b9c43250 100644 --- a/ui/app/components/app/modals/account-modal-container.js +++ b/ui/app/components/app/modals/account-modal-container.js @@ -3,7 +3,7 @@ const PropTypes = require('prop-types') const h = require('react-hyperscript') const inherits = require('util').inherits const connect = require('react-redux').connect -const actions = require('../../../store/actions') +const actions = require('~/brave/ui/app/store/actions') const { getSelectedIdentity } = require('../../../selectors/selectors') import Identicon from '../../ui/identicon' diff --git a/ui/app/components/app/modals/add-to-addressbook-modal/add-to-addressbook-modal.container.js b/ui/app/components/app/modals/add-to-addressbook-modal/add-to-addressbook-modal.container.js index 413d4aa4a..4c022b1fa 100644 --- a/ui/app/components/app/modals/add-to-addressbook-modal/add-to-addressbook-modal.container.js +++ b/ui/app/components/app/modals/add-to-addressbook-modal/add-to-addressbook-modal.container.js @@ -1,6 +1,6 @@ import { connect } from 'react-redux' import AddToAddressBookModal from './add-to-addressbook-modal.component' -import actions from '../../../../store/actions' +import actions from '~/brave/ui/app/store/actions' function mapStateToProps (state) { return { diff --git a/ui/app/components/app/modals/cancel-transaction/cancel-transaction.container.js b/ui/app/components/app/modals/cancel-transaction/cancel-transaction.container.js index 6959889d9..ba56af8c9 100644 --- a/ui/app/components/app/modals/cancel-transaction/cancel-transaction.container.js +++ b/ui/app/components/app/modals/cancel-transaction/cancel-transaction.container.js @@ -4,7 +4,7 @@ import ethUtil from 'ethereumjs-util' import { multiplyCurrencies } from '../../../../helpers/utils/conversion-util' import withModalProps from '../../../../helpers/higher-order-components/with-modal-props' import CancelTransaction from './cancel-transaction.component' -import { showModal, createCancelTransaction } from '../../../../store/actions' +import { showModal, createCancelTransaction } from '~/brave/ui/app/store/actions' import { getHexGasTotal } from '../../../../helpers/utils/confirm-tx.util' const mapStateToProps = (state, ownProps) => { diff --git a/ui/app/components/app/modals/clear-approved-origins/clear-approved-origins.container.js b/ui/app/components/app/modals/clear-approved-origins/clear-approved-origins.container.js index 2276bc7e7..51bfd0154 100644 --- a/ui/app/components/app/modals/clear-approved-origins/clear-approved-origins.container.js +++ b/ui/app/components/app/modals/clear-approved-origins/clear-approved-origins.container.js @@ -2,7 +2,7 @@ import { connect } from 'react-redux' import { compose } from 'recompose' import withModalProps from '../../../../helpers/higher-order-components/with-modal-props' import ClearApprovedOriginsComponent from './clear-approved-origins.component' -import { clearApprovedOrigins } from '../../../../store/actions' +import { clearApprovedOrigins } from '~/brave/ui/app/store/actions' const mapDispatchToProps = dispatch => { return { diff --git a/ui/app/components/app/modals/confirm-delete-network/confirm-delete-network.container.js b/ui/app/components/app/modals/confirm-delete-network/confirm-delete-network.container.js index 4c9bb279f..936953890 100644 --- a/ui/app/components/app/modals/confirm-delete-network/confirm-delete-network.container.js +++ b/ui/app/components/app/modals/confirm-delete-network/confirm-delete-network.container.js @@ -2,7 +2,7 @@ import { connect } from 'react-redux' import { compose } from 'recompose' import withModalProps from '../../../../helpers/higher-order-components/with-modal-props' import ConfirmDeleteNetwork from './confirm-delete-network.component' -import { delRpcTarget } from '../../../../store/actions' +import { delRpcTarget } from '~/brave/ui/app/store/actions' const mapDispatchToProps = dispatch => { return { diff --git a/ui/app/components/app/modals/confirm-remove-account/confirm-remove-account.component.js b/ui/app/components/app/modals/confirm-remove-account/confirm-remove-account.component.js index 7fe79be5b..c1f770e6d 100644 --- a/ui/app/components/app/modals/confirm-remove-account/confirm-remove-account.component.js +++ b/ui/app/components/app/modals/confirm-remove-account/confirm-remove-account.component.js @@ -78,7 +78,7 @@ export default class ConfirmRemoveAccount extends Component { + target="_blank" href="https://support.brave.com/hc/en-us/articles/360035488071-How-do-I-manage-my-Crypto-Wallets-"> { t('learnMore') } diff --git a/ui/app/components/app/modals/confirm-remove-account/confirm-remove-account.container.js b/ui/app/components/app/modals/confirm-remove-account/confirm-remove-account.container.js index 0a3cda5b6..f25685340 100644 --- a/ui/app/components/app/modals/confirm-remove-account/confirm-remove-account.container.js +++ b/ui/app/components/app/modals/confirm-remove-account/confirm-remove-account.container.js @@ -2,7 +2,7 @@ import { connect } from 'react-redux' import { compose } from 'recompose' import ConfirmRemoveAccount from './confirm-remove-account.component' import withModalProps from '../../../../helpers/higher-order-components/with-modal-props' -import { removeAccount } from '../../../../store/actions' +import { removeAccount } from '~/brave/ui/app/store/actions' const mapStateToProps = state => { return { diff --git a/ui/app/components/app/modals/confirm-reset-account/confirm-reset-account.container.js b/ui/app/components/app/modals/confirm-reset-account/confirm-reset-account.container.js index ffbd40d9d..a712ffbc8 100644 --- a/ui/app/components/app/modals/confirm-reset-account/confirm-reset-account.container.js +++ b/ui/app/components/app/modals/confirm-reset-account/confirm-reset-account.container.js @@ -2,7 +2,7 @@ import { connect } from 'react-redux' import { compose } from 'recompose' import withModalProps from '../../../../helpers/higher-order-components/with-modal-props' import ConfirmResetAccount from './confirm-reset-account.component' -import { resetAccount } from '../../../../store/actions' +import { resetAccount } from '~/brave/ui/app/store/actions' const mapDispatchToProps = dispatch => { return { diff --git a/ui/app/components/app/modals/deposit-ether-modal.js b/ui/app/components/app/modals/deposit-ether-modal.js index f71e0619e..dea2cbbff 100644 --- a/ui/app/components/app/modals/deposit-ether-modal.js +++ b/ui/app/components/app/modals/deposit-ether-modal.js @@ -3,7 +3,7 @@ const PropTypes = require('prop-types') const h = require('react-hyperscript') const inherits = require('util').inherits const connect = require('react-redux').connect -const actions = require('../../../store/actions') +const actions = require('~/brave/ui/app/store/actions') const { getNetworkDisplayName } = require('../../../../../app/scripts/controllers/network/util') import Button from '../../ui/button' diff --git a/ui/app/components/app/modals/export-private-key-modal.js b/ui/app/components/app/modals/export-private-key-modal.js index 1e1aaeb74..7352bcb00 100644 --- a/ui/app/components/app/modals/export-private-key-modal.js +++ b/ui/app/components/app/modals/export-private-key-modal.js @@ -5,7 +5,7 @@ const h = require('react-hyperscript') const inherits = require('util').inherits const connect = require('react-redux').connect const { stripHexPrefix } = require('ethereumjs-util') -const actions = require('../../../store/actions') +const actions = require('~/brave/ui/app/store/actions') const AccountModalContainer = require('./account-modal-container') const { getSelectedIdentity } = require('../../../selectors/selectors') const ReadOnlyInput = require('../../ui/readonly-input') diff --git a/ui/app/components/app/modals/hide-token-confirmation-modal.js b/ui/app/components/app/modals/hide-token-confirmation-modal.js index e2b098923..c7efc2fea 100644 --- a/ui/app/components/app/modals/hide-token-confirmation-modal.js +++ b/ui/app/components/app/modals/hide-token-confirmation-modal.js @@ -3,7 +3,7 @@ const PropTypes = require('prop-types') const h = require('react-hyperscript') const inherits = require('util').inherits const connect = require('react-redux').connect -const actions = require('../../../store/actions') +const actions = require('~/brave/ui/app/store/actions') import Identicon from '../../ui/identicon' function mapStateToProps (state) { diff --git a/ui/app/components/app/modals/metametrics-opt-in-modal/metametrics-opt-in-modal.container.js b/ui/app/components/app/modals/metametrics-opt-in-modal/metametrics-opt-in-modal.container.js index ea7d71a73..7344261bb 100644 --- a/ui/app/components/app/modals/metametrics-opt-in-modal/metametrics-opt-in-modal.container.js +++ b/ui/app/components/app/modals/metametrics-opt-in-modal/metametrics-opt-in-modal.container.js @@ -2,7 +2,7 @@ import { connect } from 'react-redux' import { compose } from 'recompose' import MetaMetricsOptInModal from './metametrics-opt-in-modal.component' import withModalProps from '../../../../helpers/higher-order-components/with-modal-props' -import { setParticipateInMetaMetrics } from '../../../../store/actions' +import { setParticipateInMetaMetrics } from '~/brave/ui/app/store/actions' const mapStateToProps = (_, ownProps) => { const { unapprovedTxCount } = ownProps diff --git a/ui/app/components/app/modals/modal.js b/ui/app/components/app/modals/modal.js index ada758b99..325e973ee 100644 --- a/ui/app/components/app/modals/modal.js +++ b/ui/app/components/app/modals/modal.js @@ -3,7 +3,7 @@ const h = require('react-hyperscript') const inherits = require('util').inherits const connect = require('react-redux').connect const FadeModal = require('boron').FadeModal -const actions = require('../../../store/actions') +const actions = require('~/brave/ui/app/store/actions') const { resetCustomData: resetCustomGasData } = require('../../../ducks/gas/gas.duck') const isMobileView = require('../../../../lib/is-mobile-view') const { getEnvironmentType } = require('../../../../../app/scripts/lib/util') diff --git a/ui/app/components/app/modals/notification-modal.js b/ui/app/components/app/modals/notification-modal.js index a4282595f..ffe0a680f 100644 --- a/ui/app/components/app/modals/notification-modal.js +++ b/ui/app/components/app/modals/notification-modal.js @@ -2,7 +2,7 @@ const { Component } = require('react') const PropTypes = require('prop-types') const h = require('react-hyperscript') const connect = require('react-redux').connect -const actions = require('../../../store/actions') +const actions = require('~/brave/ui/app/store/actions') class NotificationModal extends Component { static contextProps = { diff --git a/ui/app/components/app/modals/qr-scanner/qr-scanner.container.js b/ui/app/components/app/modals/qr-scanner/qr-scanner.container.js index 2210fbed2..1633e1249 100644 --- a/ui/app/components/app/modals/qr-scanner/qr-scanner.container.js +++ b/ui/app/components/app/modals/qr-scanner/qr-scanner.container.js @@ -1,10 +1,10 @@ import { connect } from 'react-redux' import QrScanner from './qr-scanner.component' -const { hideModal, qrCodeDetected, showQrScanner } = require('../../../../store/actions') +const { hideModal, qrCodeDetected, showQrScanner } = require('~/brave/ui/app/store/actions') import { SEND_ROUTE, -} from '../../../../helpers/constants/routes' +} from '~/brave/ui/app/helpers/constants/routes' const mapStateToProps = state => { return { diff --git a/ui/app/components/app/provider-page-container/provider-page-container-content/provider-page-container-content.component.js b/ui/app/components/app/provider-page-container/provider-page-container-content/provider-page-container-content.component.js index 4062b130f..4eee68be0 100644 --- a/ui/app/components/app/provider-page-container/provider-page-container-content/provider-page-container-content.component.js +++ b/ui/app/components/app/provider-page-container/provider-page-container-content/provider-page-container-content.component.js @@ -70,7 +70,7 @@ export default class ProviderPageContainerContent extends PureComponent { {t('providerRequestInfo')}
diff --git a/ui/app/components/app/shift-list-item.js b/ui/app/components/app/shift-list-item.js index f5fa00047..ef5bb39c9 100644 --- a/ui/app/components/app/shift-list-item.js +++ b/ui/app/components/app/shift-list-item.js @@ -4,7 +4,7 @@ const PropTypes = require('prop-types') const h = require('react-hyperscript') const connect = require('react-redux').connect const explorerLink = require('etherscan-link').createExplorerLink -const actions = require('../../store/actions') +const actions = require('~/brave/ui/app/store/actions') const { formatDate, addressSummary } = require('../../helpers/utils/util') const CopyButton = require('../ui/copyButton') diff --git a/ui/app/components/app/signature-request-original.js b/ui/app/components/app/signature-request-original.js index e23d724cb..31a8932b9 100644 --- a/ui/app/components/app/signature-request-original.js +++ b/ui/app/components/app/signature-request-original.js @@ -14,7 +14,7 @@ const { ObjectInspector } = require('react-inspector') import AccountListItem from '../../pages/send/account-list-item/account-list-item.component' -const actions = require('../../store/actions') +const actions = require('~/brave/ui/app/store/actions') const { conversionUtil } = require('../../helpers/utils/conversion-util') const { @@ -27,7 +27,7 @@ const { import { clearConfirmTransaction } from '../../ducks/confirm-transaction/confirm-transaction.duck' import Button from '../ui/button' -const { DEFAULT_ROUTE } = require('../../helpers/constants/routes') +const { DEFAULT_ROUTE } = require('~/brave/ui/app/helpers/constants/routes') function mapStateToProps (state) { return { diff --git a/ui/app/components/app/signature-request/signature-request.container.js b/ui/app/components/app/signature-request/signature-request.container.js index 0b09c1a64..37e659646 100644 --- a/ui/app/components/app/signature-request/signature-request.container.js +++ b/ui/app/components/app/signature-request/signature-request.container.js @@ -2,7 +2,7 @@ import { connect } from 'react-redux' import { withRouter } from 'react-router-dom' import { compose } from 'recompose' import SignatureRequest from './signature-request.component' -import { goHome } from '../../../store/actions' +import { goHome } from '~/brave/ui/app/store/actions' import { clearConfirmTransaction } from '../../../ducks/confirm-transaction/confirm-transaction.duck' import { getSelectedAccount, diff --git a/ui/app/components/app/token-cell.js b/ui/app/components/app/token-cell.js index 495b9502b..d71228065 100644 --- a/ui/app/components/app/token-cell.js +++ b/ui/app/components/app/token-cell.js @@ -6,10 +6,10 @@ const connect = require('react-redux').connect import Identicon from '../ui/identicon' const prefixForNetwork = require('../../../lib/etherscan-prefix-for-network') const selectors = require('../../selectors/selectors') -const actions = require('../../store/actions') +const actions = require('~/brave/ui/app/store/actions') const { conversionUtil, multiplyCurrencies } = require('../../helpers/utils/conversion-util') -const TokenMenuDropdown = require('./dropdowns/token-menu-dropdown.js') +const TokenMenuDropdown = require('~/brave/ui/app/components/app/dropdowns/token-menu-dropdown') function mapStateToProps (state) { return { diff --git a/ui/app/components/app/transaction-list-item-details/transaction-list-item-details.container.js b/ui/app/components/app/transaction-list-item-details/transaction-list-item-details.container.js index 50f93f497..7da608a6c 100644 --- a/ui/app/components/app/transaction-list-item-details/transaction-list-item-details.container.js +++ b/ui/app/components/app/transaction-list-item-details/transaction-list-item-details.container.js @@ -1,7 +1,7 @@ import { connect } from 'react-redux' import TransactionListItemDetails from './transaction-list-item-details.component' import { checksumAddress } from '../../../helpers/utils/util' -import { tryReverseResolveAddress } from '../../../store/actions' +import { tryReverseResolveAddress } from '~/brave/ui/app/store/actions' const mapStateToProps = (state, ownProps) => { const { metamask } = state diff --git a/ui/app/components/app/transaction-list-item/transaction-list-item.component.js b/ui/app/components/app/transaction-list-item/transaction-list-item.component.js index 9ab0105f9..209f9cac7 100644 --- a/ui/app/components/app/transaction-list-item/transaction-list-item.component.js +++ b/ui/app/components/app/transaction-list-item/transaction-list-item.component.js @@ -8,7 +8,7 @@ import UserPreferencedCurrencyDisplay from '../user-preferenced-currency-display import TokenCurrencyDisplay from '../../ui/token-currency-display' import TransactionListItemDetails from '../transaction-list-item-details' import TransactionTimeRemaining from '../transaction-time-remaining' -import { CONFIRM_TRANSACTION_ROUTE } from '../../../helpers/constants/routes' +import { CONFIRM_TRANSACTION_ROUTE } from '~/brave/ui/app/helpers/constants/routes' import { UNAPPROVED_STATUS, TOKEN_METHOD_TRANSFER } from '../../../helpers/constants/transactions' import { PRIMARY, SECONDARY } from '../../../helpers/constants/common' import { getStatusKey } from '../../../helpers/utils/transactions.util' diff --git a/ui/app/components/app/transaction-list-item/transaction-list-item.container.js b/ui/app/components/app/transaction-list-item/transaction-list-item.container.js index 26ccec1f7..f7eb36025 100644 --- a/ui/app/components/app/transaction-list-item/transaction-list-item.container.js +++ b/ui/app/components/app/transaction-list-item/transaction-list-item.container.js @@ -2,7 +2,7 @@ import { connect } from 'react-redux' import { withRouter } from 'react-router-dom' import { compose } from 'recompose' import TransactionListItem from './transaction-list-item.component' -import { setSelectedToken, showModal, showSidebar, getContractMethodData } from '../../../store/actions' +import { setSelectedToken, showModal, showSidebar, getContractMethodData } from '~/brave/ui/app/store/actions' import { hexToDecimal } from '../../../helpers/utils/conversions.util' import { getTokenData } from '../../../helpers/utils/transactions.util' import { getHexGasTotal, increaseLastGasPrice } from '../../../helpers/utils/confirm-tx.util' diff --git a/ui/app/components/app/transaction-list/transaction-list.container.js b/ui/app/components/app/transaction-list/transaction-list.container.js index 4da044b2a..816482edb 100644 --- a/ui/app/components/app/transaction-list/transaction-list.container.js +++ b/ui/app/components/app/transaction-list/transaction-list.container.js @@ -8,7 +8,7 @@ import { } from '../../../selectors/transactions' import { getSelectedAddress, getAssetImages, getFeatureFlags } from '../../../selectors/selectors' import { selectedTokenSelector } from '../../../selectors/tokens' -import { updateNetworkNonce } from '../../../store/actions' +import { updateNetworkNonce } from '~/brave/ui/app/store/actions' import { fetchBasicGasAndTimeEstimates, fetchGasEstimates } from '../../../ducks/gas/gas.duck' const mapStateToProps = (state) => { diff --git a/ui/app/components/app/transaction-view-balance/tests/token-view-balance.component.test.js b/ui/app/components/app/transaction-view-balance/tests/token-view-balance.component.test.js index 0e2882e9c..aceda38ac 100644 --- a/ui/app/components/app/transaction-view-balance/tests/token-view-balance.component.test.js +++ b/ui/app/components/app/transaction-view-balance/tests/token-view-balance.component.test.js @@ -4,7 +4,7 @@ import { shallow } from 'enzyme' import sinon from 'sinon' import TokenBalance from '../../../ui/token-balance' import UserPreferencedCurrencyDisplay from '../../user-preferenced-currency-display' -import { SEND_ROUTE } from '../../../../helpers/constants/routes' +import { SEND_ROUTE } from '~/brave/ui/app/helpers/constants/routes' import TransactionViewBalance from '../transaction-view-balance.component' const propsMethodSpies = { diff --git a/ui/app/components/app/transaction-view-balance/transaction-view-balance.component.js b/ui/app/components/app/transaction-view-balance/transaction-view-balance.component.js index 73905574e..49921c9af 100644 --- a/ui/app/components/app/transaction-view-balance/transaction-view-balance.component.js +++ b/ui/app/components/app/transaction-view-balance/transaction-view-balance.component.js @@ -5,7 +5,7 @@ import Button from '../../ui/button' import Identicon from '../../ui/identicon' import TokenBalance from '../../ui/token-balance' import UserPreferencedCurrencyDisplay from '../user-preferenced-currency-display' -import { SEND_ROUTE } from '../../../helpers/constants/routes' +import { SEND_ROUTE } from '~/brave/ui/app/helpers/constants/routes' import { PRIMARY, SECONDARY } from '../../../helpers/constants/common' import Tooltip from '../../ui/tooltip-v2' diff --git a/ui/app/components/app/transaction-view-balance/transaction-view-balance.container.js b/ui/app/components/app/transaction-view-balance/transaction-view-balance.container.js index 41a4525dc..065019a2a 100644 --- a/ui/app/components/app/transaction-view-balance/transaction-view-balance.container.js +++ b/ui/app/components/app/transaction-view-balance/transaction-view-balance.container.js @@ -12,7 +12,7 @@ import { preferencesSelector, getIsMainnet, } from '../../../selectors/selectors' -import { showModal } from '../../../store/actions' +import { showModal } from '~/brave/ui/app/store/actions' const mapStateToProps = state => { const { showFiatInTestnets } = preferencesSelector(state) diff --git a/ui/app/components/app/wallet-view.js b/ui/app/components/app/wallet-view.js index 55aeec333..8a6d1aa47 100644 --- a/ui/app/components/app/wallet-view.js +++ b/ui/app/components/app/wallet-view.js @@ -7,11 +7,11 @@ const { compose } = require('recompose') const inherits = require('util').inherits const { checksumAddress } = require('../../helpers/utils/util') // const AccountDropdowns = require('./dropdowns/index.js').AccountDropdowns -const actions = require('../../store/actions') +const actions = require('~/brave/ui/app/store/actions') import BalanceComponent from '../ui/balance' const TokenList = require('./token-list') const selectors = require('../../selectors/selectors') -const { ADD_TOKEN_ROUTE } = require('../../helpers/constants/routes') +const { ADD_TOKEN_ROUTE } = require('~/brave/ui/app/helpers/constants/routes') import AddTokenButton from './add-token-button' import AccountDetails from './account-details' diff --git a/ui/app/components/ui/metafox-logo/index.js b/ui/app/components/ui/metafox-logo/index.js index 0aeaed743..60a3c8f23 100644 --- a/ui/app/components/ui/metafox-logo/index.js +++ b/ui/app/components/ui/metafox-logo/index.js @@ -1 +1 @@ -export { default } from './metafox-logo.component' +export { default } from '~/brave/ui/app/components/ui/metafox-logo/metafox-logo.component' diff --git a/ui/app/ducks/app/app.js b/ui/app/ducks/app/app.js index fbdaf7b8d..7f768523f 100644 --- a/ui/app/ducks/app/app.js +++ b/ui/app/ducks/app/app.js @@ -1,5 +1,5 @@ const extend = require('xtend') -const actions = require('../../store/actions') +const actions = require('~/brave/ui/app/store/actions') const txHelper = require('../../../lib/tx-helper') const log = require('loglevel') diff --git a/ui/app/ducks/index.js b/ui/app/ducks/index.js index 6808252ef..12bd46d51 100644 --- a/ui/app/ducks/index.js +++ b/ui/app/ducks/index.js @@ -5,7 +5,7 @@ const copyToClipboard = require('copy-to-clipboard') // // Sub-Reducers take in the complete state and return their sub-state // -const reduceMetamask = require('./metamask/metamask') +const reduceMetamask = require('~/brave/ui/app/ducks/metamask/metamask') const reduceLocale = require('./locale/locale') const reduceSend = require('./send/send.duck').default import reduceApp from './app/app' diff --git a/ui/app/ducks/locale/locale.js b/ui/app/ducks/locale/locale.js index 747e227ec..5e5aaf04f 100644 --- a/ui/app/ducks/locale/locale.js +++ b/ui/app/ducks/locale/locale.js @@ -1,5 +1,5 @@ const extend = require('xtend') -const actions = require('../../store/actions') +const actions = require('~/brave/ui/app/store/actions') module.exports = reduceMetamask diff --git a/ui/app/ducks/metamask/metamask.js b/ui/app/ducks/metamask/metamask.js index 5eb590231..a51dc22a2 100644 --- a/ui/app/ducks/metamask/metamask.js +++ b/ui/app/ducks/metamask/metamask.js @@ -1,5 +1,5 @@ const extend = require('xtend') -const actions = require('../../store/actions') +const actions = require('~/brave/ui/app/store/actions') const { getEnvironmentType } = require('../../../../app/scripts/lib/util') const { ENVIRONMENT_TYPE_POPUP } = require('../../../../app/scripts/lib/enums') const { OLD_UI_NETWORK_TYPE } = require('../../../../app/scripts/controllers/network/enums') diff --git a/ui/app/helpers/higher-order-components/authenticated/authenticated.component.js b/ui/app/helpers/higher-order-components/authenticated/authenticated.component.js index c195d0e21..c4651aff0 100644 --- a/ui/app/helpers/higher-order-components/authenticated/authenticated.component.js +++ b/ui/app/helpers/higher-order-components/authenticated/authenticated.component.js @@ -1,7 +1,7 @@ import React from 'react' import PropTypes from 'prop-types' import { Redirect, Route } from 'react-router-dom' -import { UNLOCK_ROUTE, INITIALIZE_ROUTE } from '../../constants/routes' +import { UNLOCK_ROUTE, INITIALIZE_ROUTE } from '~/brave/ui/app/helpers/constants/routes' export default function Authenticated (props) { const { isUnlocked, completedOnboarding } = props diff --git a/ui/app/helpers/higher-order-components/initialized/initialized.component.js b/ui/app/helpers/higher-order-components/initialized/initialized.component.js index 2042c0046..3925c9841 100644 --- a/ui/app/helpers/higher-order-components/initialized/initialized.component.js +++ b/ui/app/helpers/higher-order-components/initialized/initialized.component.js @@ -1,7 +1,7 @@ import React from 'react' import PropTypes from 'prop-types' import { Redirect, Route } from 'react-router-dom' -import { INITIALIZE_ROUTE } from '../../constants/routes' +import { INITIALIZE_ROUTE } from '~/brave/ui/app/helpers/constants/routes' export default function Initialized (props) { return props.completedOnboarding diff --git a/ui/app/helpers/higher-order-components/with-modal-props/with-modal-props.js b/ui/app/helpers/higher-order-components/with-modal-props/with-modal-props.js index aac6b5a61..45152bdf6 100644 --- a/ui/app/helpers/higher-order-components/with-modal-props/with-modal-props.js +++ b/ui/app/helpers/higher-order-components/with-modal-props/with-modal-props.js @@ -1,5 +1,5 @@ import { connect } from 'react-redux' -import { hideModal } from '../../../store/actions' +import { hideModal } from '~/brave/ui/app/store/actions' const mapStateToProps = state => { const { appState } = state diff --git a/ui/app/pages/add-token/add-token.component.js b/ui/app/pages/add-token/add-token.component.js index 40c1ff7fd..8ceb8393a 100644 --- a/ui/app/pages/add-token/add-token.component.js +++ b/ui/app/pages/add-token/add-token.component.js @@ -3,7 +3,7 @@ import PropTypes from 'prop-types' import ethUtil from 'ethereumjs-util' import { checkExistingAddresses } from './util' import { tokenInfoGetter } from '../../helpers/utils/token-util' -import { DEFAULT_ROUTE, CONFIRM_ADD_TOKEN_ROUTE } from '../../helpers/constants/routes' +import { DEFAULT_ROUTE, CONFIRM_ADD_TOKEN_ROUTE } from '~/brave/ui/app/helpers/constants/routes' import TextField from '../../components/ui/text-field' import TokenList from './token-list' import TokenSearch from './token-search' diff --git a/ui/app/pages/add-token/add-token.container.js b/ui/app/pages/add-token/add-token.container.js index eee16dfc7..81660207a 100644 --- a/ui/app/pages/add-token/add-token.container.js +++ b/ui/app/pages/add-token/add-token.container.js @@ -1,7 +1,7 @@ import { connect } from 'react-redux' import AddToken from './add-token.component' -const { setPendingTokens, clearPendingTokens } = require('../../store/actions') +const { setPendingTokens, clearPendingTokens } = require('~/brave/ui/app/store/actions') const mapStateToProps = ({ metamask }) => { const { identities, tokens, pendingTokens } = metamask diff --git a/ui/app/pages/confirm-add-suggested-token/confirm-add-suggested-token.component.js b/ui/app/pages/confirm-add-suggested-token/confirm-add-suggested-token.component.js index 04e9c8dcf..61a0de8e1 100644 --- a/ui/app/pages/confirm-add-suggested-token/confirm-add-suggested-token.component.js +++ b/ui/app/pages/confirm-add-suggested-token/confirm-add-suggested-token.component.js @@ -1,6 +1,6 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' -import { DEFAULT_ROUTE } from '../../helpers/constants/routes' +import { DEFAULT_ROUTE } from '~/brave/ui/app/helpers/constants/routes' import Button from '../../components/ui/button' import Identicon from '../../components/ui/identicon' import TokenBalance from '../../components/ui/token-balance' diff --git a/ui/app/pages/confirm-add-suggested-token/confirm-add-suggested-token.container.js b/ui/app/pages/confirm-add-suggested-token/confirm-add-suggested-token.container.js index cc73b2ea7..784bc27a6 100644 --- a/ui/app/pages/confirm-add-suggested-token/confirm-add-suggested-token.container.js +++ b/ui/app/pages/confirm-add-suggested-token/confirm-add-suggested-token.container.js @@ -5,7 +5,7 @@ import { withRouter } from 'react-router-dom' const extend = require('xtend') -const { addToken, removeSuggestedTokens } = require('../../store/actions') +const { addToken, removeSuggestedTokens } = require('~/brave/ui/app/store/actions') const mapStateToProps = ({ metamask }) => { const { pendingTokens, suggestedTokens } = metamask diff --git a/ui/app/pages/confirm-add-token/confirm-add-token.component.js b/ui/app/pages/confirm-add-token/confirm-add-token.component.js index d918d7e39..94c88c54c 100644 --- a/ui/app/pages/confirm-add-token/confirm-add-token.component.js +++ b/ui/app/pages/confirm-add-token/confirm-add-token.component.js @@ -1,6 +1,6 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' -import { DEFAULT_ROUTE, ADD_TOKEN_ROUTE } from '../../helpers/constants/routes' +import { DEFAULT_ROUTE, ADD_TOKEN_ROUTE } from '~/brave/ui/app/helpers/constants/routes' import Button from '../../components/ui/button' import Identicon from '../../components/ui/identicon' import TokenBalance from '../../components/ui/token-balance' diff --git a/ui/app/pages/confirm-add-token/confirm-add-token.container.js b/ui/app/pages/confirm-add-token/confirm-add-token.container.js index 961626177..73acd8448 100644 --- a/ui/app/pages/confirm-add-token/confirm-add-token.container.js +++ b/ui/app/pages/confirm-add-token/confirm-add-token.container.js @@ -1,7 +1,7 @@ import { connect } from 'react-redux' import ConfirmAddToken from './confirm-add-token.component' -const { addTokens, clearPendingTokens } = require('../../store/actions') +const { addTokens, clearPendingTokens } = require('~/brave/ui/app/store/actions') const mapStateToProps = ({ metamask }) => { const { pendingTokens } = metamask diff --git a/ui/app/pages/confirm-approve/confirm-approve.container.js b/ui/app/pages/confirm-approve/confirm-approve.container.js index 43f5aab90..967a96ddf 100644 --- a/ui/app/pages/confirm-approve/confirm-approve.container.js +++ b/ui/app/pages/confirm-approve/confirm-approve.container.js @@ -5,7 +5,7 @@ import { contractExchangeRateSelector, transactionFeeSelector, } from '../../selectors/confirm-transaction' -import { showModal } from '../../store/actions' +import { showModal } from '~/brave/ui/app/store/actions' import { tokenSelector } from '../../selectors/tokens' import { getTokenData, diff --git a/ui/app/pages/confirm-send-ether/confirm-send-ether.component.js b/ui/app/pages/confirm-send-ether/confirm-send-ether.component.js index 6bc252dbb..cda0d0f91 100644 --- a/ui/app/pages/confirm-send-ether/confirm-send-ether.component.js +++ b/ui/app/pages/confirm-send-ether/confirm-send-ether.component.js @@ -1,7 +1,7 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' import ConfirmTransactionBase from '../confirm-transaction-base' -import { SEND_ROUTE } from '../../helpers/constants/routes' +import { SEND_ROUTE } from '~/brave/ui/app/helpers/constants/routes' export default class ConfirmSendEther extends Component { static contextTypes = { diff --git a/ui/app/pages/confirm-send-ether/confirm-send-ether.container.js b/ui/app/pages/confirm-send-ether/confirm-send-ether.container.js index 713da702d..457d58c12 100644 --- a/ui/app/pages/confirm-send-ether/confirm-send-ether.container.js +++ b/ui/app/pages/confirm-send-ether/confirm-send-ether.container.js @@ -1,7 +1,7 @@ import { connect } from 'react-redux' import { compose } from 'recompose' import { withRouter } from 'react-router-dom' -import { updateSend } from '../../store/actions' +import { updateSend } from '~/brave/ui/app/store/actions' import { clearConfirmTransaction } from '../../ducks/confirm-transaction/confirm-transaction.duck' import ConfirmSendEther from './confirm-send-ether.component' diff --git a/ui/app/pages/confirm-send-token/confirm-send-token.component.js b/ui/app/pages/confirm-send-token/confirm-send-token.component.js index 7f3b1c082..62395d541 100644 --- a/ui/app/pages/confirm-send-token/confirm-send-token.component.js +++ b/ui/app/pages/confirm-send-token/confirm-send-token.component.js @@ -1,7 +1,7 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' import ConfirmTokenTransactionBase from '../confirm-token-transaction-base' -import { SEND_ROUTE } from '../../helpers/constants/routes' +import { SEND_ROUTE } from '~/brave/ui/app/helpers/constants/routes' export default class ConfirmSendToken extends Component { static propTypes = { diff --git a/ui/app/pages/confirm-send-token/confirm-send-token.container.js b/ui/app/pages/confirm-send-token/confirm-send-token.container.js index db9b08c48..4dc383942 100644 --- a/ui/app/pages/confirm-send-token/confirm-send-token.container.js +++ b/ui/app/pages/confirm-send-token/confirm-send-token.container.js @@ -3,7 +3,7 @@ import { compose } from 'recompose' import { withRouter } from 'react-router-dom' import ConfirmSendToken from './confirm-send-token.component' import { clearConfirmTransaction } from '../../ducks/confirm-transaction/confirm-transaction.duck' -import { setSelectedToken, updateSend, showSendTokenPage } from '../../store/actions' +import { setSelectedToken, updateSend, showSendTokenPage } from '~/brave/ui/app/store/actions' import { conversionUtil } from '../../helpers/utils/conversion-util' import { sendTokenTokenAmountAndToAddressSelector } from '../../selectors/confirm-transaction' diff --git a/ui/app/pages/confirm-transaction-base/confirm-transaction-base.component.js b/ui/app/pages/confirm-transaction-base/confirm-transaction-base.component.js index f67daca62..e0da03e9d 100644 --- a/ui/app/pages/confirm-transaction-base/confirm-transaction-base.component.js +++ b/ui/app/pages/confirm-transaction-base/confirm-transaction-base.component.js @@ -5,7 +5,7 @@ import { ENVIRONMENT_TYPE_NOTIFICATION } from '../../../../app/scripts/lib/enums import { getEnvironmentType } from '../../../../app/scripts/lib/util' import ConfirmPageContainer, { ConfirmDetailRow } from '../../components/app/confirm-page-container' import { isBalanceSufficient } from '../send/send.utils' -import { DEFAULT_ROUTE, CONFIRM_TRANSACTION_ROUTE } from '../../helpers/constants/routes' +import { DEFAULT_ROUTE, CONFIRM_TRANSACTION_ROUTE } from '~/brave/ui/app/helpers/constants/routes' import { INSUFFICIENT_FUNDS_ERROR_KEY, TRANSACTION_ERROR_KEY, diff --git a/ui/app/pages/confirm-transaction-base/confirm-transaction-base.container.js b/ui/app/pages/confirm-transaction-base/confirm-transaction-base.container.js index 139edbc02..a4006774a 100644 --- a/ui/app/pages/confirm-transaction-base/confirm-transaction-base.container.js +++ b/ui/app/pages/confirm-transaction-base/confirm-transaction-base.container.js @@ -18,7 +18,7 @@ import { updateTransaction, getNextNonce, tryReverseResolveAddress, -} from '../../store/actions' +} from '~/brave/ui/app/store/actions' import { INSUFFICIENT_FUNDS_ERROR_KEY, GAS_LIMIT_TOO_LOW_ERROR_KEY, diff --git a/ui/app/pages/confirm-transaction-switch/confirm-transaction-switch.component.js b/ui/app/pages/confirm-transaction-switch/confirm-transaction-switch.component.js index fc0606365..2f85fb661 100644 --- a/ui/app/pages/confirm-transaction-switch/confirm-transaction-switch.component.js +++ b/ui/app/pages/confirm-transaction-switch/confirm-transaction-switch.component.js @@ -11,7 +11,7 @@ import { CONFIRM_TRANSFER_FROM_PATH, CONFIRM_TOKEN_METHOD_PATH, SIGNATURE_REQUEST_PATH, -} from '../../helpers/constants/routes' +} from '~/brave/ui/app/helpers/constants/routes' import { TOKEN_METHOD_TRANSFER, TOKEN_METHOD_APPROVE, diff --git a/ui/app/pages/confirm-transaction/conf-tx.js b/ui/app/pages/confirm-transaction/conf-tx.js index ce1edde5c..920e3f498 100644 --- a/ui/app/pages/confirm-transaction/conf-tx.js +++ b/ui/app/pages/confirm-transaction/conf-tx.js @@ -4,7 +4,7 @@ const h = require('react-hyperscript') const connect = require('react-redux').connect const { withRouter } = require('react-router-dom') const { compose } = require('recompose') -const actions = require('../../store/actions') +const actions = require('~/brave/ui/app/store/actions') const txHelper = require('../../../lib/tx-helper') const log = require('loglevel') const R = require('ramda') @@ -12,7 +12,7 @@ const R = require('ramda') const SignatureRequest = require('../../components/app/signature-request').default const SignatureRequestOriginal = require('../../components/app/signature-request-original') const Loading = require('../../components/ui/loading-screen') -const { DEFAULT_ROUTE } = require('../../helpers/constants/routes') +const { DEFAULT_ROUTE } = require('~/brave/ui/app/helpers/constants/routes') module.exports = compose( withRouter, diff --git a/ui/app/pages/confirm-transaction/confirm-transaction.component.js b/ui/app/pages/confirm-transaction/confirm-transaction.component.js index 9cb69e0da..42d8121ba 100644 --- a/ui/app/pages/confirm-transaction/confirm-transaction.component.js +++ b/ui/app/pages/confirm-transaction/confirm-transaction.component.js @@ -20,7 +20,7 @@ import { CONFIRM_TRANSFER_FROM_PATH, CONFIRM_TOKEN_METHOD_PATH, SIGNATURE_REQUEST_PATH, -} from '../../helpers/constants/routes' +} from '~/brave/ui/app/helpers/constants/routes' export default class ConfirmTransaction extends Component { static contextTypes = { diff --git a/ui/app/pages/confirm-transaction/confirm-transaction.container.js b/ui/app/pages/confirm-transaction/confirm-transaction.container.js index 9a45c6405..c04446617 100644 --- a/ui/app/pages/confirm-transaction/confirm-transaction.container.js +++ b/ui/app/pages/confirm-transaction/confirm-transaction.container.js @@ -15,7 +15,7 @@ import { import { getContractMethodData, getTokenParams, -} from '../../store/actions' +} from '~/brave/ui/app/store/actions' import ConfirmTransaction from './confirm-transaction.component' import { unconfirmedTransactionsListSelector } from '../../selectors/confirm-transaction' diff --git a/ui/app/pages/create-account/connect-hardware/index.js b/ui/app/pages/create-account/connect-hardware/index.js index ff8506142..c0932f7cb 100644 --- a/ui/app/pages/create-account/connect-hardware/index.js +++ b/ui/app/pages/create-account/connect-hardware/index.js @@ -2,11 +2,11 @@ const { Component } = require('react') const PropTypes = require('prop-types') const h = require('react-hyperscript') const connect = require('react-redux').connect -const actions = require('../../../store/actions') +const actions = require('~/brave/ui/app/store/actions') const { getMetaMaskAccounts } = require('../../../selectors/selectors') -const ConnectScreen = require('./connect-screen') +const ConnectScreen = require('~/brave/ui/app/pages/create-account/connect-hardware/connect-screen') const AccountList = require('./account-list') -const { DEFAULT_ROUTE } = require('../../../helpers/constants/routes') +const { DEFAULT_ROUTE } = require('~/brave/ui/app/helpers/constants/routes') const { formatBalance } = require('../../../helpers/utils/util') class ConnectHardwareForm extends Component { diff --git a/ui/app/pages/create-account/create-account.component.js b/ui/app/pages/create-account/create-account.component.js index aa05af975..3f3ffd843 100644 --- a/ui/app/pages/create-account/create-account.component.js +++ b/ui/app/pages/create-account/create-account.component.js @@ -9,7 +9,7 @@ import { NEW_ACCOUNT_ROUTE, IMPORT_ACCOUNT_ROUTE, CONNECT_HARDWARE_ROUTE, -} from '../../helpers/constants/routes' +} from '~/brave/ui/app/helpers/constants/routes' export default class CreateAccountPage extends Component { renderTabs () { diff --git a/ui/app/pages/create-account/create-account.container.js b/ui/app/pages/create-account/create-account.container.js index 04205cfea..9c8745f15 100644 --- a/ui/app/pages/create-account/create-account.container.js +++ b/ui/app/pages/create-account/create-account.container.js @@ -1,5 +1,5 @@ import { connect } from 'react-redux' -import actions from '../../store/actions' +import actions from '~/brave/ui/app/store/actions' import { getCurrentViewContext } from '../../selectors/selectors' import CreateAccountPage from './create-account.component' diff --git a/ui/app/pages/create-account/import-account/index.js b/ui/app/pages/create-account/import-account/index.js index 48d8f8838..c77abb7d2 100644 --- a/ui/app/pages/create-account/import-account/index.js +++ b/ui/app/pages/create-account/import-account/index.js @@ -46,7 +46,7 @@ AccountImportSubview.prototype.render = function () { }, onClick: () => { global.platform.openWindow({ - url: 'https://metamask.zendesk.com/hc/en-us/articles/360015289932', + url: 'https://support.brave.com/hc/en-us/articles/360035488071-How-do-I-manage-my-Crypto-Wallets-', }) }, }, this.context.t('here')), diff --git a/ui/app/pages/create-account/import-account/json.js b/ui/app/pages/create-account/import-account/json.js index b0fb63dbf..fa5f32b8c 100644 --- a/ui/app/pages/create-account/import-account/json.js +++ b/ui/app/pages/create-account/import-account/json.js @@ -4,9 +4,9 @@ const h = require('react-hyperscript') const { withRouter } = require('react-router-dom') const { compose } = require('recompose') const connect = require('react-redux').connect -const actions = require('../../../store/actions') +const actions = require('~/brave/ui/app/store/actions') const FileInput = require('react-simple-file-input').default -const { DEFAULT_ROUTE } = require('../../../helpers/constants/routes') +const { DEFAULT_ROUTE } = require('~/brave/ui/app/helpers/constants/routes') const { getMetaMaskAccounts } = require('../../../selectors/selectors') import Button from '../../../components/ui/button' diff --git a/ui/app/pages/create-account/import-account/private-key.js b/ui/app/pages/create-account/import-account/private-key.js index 0cdf25ce9..2ca12f9e9 100644 --- a/ui/app/pages/create-account/import-account/private-key.js +++ b/ui/app/pages/create-account/import-account/private-key.js @@ -5,8 +5,8 @@ const { withRouter } = require('react-router-dom') const { compose } = require('recompose') const PropTypes = require('prop-types') const connect = require('react-redux').connect -const actions = require('../../../store/actions') -const { DEFAULT_ROUTE } = require('../../../helpers/constants/routes') +const actions = require('~/brave/ui/app/store/actions') +const { DEFAULT_ROUTE } = require('~/brave/ui/app/helpers/constants/routes') const { getMetaMaskAccounts } = require('../../../selectors/selectors') import Button from '../../../components/ui/button' diff --git a/ui/app/pages/create-account/new-account.component.js b/ui/app/pages/create-account/new-account.component.js index 6dc6419b5..fb46955c4 100644 --- a/ui/app/pages/create-account/new-account.component.js +++ b/ui/app/pages/create-account/new-account.component.js @@ -1,6 +1,6 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' -import { DEFAULT_ROUTE } from '../../helpers/constants/routes' +import { DEFAULT_ROUTE } from '~/brave/ui/app/helpers/constants/routes' import Button from '../../components/ui/button' export default class NewAccountCreateForm extends Component { diff --git a/ui/app/pages/create-account/new-account.container.js b/ui/app/pages/create-account/new-account.container.js index 9f3af5003..bb4817c40 100644 --- a/ui/app/pages/create-account/new-account.container.js +++ b/ui/app/pages/create-account/new-account.container.js @@ -1,5 +1,5 @@ import { connect } from 'react-redux' -import actions from '../../store/actions' +import actions from '~/brave/ui/app/store/actions' import NewAccountCreateForm from './new-account.component' const mapStateToProps = state => { diff --git a/ui/app/pages/first-time-flow/create-password/create-password.component.js b/ui/app/pages/first-time-flow/create-password/create-password.component.js index fbeb34d77..8be4be101 100644 --- a/ui/app/pages/first-time-flow/create-password/create-password.component.js +++ b/ui/app/pages/first-time-flow/create-password/create-password.component.js @@ -8,7 +8,7 @@ import { INITIALIZE_CREATE_PASSWORD_ROUTE, INITIALIZE_IMPORT_WITH_SEED_PHRASE_ROUTE, INITIALIZE_SEED_PHRASE_ROUTE, -} from '../../../helpers/constants/routes' +} from '~/brave/ui/app/helpers/constants/routes' export default class CreatePassword extends PureComponent { static propTypes = { diff --git a/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.component.js b/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.component.js index e1c0b21ed..f27f8f60a 100644 --- a/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.component.js +++ b/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.component.js @@ -6,7 +6,7 @@ import Button from '../../../../components/ui/button' import { INITIALIZE_SELECT_ACTION_ROUTE, INITIALIZE_END_OF_FLOW_ROUTE, -} from '../../../../helpers/constants/routes' +} from '~/brave/ui/app/helpers/constants/routes' export default class ImportWithSeedPhrase extends PureComponent { static contextTypes = { diff --git a/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.container.js b/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.container.js index 70360443c..13d4ff9ec 100644 --- a/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.container.js +++ b/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.container.js @@ -1,9 +1,9 @@ import { connect } from 'react-redux' -import ImportWithSeedPhrase from './import-with-seed-phrase.component' +import ImportWithSeedPhrase from '~/brave/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.component' import { setSeedPhraseBackedUp, initializeThreeBox, -} from '../../../../store/actions' +} from '~/brave/ui/app/store/actions' const mapDispatchToProps = dispatch => { return { diff --git a/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/tests/import-with-seed-phrase.component.test.js b/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/tests/import-with-seed-phrase.component.test.js index 7960d17b2..87290e5b4 100644 --- a/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/tests/import-with-seed-phrase.component.test.js +++ b/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/tests/import-with-seed-phrase.component.test.js @@ -2,7 +2,7 @@ import React from 'react' import assert from 'assert' import { shallow } from 'enzyme' import sinon from 'sinon' -import ImportWithSeedPhrase from '../import-with-seed-phrase.component' +import ImportWithSeedPhrase from '~/brave/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.component' function shallowRender (props = {}, context = {}) { return shallow(, { diff --git a/ui/app/pages/first-time-flow/create-password/new-account/index.js b/ui/app/pages/first-time-flow/create-password/new-account/index.js index 97db39cc3..f1749b83f 100644 --- a/ui/app/pages/first-time-flow/create-password/new-account/index.js +++ b/ui/app/pages/first-time-flow/create-password/new-account/index.js @@ -1 +1 @@ -export { default } from './new-account.component' +export { default } from '~/brave/ui/app/pages/first-time-flow/create-password/new-account/new-account.component' diff --git a/ui/app/pages/first-time-flow/create-password/new-account/new-account.component.js b/ui/app/pages/first-time-flow/create-password/new-account/new-account.component.js index de073af2f..24e71ba8b 100644 --- a/ui/app/pages/first-time-flow/create-password/new-account/new-account.component.js +++ b/ui/app/pages/first-time-flow/create-password/new-account/new-account.component.js @@ -5,7 +5,7 @@ import { INITIALIZE_SEED_PHRASE_ROUTE, INITIALIZE_IMPORT_WITH_SEED_PHRASE_ROUTE, INITIALIZE_SELECT_ACTION_ROUTE, -} from '../../../../helpers/constants/routes' +} from '~/brave/ui/app/helpers/constants/routes' import TextField from '../../../../components/ui/text-field' export default class NewAccount extends PureComponent { diff --git a/ui/app/pages/first-time-flow/create-password/unique-image/unique-image.component.js b/ui/app/pages/first-time-flow/create-password/unique-image/unique-image.component.js index 590cf0303..c202470a1 100644 --- a/ui/app/pages/first-time-flow/create-password/unique-image/unique-image.component.js +++ b/ui/app/pages/first-time-flow/create-password/unique-image/unique-image.component.js @@ -1,7 +1,7 @@ import React, { PureComponent } from 'react' import PropTypes from 'prop-types' import Button from '../../../../components/ui/button' -import { INITIALIZE_END_OF_FLOW_ROUTE } from '../../../../helpers/constants/routes' +import { INITIALIZE_END_OF_FLOW_ROUTE } from '~/brave/ui/app/helpers/constants/routes' export default class UniqueImageScreen extends PureComponent { static contextTypes = { diff --git a/ui/app/pages/first-time-flow/end-of-flow/end-of-flow.component.js b/ui/app/pages/first-time-flow/end-of-flow/end-of-flow.component.js index 8cbf4d69f..904fdf5b7 100644 --- a/ui/app/pages/first-time-flow/end-of-flow/end-of-flow.component.js +++ b/ui/app/pages/first-time-flow/end-of-flow/end-of-flow.component.js @@ -2,7 +2,7 @@ import React, { PureComponent } from 'react' import PropTypes from 'prop-types' import Button from '../../../components/ui/button' import MetaFoxLogo from '../../../components/ui/metafox-logo' -import { DEFAULT_ROUTE } from '../../../helpers/constants/routes' +import { DEFAULT_ROUTE } from '~/brave/ui/app/helpers/constants/routes' export default class EndOfFlowScreen extends PureComponent { static contextTypes = { @@ -50,7 +50,7 @@ export default class EndOfFlowScreen extends PureComponent {
{ '*' + t('endOfFlowMessage8') } diff --git a/ui/app/pages/first-time-flow/end-of-flow/end-of-flow.container.js b/ui/app/pages/first-time-flow/end-of-flow/end-of-flow.container.js index 38313806c..ad6991f13 100644 --- a/ui/app/pages/first-time-flow/end-of-flow/end-of-flow.container.js +++ b/ui/app/pages/first-time-flow/end-of-flow/end-of-flow.container.js @@ -1,6 +1,6 @@ import { connect } from 'react-redux' import EndOfFlow from './end-of-flow.component' -import { setCompletedOnboarding } from '../../../store/actions' +import { setCompletedOnboarding } from '~/brave/ui/app/store/actions' const firstTimeFlowTypeNameMap = { create: 'New Wallet Created', diff --git a/ui/app/pages/first-time-flow/first-time-flow-switch/first-time-flow-switch.component.js b/ui/app/pages/first-time-flow/first-time-flow-switch/first-time-flow-switch.component.js index 6bc89245b..24639b9df 100644 --- a/ui/app/pages/first-time-flow/first-time-flow-switch/first-time-flow-switch.component.js +++ b/ui/app/pages/first-time-flow/first-time-flow-switch/first-time-flow-switch.component.js @@ -7,7 +7,7 @@ import { INITIALIZE_WELCOME_ROUTE, INITIALIZE_UNLOCK_ROUTE, INITIALIZE_METAMETRICS_OPT_IN_ROUTE, -} from '../../../helpers/constants/routes' +} from '~/brave/ui/app/helpers/constants/routes' export default class FirstTimeFlowSwitch extends PureComponent { static propTypes = { diff --git a/ui/app/pages/first-time-flow/first-time-flow.component.js b/ui/app/pages/first-time-flow/first-time-flow.component.js index d77171f87..922f29d09 100644 --- a/ui/app/pages/first-time-flow/first-time-flow.component.js +++ b/ui/app/pages/first-time-flow/first-time-flow.component.js @@ -19,7 +19,7 @@ import { INITIALIZE_END_OF_FLOW_ROUTE, INITIALIZE_METAMETRICS_OPT_IN_ROUTE, INITIALIZE_BACKUP_SEED_PHRASE_ROUTE, -} from '../../helpers/constants/routes' +} from '~/brave/ui/app/helpers/constants/routes' export default class FirstTimeFlow extends PureComponent { static propTypes = { diff --git a/ui/app/pages/first-time-flow/first-time-flow.container.js b/ui/app/pages/first-time-flow/first-time-flow.container.js index ec9920d74..6975e4d01 100644 --- a/ui/app/pages/first-time-flow/first-time-flow.container.js +++ b/ui/app/pages/first-time-flow/first-time-flow.container.js @@ -6,10 +6,10 @@ import { createNewVaultAndRestore, unlockAndGetSeedPhrase, verifySeedPhrase, -} from '../../store/actions' +} from '~/brave/ui/app/store/actions' import { INITIALIZE_BACKUP_SEED_PHRASE_ROUTE, -} from '../../helpers/constants/routes' +} from '~/brave/ui/app/helpers/constants/routes' const mapStateToProps = (state, ownProps) => { const { metamask: { completedOnboarding, isInitialized, isUnlocked, seedPhraseBackedUp } } = state diff --git a/ui/app/pages/first-time-flow/first-time-flow.selectors.js b/ui/app/pages/first-time-flow/first-time-flow.selectors.js index e6cd5a84a..12a627dce 100644 --- a/ui/app/pages/first-time-flow/first-time-flow.selectors.js +++ b/ui/app/pages/first-time-flow/first-time-flow.selectors.js @@ -2,7 +2,7 @@ import { INITIALIZE_CREATE_PASSWORD_ROUTE, INITIALIZE_IMPORT_WITH_SEED_PHRASE_ROUTE, DEFAULT_ROUTE, -} from '../../helpers/constants/routes' +} from '~/brave/ui/app/helpers/constants/routes' const selectors = { getFirstTimeFlowTypeRoute, diff --git a/ui/app/pages/first-time-flow/metametrics-opt-in/metametrics-opt-in.container.js b/ui/app/pages/first-time-flow/metametrics-opt-in/metametrics-opt-in.container.js index 2566a2a56..1b4b4bc64 100644 --- a/ui/app/pages/first-time-flow/metametrics-opt-in/metametrics-opt-in.container.js +++ b/ui/app/pages/first-time-flow/metametrics-opt-in/metametrics-opt-in.container.js @@ -1,6 +1,6 @@ import { connect } from 'react-redux' import MetaMetricsOptIn from './metametrics-opt-in.component' -import { setParticipateInMetaMetrics } from '../../../store/actions' +import { setParticipateInMetaMetrics } from '~/brave/ui/app/store/actions' import { getFirstTimeFlowTypeRoute } from '../first-time-flow.selectors' const firstTimeFlowTypeNameMap = { diff --git a/ui/app/pages/first-time-flow/seed-phrase/confirm-seed-phrase/confirm-seed-phrase.component.js b/ui/app/pages/first-time-flow/seed-phrase/confirm-seed-phrase/confirm-seed-phrase.component.js index d6674c266..c68e4a0ba 100644 --- a/ui/app/pages/first-time-flow/seed-phrase/confirm-seed-phrase/confirm-seed-phrase.component.js +++ b/ui/app/pages/first-time-flow/seed-phrase/confirm-seed-phrase/confirm-seed-phrase.component.js @@ -7,7 +7,7 @@ import { INITIALIZE_END_OF_FLOW_ROUTE, INITIALIZE_SEED_PHRASE_ROUTE, DEFAULT_ROUTE, -} from '../../../../helpers/constants/routes' +} from '~/brave/ui/app/helpers/constants/routes' import { exportAsFile } from '../../../../helpers/utils/util' import DraggableSeed from './draggable-seed.component' diff --git a/ui/app/pages/first-time-flow/seed-phrase/confirm-seed-phrase/confirm-seed-phrase.container.js b/ui/app/pages/first-time-flow/seed-phrase/confirm-seed-phrase/confirm-seed-phrase.container.js index a78c65adc..1a5524974 100644 --- a/ui/app/pages/first-time-flow/seed-phrase/confirm-seed-phrase/confirm-seed-phrase.container.js +++ b/ui/app/pages/first-time-flow/seed-phrase/confirm-seed-phrase/confirm-seed-phrase.container.js @@ -1,10 +1,10 @@ import { connect } from 'react-redux' -import ConfirmSeedPhrase from './confirm-seed-phrase.component' +import ConfirmSeedPhrase from '~/brave/ui/app/pages/first-time-flow/seed-phrase/confirm-seed-phrase/confirm-seed-phrase.component' import { setSeedPhraseBackedUp, hideSeedPhraseBackupAfterOnboarding, initializeThreeBox, -} from '../../../../store/actions' +} from '~/brave/ui/app/store/actions' import { getSelectedAddress } from '../../../../selectors/selectors' const mapStateToProps = state => { diff --git a/ui/app/pages/first-time-flow/seed-phrase/reveal-seed-phrase/reveal-seed-phrase.component.js b/ui/app/pages/first-time-flow/seed-phrase/reveal-seed-phrase/reveal-seed-phrase.component.js index 4144fb878..be6f18563 100644 --- a/ui/app/pages/first-time-flow/seed-phrase/reveal-seed-phrase/reveal-seed-phrase.component.js +++ b/ui/app/pages/first-time-flow/seed-phrase/reveal-seed-phrase/reveal-seed-phrase.component.js @@ -3,7 +3,7 @@ import PropTypes from 'prop-types' import classnames from 'classnames' import LockIcon from '../../../../components/ui/lock-icon' import Button from '../../../../components/ui/button' -import { INITIALIZE_CONFIRM_SEED_PHRASE_ROUTE, DEFAULT_ROUTE } from '../../../../helpers/constants/routes' +import { INITIALIZE_CONFIRM_SEED_PHRASE_ROUTE, DEFAULT_ROUTE } from '~/brave/ui/app/helpers/constants/routes' import { exportAsFile } from '../../../../helpers/utils/util' export default class RevealSeedPhrase extends PureComponent { diff --git a/ui/app/pages/first-time-flow/seed-phrase/reveal-seed-phrase/reveal-seed-phrase.container.js b/ui/app/pages/first-time-flow/seed-phrase/reveal-seed-phrase/reveal-seed-phrase.container.js index 7ada36afc..228f87648 100644 --- a/ui/app/pages/first-time-flow/seed-phrase/reveal-seed-phrase/reveal-seed-phrase.container.js +++ b/ui/app/pages/first-time-flow/seed-phrase/reveal-seed-phrase/reveal-seed-phrase.container.js @@ -1,9 +1,9 @@ import { connect } from 'react-redux' -import RevealSeedPhrase from './reveal-seed-phrase.component' +import RevealSeedPhrase from '~/brave/ui/app/pages/first-time-flow/seed-phrase/reveal-seed-phrase/reveal-seed-phrase.component' import { setCompletedOnboarding, setSeedPhraseBackedUp, -} from '../../../../store/actions' +} from '~/brave/ui/app/store/actions' const mapDispatchToProps = dispatch => { return { diff --git a/ui/app/pages/first-time-flow/seed-phrase/seed-phrase.component.js b/ui/app/pages/first-time-flow/seed-phrase/seed-phrase.component.js index ae38757d9..3fb93f4c2 100644 --- a/ui/app/pages/first-time-flow/seed-phrase/seed-phrase.component.js +++ b/ui/app/pages/first-time-flow/seed-phrase/seed-phrase.component.js @@ -8,7 +8,7 @@ import { INITIALIZE_CONFIRM_SEED_PHRASE_ROUTE, INITIALIZE_BACKUP_SEED_PHRASE_ROUTE, DEFAULT_ROUTE, -} from '../../../helpers/constants/routes' +} from '~/brave/ui/app/helpers/constants/routes' import HTML5Backend from 'react-dnd-html5-backend' import {DragDropContextProvider} from 'react-dnd' import MetaFoxLogo from '../../../components/ui/metafox-logo' diff --git a/ui/app/pages/first-time-flow/seed-phrase/tests/confirm-seed-phrase-component.test.js b/ui/app/pages/first-time-flow/seed-phrase/tests/confirm-seed-phrase-component.test.js index b98c74751..6055b38ca 100644 --- a/ui/app/pages/first-time-flow/seed-phrase/tests/confirm-seed-phrase-component.test.js +++ b/ui/app/pages/first-time-flow/seed-phrase/tests/confirm-seed-phrase-component.test.js @@ -2,7 +2,7 @@ import React from 'react' import assert from 'assert' import { shallow } from 'enzyme' import sinon from 'sinon' -import ConfirmSeedPhrase from '../confirm-seed-phrase/confirm-seed-phrase.component' +import ConfirmSeedPhrase from '~/brave/ui/app/pages/first-time-flow/seed-phrase/confirm-seed-phrase/confirm-seed-phrase.component' function shallowRender (props = {}, context = {}) { return shallow( diff --git a/ui/app/pages/first-time-flow/select-action/select-action.component.js b/ui/app/pages/first-time-flow/select-action/select-action.component.js index 5379952f1..9955557cb 100644 --- a/ui/app/pages/first-time-flow/select-action/select-action.component.js +++ b/ui/app/pages/first-time-flow/select-action/select-action.component.js @@ -4,7 +4,7 @@ import Button from '../../../components/ui/button' import MetaFoxLogo from '../../../components/ui/metafox-logo' import { INITIALIZE_METAMETRICS_OPT_IN_ROUTE, -} from '../../../helpers/constants/routes' +} from '~/brave/ui/app/helpers/constants/routes' export default class SelectAction extends PureComponent { static propTypes = { diff --git a/ui/app/pages/first-time-flow/select-action/select-action.container.js b/ui/app/pages/first-time-flow/select-action/select-action.container.js index 9dc988430..dcaa5eae4 100644 --- a/ui/app/pages/first-time-flow/select-action/select-action.container.js +++ b/ui/app/pages/first-time-flow/select-action/select-action.container.js @@ -1,9 +1,9 @@ import { connect } from 'react-redux' import { withRouter } from 'react-router-dom' import { compose } from 'recompose' -import { setFirstTimeFlowType } from '../../../store/actions' +import { setFirstTimeFlowType } from '~/brave/ui/app/store/actions' import { getFirstTimeFlowTypeRoute } from '../first-time-flow.selectors' -import Welcome from './select-action.component' +import Welcome from '~/brave/ui/app/pages/first-time-flow/welcome/welcome.component' const mapStateToProps = (state) => { return { diff --git a/ui/app/pages/first-time-flow/welcome/welcome.component.js b/ui/app/pages/first-time-flow/welcome/welcome.component.js index c720d2572..44f8ccb48 100644 --- a/ui/app/pages/first-time-flow/welcome/welcome.component.js +++ b/ui/app/pages/first-time-flow/welcome/welcome.component.js @@ -1,9 +1,9 @@ import EventEmitter from 'events' import React, { PureComponent } from 'react' import PropTypes from 'prop-types' -import Mascot from '../../../components/ui/mascot' +import Mascot from '~/brave/ui/app/components/ui/mascot' import Button from '../../../components/ui/button' -import { INITIALIZE_CREATE_PASSWORD_ROUTE, INITIALIZE_SELECT_ACTION_ROUTE } from '../../../helpers/constants/routes' +import { INITIALIZE_CREATE_PASSWORD_ROUTE, INITIALIZE_SELECT_ACTION_ROUTE } from '~/brave/ui/app/helpers/constants/routes' export default class Welcome extends PureComponent { static propTypes = { diff --git a/ui/app/pages/first-time-flow/welcome/welcome.container.js b/ui/app/pages/first-time-flow/welcome/welcome.container.js index ce4b2b471..66f285986 100644 --- a/ui/app/pages/first-time-flow/welcome/welcome.container.js +++ b/ui/app/pages/first-time-flow/welcome/welcome.container.js @@ -1,8 +1,8 @@ import { connect } from 'react-redux' import { withRouter } from 'react-router-dom' import { compose } from 'recompose' -import { closeWelcomeScreen } from '../../../store/actions' -import Welcome from './welcome.component' +import { closeWelcomeScreen } from '~/brave/ui/app/store/actions' +import Welcome from '~/brave/ui/app/pages/first-time-flow/welcome/welcome.component' const mapStateToProps = ({ metamask }) => { const { welcomeScreenSeen, isInitialized, participateInMetaMetrics } = metamask diff --git a/ui/app/pages/home/home.component.js b/ui/app/pages/home/home.component.js index e51c82177..72619c792 100644 --- a/ui/app/pages/home/home.component.js +++ b/ui/app/pages/home/home.component.js @@ -15,7 +15,7 @@ import { CONFIRM_TRANSACTION_ROUTE, CONFIRM_ADD_SUGGESTED_TOKEN_ROUTE, INITIALIZE_BACKUP_SEED_PHRASE_ROUTE, -} from '../../helpers/constants/routes' +} from '~/brave/ui/app/helpers/constants/routes' export default class Home extends PureComponent { static contextTypes = { diff --git a/ui/app/pages/home/home.container.js b/ui/app/pages/home/home.container.js index 4a2106a55..e455828d1 100644 --- a/ui/app/pages/home/home.container.js +++ b/ui/app/pages/home/home.container.js @@ -10,7 +10,7 @@ import { turnThreeBoxSyncingOn, getThreeBoxLastUpdated, setShowRestorePromptToFalse, -} from '../../store/actions' +} from '~/brave/ui/app/store/actions' import { setThreeBoxLastUpdated } from '../../ducks/app/app' import { getEnvironmentType } from '../../../../app/scripts/lib/util' import { ENVIRONMENT_TYPE_POPUP } from '../../../../app/scripts/lib/enums' diff --git a/ui/app/pages/index.js b/ui/app/pages/index.js index 56fc4af04..efc9b0368 100644 --- a/ui/app/pages/index.js +++ b/ui/app/pages/index.js @@ -2,7 +2,7 @@ import React, { Component } from 'react' const PropTypes = require('prop-types') const { Provider } = require('react-redux') const { HashRouter } = require('react-router-dom') -const Routes = require('./routes') +const Routes = require('~/brave/ui/app/pages/routes') const I18nProvider = require('../helpers/higher-order-components/i18n-provider') const MetaMetricsProvider = require('../helpers/higher-order-components/metametrics/metametrics.provider') diff --git a/ui/app/pages/keychains/restore-vault.js b/ui/app/pages/keychains/restore-vault.js index 93c2975bb..51694f876 100644 --- a/ui/app/pages/keychains/restore-vault.js +++ b/ui/app/pages/keychains/restore-vault.js @@ -5,8 +5,8 @@ import { createNewVaultAndRestore, unMarkPasswordForgotten, initializeThreeBox, -} from '../../store/actions' -import { DEFAULT_ROUTE } from '../../helpers/constants/routes' +} from '~/brave/ui/app/store/actions' +import { DEFAULT_ROUTE } from '~/brave/ui/app/helpers/constants/routes' import TextField from '../../components/ui/text-field' import Button from '../../components/ui/button' diff --git a/ui/app/pages/keychains/reveal-seed.js b/ui/app/pages/keychains/reveal-seed.js index e83e3fd98..fa3011d5d 100644 --- a/ui/app/pages/keychains/reveal-seed.js +++ b/ui/app/pages/keychains/reveal-seed.js @@ -4,8 +4,8 @@ const PropTypes = require('prop-types') const h = require('react-hyperscript') const classnames = require('classnames') -const { requestRevealSeedWords } = require('../../store/actions') -const { DEFAULT_ROUTE } = require('../../helpers/constants/routes') +const { requestRevealSeedWords } = require('~/brave/ui/app/store/actions') +const { DEFAULT_ROUTE } = require('~/brave/ui/app/helpers/constants/routes') const ExportTextContainer = require('../../components/ui/export-text-container') import Button from '../../components/ui/button' diff --git a/ui/app/pages/lock/lock.component.js b/ui/app/pages/lock/lock.component.js index 1145158c5..08352c244 100644 --- a/ui/app/pages/lock/lock.component.js +++ b/ui/app/pages/lock/lock.component.js @@ -1,7 +1,7 @@ import React, { PureComponent } from 'react' import PropTypes from 'prop-types' import Loading from '../../components/ui/loading-screen' -import { DEFAULT_ROUTE } from '../../helpers/constants/routes' +import { DEFAULT_ROUTE } from '~/brave/ui/app/helpers/constants/routes' export default class Lock extends PureComponent { static propTypes = { diff --git a/ui/app/pages/lock/lock.container.js b/ui/app/pages/lock/lock.container.js index 6a20b6ed1..2e718fe3c 100644 --- a/ui/app/pages/lock/lock.container.js +++ b/ui/app/pages/lock/lock.container.js @@ -2,7 +2,7 @@ import Lock from './lock.component' import { compose } from 'recompose' import { connect } from 'react-redux' import { withRouter } from 'react-router-dom' -import { lockMetamask } from '../../store/actions' +import { lockMetamask } from '~/brave/ui/app/store/actions' const mapStateToProps = state => { const { metamask: { isUnlocked } } = state diff --git a/ui/app/pages/mobile-sync/index.js b/ui/app/pages/mobile-sync/index.js index bd2385808..24380c99d 100644 --- a/ui/app/pages/mobile-sync/index.js +++ b/ui/app/pages/mobile-sync/index.js @@ -5,9 +5,9 @@ const h = require('react-hyperscript') const classnames = require('classnames') const PubNub = require('pubnub') -const { requestRevealSeedWords, fetchInfoToSync } = require('../../store/actions') -const { DEFAULT_ROUTE } = require('../../helpers/constants/routes') -const actions = require('../../store/actions') +const { requestRevealSeedWords, fetchInfoToSync } = require('~/brave/ui/app/store/actions') +const { DEFAULT_ROUTE } = require('~/brave/ui/app/helpers/constants/routes') +const actions = require('~/brave/ui/app/store/actions') const qrCode = require('qrcode-generator') diff --git a/ui/app/pages/provider-approval/provider-approval.container.js b/ui/app/pages/provider-approval/provider-approval.container.js index 1e167ddb7..ef574cfc7 100644 --- a/ui/app/pages/provider-approval/provider-approval.container.js +++ b/ui/app/pages/provider-approval/provider-approval.container.js @@ -1,6 +1,6 @@ import { connect } from 'react-redux' import ProviderApproval from './provider-approval.component' -import { approveProviderRequestByOrigin, rejectProviderRequestByOrigin } from '../../store/actions' +import { approveProviderRequestByOrigin, rejectProviderRequestByOrigin } from '~/brave/ui/app/store/actions' function mapDispatchToProps (dispatch) { return { diff --git a/ui/app/pages/routes/index.js b/ui/app/pages/routes/index.js index 01e61b1b4..643550a19 100644 --- a/ui/app/pages/routes/index.js +++ b/ui/app/pages/routes/index.js @@ -3,7 +3,7 @@ import PropTypes from 'prop-types' import { connect } from 'react-redux' import { Route, Switch, withRouter, matchPath } from 'react-router-dom' import { compose } from 'recompose' -import actions from '../../store/actions' +import actions from '~/brave/ui/app/store/actions' import log from 'loglevel' import IdleTimer from 'react-idle-timer' import {getNetworkIdentifier, preferencesSelector} from '../../selectors/selectors' @@ -20,12 +20,12 @@ const Sidebar = require('../../components/app/sidebars').default const { WALLET_VIEW_SIDEBAR } = require('../../components/app/sidebars/sidebar.constants') // other views -import Home from '../home' +import Home from '~/brave/ui/app/pages/home' import Settings from '../settings' import Authenticated from '../../helpers/higher-order-components/authenticated' import Initialized from '../../helpers/higher-order-components/initialized' import Lock from '../lock' -const RestoreVaultPage = require('../keychains/restore-vault').default +const RestoreVaultPage = require('~/brave/ui/app/pages/keychains/restore-vault').default const RevealSeedConfirmation = require('../keychains/reveal-seed') const MobileSyncPage = require('../mobile-sync') const AddTokenPage = require('../add-token') @@ -67,7 +67,7 @@ import { CONFIRM_TRANSACTION_ROUTE, INITIALIZE_ROUTE, INITIALIZE_UNLOCK_ROUTE, -} from '../../helpers/constants/routes' +} from '~/brave/ui/app/helpers/constants/routes' // enums import { diff --git a/ui/app/pages/send/send-content/add-recipient/add-recipient.container.js b/ui/app/pages/send/send-content/add-recipient/add-recipient.container.js index eb980aa82..8ccb05058 100644 --- a/ui/app/pages/send/send-content/add-recipient/add-recipient.container.js +++ b/ui/app/pages/send/send-content/add-recipient/add-recipient.container.js @@ -10,7 +10,7 @@ import { } from '../../../../selectors/selectors' import { updateSendTo, -} from '../../../../store/actions' +} from '~/brave/ui/app/store/actions' import AddRecipient from './add-recipient.component' export default connect(mapStateToProps, mapDispatchToProps)(AddRecipient) diff --git a/ui/app/pages/send/send-content/add-recipient/tests/add-recipient-container.test.js b/ui/app/pages/send/send-content/add-recipient/tests/add-recipient-container.test.js index 5ca0b2c23..15698c2bd 100644 --- a/ui/app/pages/send/send-content/add-recipient/tests/add-recipient-container.test.js +++ b/ui/app/pages/send/send-content/add-recipient/tests/add-recipient-container.test.js @@ -26,7 +26,7 @@ proxyquire('../add-recipient.container.js', { getAddressBook: (s) => [{ name: `mockAddressBook:${s}` }], getAddressBookEntry: (s) => `mockAddressBookEntry:${s}`, }, - '../../../../store/actions': actionSpies, + '~/brave/ui/app/store/actions': actionSpies, }) describe('add-recipient container', () => { diff --git a/ui/app/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.container.js b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.container.js index e444589a1..93c3d0f13 100644 --- a/ui/app/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.container.js +++ b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.container.js @@ -11,7 +11,7 @@ import { calcMaxAmount } from './amount-max-button.utils.js' import { updateSendAmount, setMaxModeTo, -} from '../../../../../store/actions' +} from '~/brave/ui/app/store/actions' import AmountMaxButton from './amount-max-button.component' import { updateSendErrors, diff --git a/ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-container.test.js b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-container.test.js index dcee8fda0..02fe60d54 100644 --- a/ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-container.test.js +++ b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-container.test.js @@ -30,7 +30,7 @@ proxyquire('../amount-max-button.container.js', { './amount-max-button.selectors.js': { getMaxModeOn: (s) => `mockMaxModeOn:${s}` }, './amount-max-button.utils.js': { calcMaxAmount: (mockObj) => mockObj.val + 1 }, '../../../../../selectors/custom-gas': { getBasicGasEstimateLoadingStatus: (s) => `mockButtonDataLoading:${s}`}, - '../../../../../store/actions': actionSpies, + '~/brave/ui/app/store/actions': actionSpies, '../../../../../ducks/send/send.duck': duckActionSpies, }) diff --git a/ui/app/pages/send/send-content/send-amount-row/send-amount-row.container.js b/ui/app/pages/send/send-content/send-amount-row/send-amount-row.container.js index 2b3470da4..993eae38c 100644 --- a/ui/app/pages/send/send-content/send-amount-row/send-amount-row.container.js +++ b/ui/app/pages/send/send-content/send-amount-row/send-amount-row.container.js @@ -17,7 +17,7 @@ import { getAmountErrorObject, getGasFeeErrorObject } from '../../send.utils' import { setMaxModeTo, updateSendAmount, -} from '../../../../store/actions' +} from '~/brave/ui/app/store/actions' import { updateSendErrors, } from '../../../../ducks/send/send.duck' diff --git a/ui/app/pages/send/send-content/send-amount-row/tests/send-amount-row-container.test.js b/ui/app/pages/send/send-content/send-amount-row/tests/send-amount-row-container.test.js index dada1c5e9..0d66ce765 100644 --- a/ui/app/pages/send/send-content/send-amount-row/tests/send-amount-row-container.test.js +++ b/ui/app/pages/send/send-content/send-amount-row/tests/send-amount-row-container.test.js @@ -37,7 +37,7 @@ proxyquire('../send-amount-row.container.js', { getAmountErrorObject: (mockDataObject) => ({ ...mockDataObject, mockChange: true }), getGasFeeErrorObject: (mockDataObject) => ({ ...mockDataObject, mockGasFeeErrorChange: true }), }, - '../../../../store/actions': actionSpies, + '~/brave/ui/app/store/actions': actionSpies, '../../../../ducks/send/send.duck': duckActionSpies, }) diff --git a/ui/app/pages/send/send-content/send-asset-row/send-asset-row.container.js b/ui/app/pages/send/send-content/send-asset-row/send-asset-row.container.js index 57b62fba1..0fa1edfe8 100644 --- a/ui/app/pages/send/send-content/send-asset-row/send-asset-row.container.js +++ b/ui/app/pages/send/send-content/send-asset-row/send-asset-row.container.js @@ -1,7 +1,7 @@ import { connect } from 'react-redux' import SendAssetRow from './send-asset-row.component' import {getMetaMaskAccounts} from '../../../../selectors/selectors' -import { setSelectedToken } from '../../../../store/actions' +import { setSelectedToken } from '~/brave/ui/app/store/actions' function mapStateToProps (state) { return { diff --git a/ui/app/pages/send/send-content/send-content.container.js b/ui/app/pages/send/send-content/send-content.container.js index a122aca1a..7f286705d 100644 --- a/ui/app/pages/send/send-content/send-content.container.js +++ b/ui/app/pages/send/send-content/send-content.container.js @@ -7,7 +7,7 @@ import { import { getAddressBookEntry, } from '../../../selectors/selectors' -import actions from '../../../store/actions' +import actions from '~/brave/ui/app/store/actions' function mapStateToProps (state) { const ownedAccounts = accountsWithSendEtherInfoSelector(state) diff --git a/ui/app/pages/send/send-content/send-gas-row/send-gas-row.container.js b/ui/app/pages/send/send-content/send-gas-row/send-gas-row.container.js index 10eaa50b8..d8cc576ec 100644 --- a/ui/app/pages/send/send-content/send-gas-row/send-gas-row.container.js +++ b/ui/app/pages/send/send-content/send-gas-row/send-gas-row.container.js @@ -32,7 +32,7 @@ import { setCustomGasLimit, } from '../../../../ducks/gas/gas.duck' import { getGasLoadingError, gasFeeIsInError, getGasButtonGroupShown } from './send-gas-row.selectors.js' -import { showModal, setGasPrice, setGasLimit, setGasTotal, updateSendAmount } from '../../../../store/actions' +import { showModal, setGasPrice, setGasLimit, setGasTotal, updateSendAmount } from '~/brave/ui/app/store/actions' import { getAdvancedInlineGasShown, getCurrentEthBalance, getSelectedToken } from '../../../../selectors/selectors' import SendGasRow from './send-gas-row.component' diff --git a/ui/app/pages/send/send-content/send-gas-row/tests/send-gas-row-container.test.js b/ui/app/pages/send/send-content/send-gas-row/tests/send-gas-row-container.test.js index 4acb310f8..56af21f8b 100644 --- a/ui/app/pages/send/send-content/send-gas-row/tests/send-gas-row-container.test.js +++ b/ui/app/pages/send/send-content/send-gas-row/tests/send-gas-row-container.test.js @@ -64,7 +64,7 @@ proxyquire('../send-gas-row.container.js', { gasFeeIsInError: (s) => `mockGasFeeError:${s}`, getGasButtonGroupShown: (s) => `mockGetGasButtonGroupShown:${s}`, }, - '../../../../store/actions': actionSpies, + '~/brave/ui/app/store/actions': actionSpies, '../../../../selectors/custom-gas': { getBasicGasEstimateLoadingStatus: (s) => `mockBasicGasEstimateLoadingStatus:${s}`, getRenderableEstimateDataForSmallButtonsFromGWEI: (s) => `mockGasButtonInfo:${s}`, diff --git a/ui/app/pages/send/send-content/send-hex-data-row/send-hex-data-row.container.js b/ui/app/pages/send/send-content/send-hex-data-row/send-hex-data-row.container.js index 8b1c540c3..a4c84a160 100644 --- a/ui/app/pages/send/send-content/send-hex-data-row/send-hex-data-row.container.js +++ b/ui/app/pages/send/send-content/send-hex-data-row/send-hex-data-row.container.js @@ -1,7 +1,7 @@ import { connect } from 'react-redux' import { updateSendHexData, -} from '../../../../store/actions' +} from '~/brave/ui/app/store/actions' import SendHexDataRow from './send-hex-data-row.component' export default connect(mapStateToProps, mapDispatchToProps)(SendHexDataRow) diff --git a/ui/app/pages/send/send-footer/send-footer.component.js b/ui/app/pages/send/send-footer/send-footer.component.js index 20ab50c3c..a2907d86d 100644 --- a/ui/app/pages/send/send-footer/send-footer.component.js +++ b/ui/app/pages/send/send-footer/send-footer.component.js @@ -1,7 +1,7 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' import PageContainerFooter from '../../../components/ui/page-container/page-container-footer' -import { CONFIRM_TRANSACTION_ROUTE, DEFAULT_ROUTE } from '../../../helpers/constants/routes' +import { CONFIRM_TRANSACTION_ROUTE, DEFAULT_ROUTE } from '~/brave/ui/app/helpers/constants/routes' export default class SendFooter extends Component { diff --git a/ui/app/pages/send/send-footer/send-footer.container.js b/ui/app/pages/send/send-footer/send-footer.container.js index 52348ca89..21a17d330 100644 --- a/ui/app/pages/send/send-footer/send-footer.container.js +++ b/ui/app/pages/send/send-footer/send-footer.container.js @@ -6,7 +6,7 @@ import { signTokenTx, signTx, updateTransaction, -} from '../../../store/actions' +} from '~/brave/ui/app/store/actions' import SendFooter from './send-footer.component' import { getGasLimit, diff --git a/ui/app/pages/send/send-footer/tests/send-footer-component.test.js b/ui/app/pages/send/send-footer/tests/send-footer-component.test.js index 4f35e1b25..284172661 100644 --- a/ui/app/pages/send/send-footer/tests/send-footer-component.test.js +++ b/ui/app/pages/send/send-footer/tests/send-footer-component.test.js @@ -2,7 +2,7 @@ import React from 'react' import assert from 'assert' import { shallow } from 'enzyme' import sinon from 'sinon' -import { CONFIRM_TRANSACTION_ROUTE, DEFAULT_ROUTE } from '../../../../helpers/constants/routes' +import { CONFIRM_TRANSACTION_ROUTE, DEFAULT_ROUTE } from '~/brave/ui/app/helpers/constants/routes' import SendFooter from '../send-footer.component.js' import PageContainerFooter from '../../../../components/ui/page-container/page-container-footer' diff --git a/ui/app/pages/send/send-footer/tests/send-footer-container.test.js b/ui/app/pages/send/send-footer/tests/send-footer-container.test.js index 70bc078c8..0da5fc2c5 100644 --- a/ui/app/pages/send/send-footer/tests/send-footer-container.test.js +++ b/ui/app/pages/send/send-footer/tests/send-footer-container.test.js @@ -26,7 +26,7 @@ proxyquire('../send-footer.container.js', { return () => ({}) }, }, - '../../../store/actions': actionSpies, + '~/brave/ui/app/store/actions': actionSpies, '../send.selectors': { getGasLimit: (s) => `mockGasLimit:${s}`, getGasPrice: (s) => `mockGasPrice:${s}`, diff --git a/ui/app/pages/send/send-header/send-header.component.js b/ui/app/pages/send/send-header/send-header.component.js index c4c4f866d..c378a0803 100644 --- a/ui/app/pages/send/send-header/send-header.component.js +++ b/ui/app/pages/send/send-header/send-header.component.js @@ -1,7 +1,7 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' import PageContainerHeader from '../../../components/ui/page-container/page-container-header' -import { DEFAULT_ROUTE } from '../../../helpers/constants/routes' +import { DEFAULT_ROUTE } from '~/brave/ui/app/helpers/constants/routes' export default class SendHeader extends Component { diff --git a/ui/app/pages/send/send-header/send-header.container.js b/ui/app/pages/send/send-header/send-header.container.js index 7d57a71e9..bdd133c92 100644 --- a/ui/app/pages/send/send-header/send-header.container.js +++ b/ui/app/pages/send/send-header/send-header.container.js @@ -1,5 +1,5 @@ import { connect } from 'react-redux' -import { clearSend } from '../../../store/actions' +import { clearSend } from '~/brave/ui/app/store/actions' import SendHeader from './send-header.component' import { getTitleKey } from './send-header.selectors' diff --git a/ui/app/pages/send/send-header/tests/send-header-component.test.js b/ui/app/pages/send/send-header/tests/send-header-component.test.js index 6c24c24fa..ff98431d6 100644 --- a/ui/app/pages/send/send-header/tests/send-header-component.test.js +++ b/ui/app/pages/send/send-header/tests/send-header-component.test.js @@ -2,7 +2,7 @@ import React from 'react' import assert from 'assert' import { shallow } from 'enzyme' import sinon from 'sinon' -import { DEFAULT_ROUTE } from '../../../../helpers/constants/routes' +import { DEFAULT_ROUTE } from '~/brave/ui/app/helpers/constants/routes' import SendHeader from '../send-header.component.js' import PageContainerHeader from '../../../../components/ui/page-container/page-container-header' diff --git a/ui/app/pages/send/send-header/tests/send-header-container.test.js b/ui/app/pages/send/send-header/tests/send-header-container.test.js index 0ff7491f0..a8b46cb70 100644 --- a/ui/app/pages/send/send-header/tests/send-header-container.test.js +++ b/ui/app/pages/send/send-header/tests/send-header-container.test.js @@ -17,7 +17,7 @@ proxyquire('../send-header.container.js', { return () => ({}) }, }, - '../../../store/actions': actionSpies, + '~/brave/ui/app/store/actions': actionSpies, './send-header.selectors': { getTitleKey: (s) => `mockTitleKey:${s}`, }, diff --git a/ui/app/pages/send/send.container.js b/ui/app/pages/send/send.container.js index 2350712f3..c248e5471 100644 --- a/ui/app/pages/send/send.container.js +++ b/ui/app/pages/send/send.container.js @@ -43,7 +43,7 @@ import { qrCodeDetected, updateSendEnsResolution, updateSendEnsResolutionError, -} from '../../store/actions' +} from '~/brave/ui/app/store/actions' import { resetSendState, updateSendErrors, @@ -60,7 +60,7 @@ import { import { SEND_ROUTE, -} from '../../helpers/constants/routes' +} from '~/brave/ui/app/helpers/constants/routes' function mapStateToProps (state) { return { diff --git a/ui/app/pages/send/tests/send-container.test.js b/ui/app/pages/send/tests/send-container.test.js index f4142bc2d..617c61659 100644 --- a/ui/app/pages/send/tests/send-container.test.js +++ b/ui/app/pages/send/tests/send-container.test.js @@ -56,7 +56,7 @@ proxyquire('../send.container.js', { getAddressBook: (s) => `mockAddressBook:${s}`, getSelectedAddress: (s) => `mockSelectedAddress:${s}`, }, - '../../store/actions': actionSpies, + '~/brave/ui/app/store/actions': actionSpies, '../../ducks/send/send.duck': duckActionSpies, './send.utils.js': { calcGasTotal: (gasLimit, gasPrice) => gasLimit + gasPrice, diff --git a/ui/app/pages/settings/advanced-tab/advanced-tab.component.js b/ui/app/pages/settings/advanced-tab/advanced-tab.component.js index 62c153584..b51fe3d96 100644 --- a/ui/app/pages/settings/advanced-tab/advanced-tab.component.js +++ b/ui/app/pages/settings/advanced-tab/advanced-tab.component.js @@ -5,7 +5,7 @@ import { exportAsFile } from '../../../helpers/utils/util' import ToggleButton from '../../../components/ui/toggle-button' import TextField from '../../../components/ui/text-field' import Button from '../../../components/ui/button' -import { MOBILE_SYNC_ROUTE } from '../../../helpers/constants/routes' +import { MOBILE_SYNC_ROUTE } from '~/brave/ui/app/helpers/constants/routes' export default class AdvancedTab extends PureComponent { static contextTypes = { diff --git a/ui/app/pages/settings/advanced-tab/advanced-tab.container.js b/ui/app/pages/settings/advanced-tab/advanced-tab.container.js index 4f41cb536..ede731bf2 100644 --- a/ui/app/pages/settings/advanced-tab/advanced-tab.container.js +++ b/ui/app/pages/settings/advanced-tab/advanced-tab.container.js @@ -1,4 +1,4 @@ -import AdvancedTab from './advanced-tab.component' +import AdvancedTab from '~/brave/ui/app/pages/settings/advanced-tab/advanced-tab.component' import { compose } from 'recompose' import { connect } from 'react-redux' import { withRouter } from 'react-router-dom' @@ -13,7 +13,7 @@ import { turnThreeBoxSyncingOnAndInitialize, setUseIn3, setUseNonceField, -} from '../../../store/actions' +} from '~/brave/ui/app/store/actions' import {preferencesSelector} from '../../../selectors/selectors' export const mapStateToProps = state => { diff --git a/ui/app/pages/settings/advanced-tab/tests/advanced-tab-component.test.js b/ui/app/pages/settings/advanced-tab/tests/advanced-tab-component.test.js index 15e5306c2..418d189f2 100644 --- a/ui/app/pages/settings/advanced-tab/tests/advanced-tab-component.test.js +++ b/ui/app/pages/settings/advanced-tab/tests/advanced-tab-component.test.js @@ -2,7 +2,7 @@ import React from 'react' import assert from 'assert' import sinon from 'sinon' import { shallow } from 'enzyme' -import AdvancedTab from '../advanced-tab.component' +import AdvancedTab from '~/brave/ui/app/pages/settings/advanced-tab/advanced-tab.component' import TextField from '../../../../components/ui/text-field' describe('AdvancedTab Component', () => { diff --git a/ui/app/pages/settings/connections-tab/connections-tab.container.js b/ui/app/pages/settings/connections-tab/connections-tab.container.js index cf3efc2b4..6008e3d2e 100644 --- a/ui/app/pages/settings/connections-tab/connections-tab.container.js +++ b/ui/app/pages/settings/connections-tab/connections-tab.container.js @@ -6,7 +6,7 @@ import { approveProviderRequestByOrigin, rejectProviderRequestByOrigin, showModal, -} from '../../../store/actions' +} from '~/brave/ui/app/store/actions' export const mapStateToProps = state => { const { diff --git a/ui/app/pages/settings/contact-list-tab/add-contact/add-contact.component.js b/ui/app/pages/settings/contact-list-tab/add-contact/add-contact.component.js index 56d4415cf..b93a83823 100644 --- a/ui/app/pages/settings/contact-list-tab/add-contact/add-contact.component.js +++ b/ui/app/pages/settings/contact-list-tab/add-contact/add-contact.component.js @@ -2,7 +2,7 @@ import React, { PureComponent } from 'react' import PropTypes from 'prop-types' import Identicon from '../../../../components/ui/identicon' import TextField from '../../../../components/ui/text-field' -import { CONTACT_LIST_ROUTE } from '../../../../helpers/constants/routes' +import { CONTACT_LIST_ROUTE } from '~/brave/ui/app/helpers/constants/routes' import { isValidAddress, isValidENSAddress } from '../../../../helpers/utils/util' import EnsInput from '../../../../pages/send/send-content/add-recipient/ens-input' import PageContainerFooter from '../../../../components/ui/page-container/page-container-footer' diff --git a/ui/app/pages/settings/contact-list-tab/add-contact/add-contact.container.js b/ui/app/pages/settings/contact-list-tab/add-contact/add-contact.container.js index 0a0fc450c..c5879c3c8 100644 --- a/ui/app/pages/settings/contact-list-tab/add-contact/add-contact.container.js +++ b/ui/app/pages/settings/contact-list-tab/add-contact/add-contact.container.js @@ -2,10 +2,10 @@ import AddContact from './add-contact.component' import { compose } from 'recompose' import { connect } from 'react-redux' import { withRouter } from 'react-router-dom' -import { addToAddressBook, showQrScanner, qrCodeDetected } from '../../../../store/actions' +import { addToAddressBook, showQrScanner, qrCodeDetected } from '~/brave/ui/app/store/actions' import { CONTACT_ADD_ROUTE, -} from '../../../../helpers/constants/routes' +} from '~/brave/ui/app/helpers/constants/routes' import { getQrCodeData, } from '../../../../pages/send/send.selectors' diff --git a/ui/app/pages/settings/contact-list-tab/contact-list-tab.component.js b/ui/app/pages/settings/contact-list-tab/contact-list-tab.component.js index f7a01d672..70d79ed92 100644 --- a/ui/app/pages/settings/contact-list-tab/contact-list-tab.component.js +++ b/ui/app/pages/settings/contact-list-tab/contact-list-tab.component.js @@ -9,7 +9,7 @@ import { CONTACT_ADD_ROUTE, CONTACT_VIEW_ROUTE, CONTACT_MY_ACCOUNTS_ROUTE, -} from '../../../helpers/constants/routes' +} from '~/brave/ui/app/helpers/constants/routes' export default class ContactListTab extends Component { static contextTypes = { diff --git a/ui/app/pages/settings/contact-list-tab/contact-list-tab.container.js b/ui/app/pages/settings/contact-list-tab/contact-list-tab.container.js index 2c7139b5d..58a01f0d3 100644 --- a/ui/app/pages/settings/contact-list-tab/contact-list-tab.container.js +++ b/ui/app/pages/settings/contact-list-tab/contact-list-tab.container.js @@ -13,7 +13,7 @@ import { CONTACT_MY_ACCOUNTS_ROUTE, CONTACT_MY_ACCOUNTS_VIEW_ROUTE, CONTACT_MY_ACCOUNTS_EDIT_ROUTE, -} from '../../../helpers/constants/routes' +} from '~/brave/ui/app/helpers/constants/routes' const mapStateToProps = (state, ownProps) => { diff --git a/ui/app/pages/settings/contact-list-tab/edit-contact/edit-contact.container.js b/ui/app/pages/settings/contact-list-tab/edit-contact/edit-contact.container.js index 639fb841e..eac95bef6 100644 --- a/ui/app/pages/settings/contact-list-tab/edit-contact/edit-contact.container.js +++ b/ui/app/pages/settings/contact-list-tab/edit-contact/edit-contact.container.js @@ -9,8 +9,8 @@ import { CONTACT_MY_ACCOUNTS_VIEW_ROUTE, CONTACT_MY_ACCOUNTS_EDIT_ROUTE, CONTACT_LIST_ROUTE, -} from '../../../../helpers/constants/routes' -import { addToAddressBook, removeFromAddressBook, setAccountLabel } from '../../../../store/actions' +} from '~/brave/ui/app/helpers/constants/routes' +import { addToAddressBook, removeFromAddressBook, setAccountLabel } from '~/brave/ui/app/store/actions' const mapStateToProps = (state, ownProps) => { const { location } = ownProps diff --git a/ui/app/pages/settings/contact-list-tab/my-accounts/my-accounts.component.js b/ui/app/pages/settings/contact-list-tab/my-accounts/my-accounts.component.js index f43b59e07..63653ff77 100644 --- a/ui/app/pages/settings/contact-list-tab/my-accounts/my-accounts.component.js +++ b/ui/app/pages/settings/contact-list-tab/my-accounts/my-accounts.component.js @@ -1,7 +1,7 @@ import React, { PureComponent } from 'react' import PropTypes from 'prop-types' import ContactList from '../../../../components/app/contact-list' -import { CONTACT_MY_ACCOUNTS_VIEW_ROUTE } from '../../../../helpers/constants/routes' +import { CONTACT_MY_ACCOUNTS_VIEW_ROUTE } from '~/brave/ui/app/helpers/constants/routes' export default class ViewContact extends PureComponent { diff --git a/ui/app/pages/settings/contact-list-tab/view-contact/view-contact.container.js b/ui/app/pages/settings/contact-list-tab/view-contact/view-contact.container.js index b1196d936..d0cc18bbf 100644 --- a/ui/app/pages/settings/contact-list-tab/view-contact/view-contact.container.js +++ b/ui/app/pages/settings/contact-list-tab/view-contact/view-contact.container.js @@ -3,13 +3,13 @@ import { compose } from 'recompose' import { connect } from 'react-redux' import { withRouter } from 'react-router-dom' import { getAddressBookEntry } from '../../../../selectors/selectors' -import { removeFromAddressBook } from '../../../../store/actions' +import { removeFromAddressBook } from '~/brave/ui/app/store/actions' import { checksumAddress } from '../../../../helpers/utils/util' import { CONTACT_EDIT_ROUTE, CONTACT_MY_ACCOUNTS_EDIT_ROUTE, CONTACT_MY_ACCOUNTS_VIEW_ROUTE, -} from '../../../../helpers/constants/routes' +} from '~/brave/ui/app/helpers/constants/routes' const mapStateToProps = (state, ownProps) => { const { location } = ownProps diff --git a/ui/app/pages/settings/networks-tab/networks-tab.component.js b/ui/app/pages/settings/networks-tab/networks-tab.component.js index 4ee871a58..2b138ae04 100644 --- a/ui/app/pages/settings/networks-tab/networks-tab.component.js +++ b/ui/app/pages/settings/networks-tab/networks-tab.component.js @@ -1,6 +1,6 @@ import React, { PureComponent } from 'react' import PropTypes from 'prop-types' -import { SETTINGS_ROUTE } from '../../../helpers/constants/routes' +import { SETTINGS_ROUTE } from '~/brave/ui/app/helpers/constants/routes' import { ENVIRONMENT_TYPE_POPUP } from '../../../../../app/scripts/lib/enums' import { getEnvironmentType } from '../../../../../app/scripts/lib/util' import classnames from 'classnames' diff --git a/ui/app/pages/settings/networks-tab/networks-tab.container.js b/ui/app/pages/settings/networks-tab/networks-tab.container.js index 8cc18a4bd..e1aeb6219 100644 --- a/ui/app/pages/settings/networks-tab/networks-tab.container.js +++ b/ui/app/pages/settings/networks-tab/networks-tab.container.js @@ -9,8 +9,8 @@ import { setNetworksTabAddMode, editRpc, showModal, -} from '../../../store/actions' -import { defaultNetworksData } from './networks-tab.constants' +} from '~/brave/ui/app/store/actions' +import { defaultNetworksData } from '~/brave/ui/app/pages/settings/networks-tab/networks-tab.constants' const defaultNetworks = defaultNetworksData.map(network => ({ ...network, viewOnly: true })) const mapStateToProps = state => { diff --git a/ui/app/pages/settings/security-tab/security-tab.component.js b/ui/app/pages/settings/security-tab/security-tab.component.js index 117010d0f..0e197e220 100644 --- a/ui/app/pages/settings/security-tab/security-tab.component.js +++ b/ui/app/pages/settings/security-tab/security-tab.component.js @@ -1,7 +1,7 @@ import React, { PureComponent } from 'react' import PropTypes from 'prop-types' import ToggleButton from '../../../components/ui/toggle-button' -import { REVEAL_SEED_ROUTE } from '../../../helpers/constants/routes' +import { REVEAL_SEED_ROUTE } from '~/brave/ui/app/helpers/constants/routes' import Button from '../../../components/ui/button' export default class SecurityTab extends PureComponent { diff --git a/ui/app/pages/settings/security-tab/security-tab.container.js b/ui/app/pages/settings/security-tab/security-tab.container.js index 35375ebf5..f27dcf30c 100644 --- a/ui/app/pages/settings/security-tab/security-tab.container.js +++ b/ui/app/pages/settings/security-tab/security-tab.container.js @@ -1,4 +1,4 @@ -import SecurityTab from './security-tab.component' +import SecurityTab from '~/brave/ui/app/pages/settings/security-tab/security-tab.component' import { compose } from 'recompose' import { connect } from 'react-redux' import { withRouter } from 'react-router-dom' @@ -7,7 +7,7 @@ import { revealSeedConfirmation, setFeatureFlag, setParticipateInMetaMetrics, -} from '../../../store/actions' +} from '~/brave/ui/app/store/actions' const mapStateToProps = state => { const { appState: { warning }, metamask } = state diff --git a/ui/app/pages/settings/settings-tab/settings-tab.container.js b/ui/app/pages/settings/settings-tab/settings-tab.container.js index d3d8457f0..28a2fcec7 100644 --- a/ui/app/pages/settings/settings-tab/settings-tab.container.js +++ b/ui/app/pages/settings/settings-tab/settings-tab.container.js @@ -9,7 +9,7 @@ import { updateCurrentLocale, setUseNativeCurrencyAsPrimaryCurrencyPreference, setParticipateInMetaMetrics, -} from '../../../store/actions' +} from '~/brave/ui/app/store/actions' import { preferencesSelector } from '../../../selectors/selectors' const mapStateToProps = state => { diff --git a/ui/app/pages/settings/settings.component.js b/ui/app/pages/settings/settings.component.js index 975ab4e35..3a046f6e0 100644 --- a/ui/app/pages/settings/settings.component.js +++ b/ui/app/pages/settings/settings.component.js @@ -26,7 +26,7 @@ import { CONTACT_MY_ACCOUNTS_ROUTE, CONTACT_MY_ACCOUNTS_VIEW_ROUTE, CONTACT_MY_ACCOUNTS_EDIT_ROUTE, -} from '../../helpers/constants/routes' +} from '~/brave/ui/app/helpers/constants/routes' class SettingsPage extends PureComponent { static propTypes = { diff --git a/ui/app/pages/settings/settings.container.js b/ui/app/pages/settings/settings.container.js index 8fe6614df..7f84cbb70 100644 --- a/ui/app/pages/settings/settings.container.js +++ b/ui/app/pages/settings/settings.container.js @@ -21,7 +21,7 @@ import { CONTACT_MY_ACCOUNTS_ROUTE, CONTACT_MY_ACCOUNTS_EDIT_ROUTE, CONTACT_MY_ACCOUNTS_VIEW_ROUTE, -} from '../../helpers/constants/routes' +} from '~/brave/ui/app/helpers/constants/routes' const ROUTES_TO_I18N_KEYS = { [GENERAL_ROUTE]: 'general', diff --git a/ui/app/pages/unlock-page/unlock-page.component.js b/ui/app/pages/unlock-page/unlock-page.component.js index 3aeb2a59b..ccd38398e 100644 --- a/ui/app/pages/unlock-page/unlock-page.component.js +++ b/ui/app/pages/unlock-page/unlock-page.component.js @@ -4,8 +4,8 @@ import Button from '@material-ui/core/Button' import TextField from '../../components/ui/text-field' import getCaretCoordinates from 'textarea-caret' import { EventEmitter } from 'events' -import Mascot from '../../components/ui/mascot' -import { DEFAULT_ROUTE } from '../../helpers/constants/routes' +import Mascot from '~/brave/ui/app/components/ui/mascot' +import { DEFAULT_ROUTE } from '~/brave/ui/app/helpers/constants/routes' export default class UnlockPage extends Component { static contextTypes = { diff --git a/ui/app/pages/unlock-page/unlock-page.container.js b/ui/app/pages/unlock-page/unlock-page.container.js index b89392ab5..22eb00e4e 100644 --- a/ui/app/pages/unlock-page/unlock-page.container.js +++ b/ui/app/pages/unlock-page/unlock-page.container.js @@ -3,14 +3,14 @@ import { withRouter } from 'react-router-dom' import { compose } from 'recompose' import { getEnvironmentType } from '../../../../app/scripts/lib/util' import { ENVIRONMENT_TYPE_POPUP } from '../../../../app/scripts/lib/enums' -import { DEFAULT_ROUTE, RESTORE_VAULT_ROUTE } from '../../helpers/constants/routes' +import { DEFAULT_ROUTE, RESTORE_VAULT_ROUTE } from '~/brave/ui/app/helpers/constants/routes' import { tryUnlockMetamask, forgotPassword, markPasswordForgotten, forceUpdateMetamaskState, showModal, -} from '../../store/actions' +} from '~/brave/ui/app/store/actions' import UnlockPage from './unlock-page.component' const mapStateToProps = state => { diff --git a/ui/app/store/actions.js b/ui/app/store/actions.js index 26be7b7d8..c294bacda 100644 --- a/ui/app/store/actions.js +++ b/ui/app/store/actions.js @@ -2480,7 +2480,7 @@ function setUseIn3 (value) { background.setUseIn3Network(value, (result, error) => { if (!error) { dispatch({ - type: actionConstants.SET_USE_IN3, + type: actions.SET_USE_IN3, value: result, }) } else { From e8e1c83ec0fc5938d01844cf3f0837aef49731d6 Mon Sep 17 00:00:00 2001 From: chirag-parmar Date: Wed, 5 Feb 2020 14:35:43 +0100 Subject: [PATCH 05/16] use eth-json-rpc-in3 as package --- package.json | 5 +++-- yarn.lock | 17 ++++++++++++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index c288b67b7..1c3a3c52d 100644 --- a/package.json +++ b/package.json @@ -101,11 +101,12 @@ "eth-block-tracker": "^4.4.2", "eth-contract-metadata": "^1.12.1", "eth-ens-namehash": "^2.0.8", + "eth-hd-keyring": "github:brave/eth-hd-keyring#d811474329e1a725180d393b67d03c0f3d96106b", "eth-json-rpc-errors": "^1.1.0", "eth-json-rpc-filters": "^4.1.1", - "eth-json-rpc-middleware": "^4.4.0", - "eth-hd-keyring": "github:brave/eth-hd-keyring#d811474329e1a725180d393b67d03c0f3d96106b", + "eth-json-rpc-in3": "^0.1.3", "eth-json-rpc-infura": "github:brave/eth-json-rpc-infura#e935ea77179447d2da15082cdac913ea6bf1133d", + "eth-json-rpc-middleware": "^4.4.0", "eth-keyring-controller": "github:brave/KeyringController#9d4408c935948fb7797dd267560b4393a44c7379", "eth-ledger-bridge-keyring": "^0.2.0", "eth-method-registry": "^1.2.0", diff --git a/yarn.lock b/yarn.lock index bf60e7722..16dfc34fc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10133,6 +10133,16 @@ eth-json-rpc-filters@^4.1.1: lodash.flatmap "^4.5.0" safe-event-emitter "^1.0.1" +eth-json-rpc-in3@^0.1.3: + version "0.1.3" + resolved "https://npm.slock.it/eth-json-rpc-in3/-/eth-json-rpc-in3-0.1.3.tgz#8fb8f14e2d4f77e41927fdb1eb911cc1caf71760" + integrity sha512-7wcaU+MzsOvMIe8+dsHurfkgZ9cvMoh0vZgzGa7XGuFIZ26rb6fdFHV5GOOy38FVu4Q2bMuPo4v9g8CvNx4b2w== + dependencies: + "@babel/runtime" "^7.5.5" + eth-json-rpc-errors "^2.0.0" + in3-asmjs "2.1.0" + json-rpc-engine "^5.1.6" + eth-json-rpc-infura@^3.1.0: version "3.2.0" resolved "https://registry.yarnpkg.com/eth-json-rpc-infura/-/eth-json-rpc-infura-3.2.0.tgz#62c3f516b51351038c32a548704467cec113ca8f" @@ -12238,7 +12248,7 @@ fuse.js@^3.4.4: resolved "https://registry.yarnpkg.com/fuse.js/-/fuse.js-3.4.5.tgz#8954fb43f9729bd5dbcb8c08f251db552595a7a6" integrity sha512-s9PGTaQIkT69HaeoTVjwGsLfb8V8ScJLx5XGFcKHg0MqLUH/UZ4EKOtqtXX9k7AFqCGxD1aJmYb8Q5VYDibVRQ== -gaba@^1.9.3: +gaba@^1.6.0, gaba@^1.9.3: version "1.9.3" resolved "https://registry.yarnpkg.com/gaba/-/gaba-1.9.3.tgz#4e0e106f3640930f1f06ffe72546903b4c51813e" integrity sha512-zC9CpaksncAT9SSc4QAxozUE+SKIWN+r9YwhjAJoSeh9joqPJsXlJOHg1/CrHABpvN68QdE00wAYSabYM02EqQ== @@ -14102,6 +14112,11 @@ in-publish@^2.0.0: resolved "https://registry.yarnpkg.com/in-publish/-/in-publish-2.0.0.tgz#e20ff5e3a2afc2690320b6dc552682a9c7fadf51" integrity sha1-4g/146KvwmkDILbcVSaCqcf631E= +in3-asmjs@2.1.0: + version "2.1.0" + resolved "https://npm.slock.it/in3-asmjs/-/in3-asmjs-2.1.0.tgz#9cd04df81043998934274ef9d6414cc952a45697" + integrity sha512-/f86fnQQNvLufp4fdNpVmbxnVQgrDM016LaFIgdBsFKorY+C5QIgRLzJVGbNkJCR4yJ2c9kWtvYczyaKt4f2rg== + indefinite-observable@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/indefinite-observable/-/indefinite-observable-1.0.1.tgz#09915423cc8d6f7eb1cb7882ad134633c9a6edc3" From 727d7f78f21f73cef202779b25349f2a3179b7e8 Mon Sep 17 00:00:00 2001 From: chirag-parmar Date: Wed, 5 Feb 2020 14:39:59 +0100 Subject: [PATCH 06/16] fix in3 initializProvider issue --- app/scripts/controllers/network/network.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/scripts/controllers/network/network.js b/app/scripts/controllers/network/network.js index 77550da38..9eee01f48 100644 --- a/app/scripts/controllers/network/network.js +++ b/app/scripts/controllers/network/network.js @@ -72,8 +72,8 @@ module.exports = class NetworkController extends EventEmitter { initializeProvider (providerParams) { this._baseProviderParams = providerParams - const { type, rpcTarget, chainId, ticker, nickname } = this.providerStore.getState() - this._configureProvider({ type, rpcTarget, chainId, ticker, nickname }) + const { type, rpcTarget, chainId, ticker, nickname, rpcPrefs, rpcType } = this.providerStore.getState() + this._configureProvider({ type, rpcTarget, chainId, ticker, nickname, rpcPrefs, rpcType }) this.lookupNetwork() } From 3e52559596130e491378c96d1cc34a25ce9ac2fa Mon Sep 17 00:00:00 2001 From: chirag-parmar Date: Thu, 6 Feb 2020 13:48:13 +0100 Subject: [PATCH 07/16] restrict network types for in3 --- app/scripts/controllers/network/network.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/scripts/controllers/network/network.js b/app/scripts/controllers/network/network.js index 9eee01f48..943088b5b 100644 --- a/app/scripts/controllers/network/network.js +++ b/app/scripts/controllers/network/network.js @@ -26,6 +26,7 @@ const { IN3 } = require('./enums') const INFURA_PROVIDER_TYPES = [ROPSTEN, RINKEBY, KOVAN, MAINNET, GOERLI] +const IN3_PROVIDER_TYPES = [KOVAN, MAINNET, GOERLI] const RPC_PROVIDER_TYPES = [INFURA, IN3] @@ -183,14 +184,13 @@ module.exports = class NetworkController extends EventEmitter { const { type, rpcTarget, chainId, ticker, nickname, rpcPrefs, rpcType } = opts console.log(opts) // infura type-based endpoints - const isDefaultRpcNetwork = INFURA_PROVIDER_TYPES.includes(type) - const useIn3 = true + const isInfura = INFURA_PROVIDER_TYPES.includes(type) + const isIn3 = IN3_PROVIDER_TYPES.includes(type) - if (isDefaultRpcNetwork && rpcType !== IN3) { - console.log('Infura') + if (isInfura && !(isIn3 && rpcType === IN3)) { this._configureInfuraProvider(opts) // in3 - } else if (isDefaultRpcNetwork && rpcType === IN3) { + } else if (isIn3 && rpcType === IN3) { console.log("In3") this._configureIn3Provider(opts) } else if (type === LOCALHOST) { From cd6979ce7e940628999a2cf4da86e96397fb1606 Mon Sep 17 00:00:00 2001 From: chirag-parmar Date: Mon, 16 Mar 2020 10:31:33 +0100 Subject: [PATCH 08/16] git revert autogenerate changes from brave --- app/scripts/background.js | 8 ++++---- app/scripts/contentscript.js | 2 +- app/scripts/lib/ens-ipfs/setup.js | 2 +- app/scripts/lib/get-first-preferred-lang-code.js | 2 +- app/scripts/lib/local-store.js | 2 +- app/scripts/lib/notification-manager.js | 2 +- app/scripts/metamask-controller.js | 8 ++++---- app/scripts/phishing-detect.js | 2 +- app/scripts/platforms/extension.js | 2 +- app/scripts/ui.js | 4 ++-- .../app/account-details/account-details.container.js | 2 +- .../components/app/account-menu/account-menu.component.js | 4 ++-- .../components/app/account-menu/account-menu.container.js | 2 +- ui/app/components/app/app-header/app-header.component.js | 2 +- ui/app/components/app/app-header/app-header.container.js | 2 +- ui/app/components/app/customize-gas-modal/index.js | 2 +- .../dai-migration-notification.container.js | 2 +- .../components/app/dropdowns/account-details-dropdown.js | 4 ++-- ui/app/components/app/dropdowns/network-dropdown.js | 4 ++-- ui/app/components/app/dropdowns/tests/menu.test.js | 2 +- ui/app/components/app/dropdowns/token-menu-dropdown.js | 4 ++-- .../advanced-gas-inputs/advanced-gas-inputs.container.js | 2 +- .../gas-modal-page-container.container.js | 2 +- .../tests/gas-modal-page-container-container.test.js | 2 +- ui/app/components/app/index.scss | 1 - .../loading-network-screen.container.js | 2 +- ui/app/components/app/menu-bar/menu-bar.container.js | 2 +- .../account-details-modal.container.js | 2 +- ui/app/components/app/modals/account-modal-container.js | 2 +- .../add-to-addressbook-modal.container.js | 2 +- .../cancel-transaction/cancel-transaction.container.js | 2 +- .../clear-approved-origins.container.js | 2 +- .../confirm-delete-network.container.js | 2 +- .../confirm-remove-account.component.js | 2 +- .../confirm-remove-account.container.js | 2 +- .../confirm-reset-account.container.js | 2 +- ui/app/components/app/modals/deposit-ether-modal.js | 2 +- ui/app/components/app/modals/export-private-key-modal.js | 2 +- .../app/modals/hide-token-confirmation-modal.js | 2 +- .../metametrics-opt-in-modal.container.js | 2 +- ui/app/components/app/modals/modal.js | 2 +- ui/app/components/app/modals/notification-modal.js | 2 +- .../app/modals/qr-scanner/qr-scanner.container.js | 4 ++-- .../provider-page-container-content.component.js | 2 +- ui/app/components/app/shift-list-item.js | 2 +- ui/app/components/app/signature-request-original.js | 4 ++-- .../app/signature-request/signature-request.container.js | 2 +- ui/app/components/app/token-cell.js | 4 ++-- .../transaction-list-item-details.container.js | 2 +- .../transaction-list-item.component.js | 2 +- .../transaction-list-item.container.js | 2 +- .../app/transaction-list/transaction-list.container.js | 2 +- .../tests/token-view-balance.component.test.js | 2 +- .../transaction-view-balance.component.js | 2 +- .../transaction-view-balance.container.js | 2 +- ui/app/components/app/wallet-view.js | 4 ++-- ui/app/components/ui/metafox-logo/index.js | 2 +- ui/app/ducks/app/app.js | 2 +- ui/app/ducks/index.js | 2 +- ui/app/ducks/locale/locale.js | 2 +- ui/app/ducks/metamask/metamask.js | 2 +- .../authenticated/authenticated.component.js | 2 +- .../initialized/initialized.component.js | 2 +- .../with-modal-props/with-modal-props.js | 2 +- ui/app/pages/add-token/add-token.component.js | 2 +- ui/app/pages/add-token/add-token.container.js | 2 +- .../confirm-add-suggested-token.component.js | 2 +- .../confirm-add-suggested-token.container.js | 2 +- .../confirm-add-token/confirm-add-token.component.js | 2 +- .../confirm-add-token/confirm-add-token.container.js | 2 +- ui/app/pages/confirm-approve/confirm-approve.container.js | 2 +- .../confirm-send-ether/confirm-send-ether.component.js | 2 +- .../confirm-send-ether/confirm-send-ether.container.js | 2 +- .../confirm-send-token/confirm-send-token.component.js | 2 +- .../confirm-send-token/confirm-send-token.container.js | 2 +- .../confirm-transaction-base.component.js | 2 +- .../confirm-transaction-base.container.js | 2 +- .../confirm-transaction-switch.component.js | 2 +- ui/app/pages/confirm-transaction/conf-tx.js | 4 ++-- .../confirm-transaction/confirm-transaction.component.js | 2 +- .../confirm-transaction/confirm-transaction.container.js | 2 +- ui/app/pages/create-account/connect-hardware/index.js | 6 +++--- ui/app/pages/create-account/create-account.component.js | 2 +- ui/app/pages/create-account/create-account.container.js | 2 +- ui/app/pages/create-account/import-account/index.js | 2 +- ui/app/pages/create-account/import-account/json.js | 4 ++-- ui/app/pages/create-account/import-account/private-key.js | 4 ++-- ui/app/pages/create-account/new-account.component.js | 2 +- ui/app/pages/create-account/new-account.container.js | 2 +- .../create-password/create-password.component.js | 2 +- .../import-with-seed-phrase.component.js | 2 +- .../import-with-seed-phrase.container.js | 4 ++-- .../tests/import-with-seed-phrase.component.test.js | 2 +- .../first-time-flow/create-password/new-account/index.js | 2 +- .../create-password/new-account/new-account.component.js | 2 +- .../unique-image/unique-image.component.js | 2 +- .../first-time-flow/end-of-flow/end-of-flow.component.js | 4 ++-- .../first-time-flow/end-of-flow/end-of-flow.container.js | 2 +- .../first-time-flow-switch.component.js | 2 +- ui/app/pages/first-time-flow/first-time-flow.component.js | 2 +- ui/app/pages/first-time-flow/first-time-flow.container.js | 4 ++-- ui/app/pages/first-time-flow/first-time-flow.selectors.js | 2 +- .../metametrics-opt-in/metametrics-opt-in.container.js | 2 +- .../confirm-seed-phrase/confirm-seed-phrase.component.js | 2 +- .../confirm-seed-phrase/confirm-seed-phrase.container.js | 4 ++-- .../reveal-seed-phrase/reveal-seed-phrase.component.js | 2 +- .../reveal-seed-phrase/reveal-seed-phrase.container.js | 4 ++-- .../first-time-flow/seed-phrase/seed-phrase.component.js | 2 +- .../tests/confirm-seed-phrase-component.test.js | 2 +- .../select-action/select-action.component.js | 2 +- .../select-action/select-action.container.js | 4 ++-- ui/app/pages/first-time-flow/welcome/welcome.component.js | 4 ++-- ui/app/pages/first-time-flow/welcome/welcome.container.js | 4 ++-- ui/app/pages/home/home.component.js | 2 +- ui/app/pages/home/home.container.js | 2 +- ui/app/pages/index.js | 2 +- ui/app/pages/keychains/restore-vault.js | 4 ++-- ui/app/pages/keychains/reveal-seed.js | 4 ++-- ui/app/pages/lock/lock.component.js | 2 +- ui/app/pages/lock/lock.container.js | 2 +- ui/app/pages/mobile-sync/index.js | 6 +++--- .../provider-approval/provider-approval.container.js | 2 +- ui/app/pages/routes/index.js | 8 ++++---- .../send-content/add-recipient/add-recipient.container.js | 2 +- .../add-recipient/tests/add-recipient-container.test.js | 2 +- .../amount-max-button/amount-max-button.container.js | 2 +- .../tests/amount-max-button-container.test.js | 2 +- .../send-amount-row/send-amount-row.container.js | 2 +- .../tests/send-amount-row-container.test.js | 2 +- .../send-asset-row/send-asset-row.container.js | 2 +- ui/app/pages/send/send-content/send-content.container.js | 2 +- .../send-content/send-gas-row/send-gas-row.container.js | 2 +- .../send-gas-row/tests/send-gas-row-container.test.js | 2 +- .../send-hex-data-row/send-hex-data-row.container.js | 2 +- ui/app/pages/send/send-footer/send-footer.component.js | 2 +- ui/app/pages/send/send-footer/send-footer.container.js | 2 +- .../send/send-footer/tests/send-footer-component.test.js | 2 +- .../send/send-footer/tests/send-footer-container.test.js | 2 +- ui/app/pages/send/send-header/send-header.component.js | 2 +- ui/app/pages/send/send-header/send-header.container.js | 2 +- .../send/send-header/tests/send-header-component.test.js | 2 +- .../send/send-header/tests/send-header-container.test.js | 2 +- ui/app/pages/send/send.container.js | 4 ++-- ui/app/pages/send/tests/send-container.test.js | 2 +- .../pages/settings/advanced-tab/advanced-tab.component.js | 2 +- .../pages/settings/advanced-tab/advanced-tab.container.js | 4 ++-- .../advanced-tab/tests/advanced-tab-component.test.js | 2 +- .../settings/connections-tab/connections-tab.container.js | 2 +- .../contact-list-tab/add-contact/add-contact.container.js | 4 ++-- .../contact-list-tab/contact-list-tab.component.js | 2 +- .../contact-list-tab/contact-list-tab.container.js | 2 +- .../edit-contact/edit-contact.container.js | 4 ++-- .../contact-list-tab/my-accounts/my-accounts.component.js | 2 +- .../view-contact/view-contact.container.js | 4 ++-- .../pages/settings/networks-tab/networks-tab.component.js | 2 +- .../pages/settings/networks-tab/networks-tab.container.js | 4 ++-- .../pages/settings/security-tab/security-tab.component.js | 2 +- .../pages/settings/security-tab/security-tab.container.js | 4 ++-- .../pages/settings/settings-tab/settings-tab.container.js | 2 +- ui/app/pages/settings/settings.component.js | 2 +- ui/app/pages/settings/settings.container.js | 2 +- ui/app/pages/unlock-page/unlock-page.component.js | 4 ++-- ui/app/pages/unlock-page/unlock-page.container.js | 4 ++-- ui/app/store/actions.js | 2 +- 164 files changed, 207 insertions(+), 208 deletions(-) diff --git a/app/scripts/background.js b/app/scripts/background.js index f0e9b7936..31c8d1815 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -14,7 +14,7 @@ const endOfStream = require('end-of-stream') const pump = require('pump') const debounce = require('debounce-stream') const log = require('loglevel') -const extension = require('~/brave/lib/extensionizer') +const extension = require('extensionizer') const LocalStore = require('./lib/local-store') const storeTransform = require('obs-store/lib/transform') const asStream = require('obs-store/lib/asStream') @@ -24,11 +24,11 @@ const migrations = require('./migrations/') const PortStream = require('extension-port-stream') const createStreamSink = require('./lib/createStreamSink') const NotificationManager = require('./lib/notification-manager.js') -const MetamaskController = require('~/brave/app/scripts/metamask-controller') +const MetamaskController = require('./metamask-controller') const rawFirstTimeState = require('./first-time-state') -const setupSentry = require('~/brave/app/scripts/lib/setupSentry') +const setupSentry = require('./lib/setupSentry') const reportFailedTxToSentry = require('./lib/reportFailedTxToSentry') -const setupMetamaskMeshMetrics = require('~/brave/app/scripts/lib/setupMetamaskMeshMetrics') +const setupMetamaskMeshMetrics = require('./lib/setupMetamaskMeshMetrics') const EdgeEncryptor = require('./edge-encryptor') const getFirstPreferredLangCode = require('./lib/get-first-preferred-lang-code') const getObjStructure = require('./lib/getObjStructure') diff --git a/app/scripts/contentscript.js b/app/scripts/contentscript.js index 8b32cee5f..7b302fcec 100644 --- a/app/scripts/contentscript.js +++ b/app/scripts/contentscript.js @@ -6,7 +6,7 @@ const Dnode = require('dnode') const querystring = require('querystring') const LocalMessageDuplexStream = require('post-message-stream') const ObjectMultiplex = require('obj-multiplex') -const extension = require('~/brave/lib/extensionizer') +const extension = require('extensionizer') const PortStream = require('extension-port-stream') const inpageContent = fs.readFileSync(path.join(__dirname, '..', '..', 'dist', 'chrome', 'inpage.js'), 'utf8') diff --git a/app/scripts/lib/ens-ipfs/setup.js b/app/scripts/lib/ens-ipfs/setup.js index 6cc9ff5e3..e4eddd494 100644 --- a/app/scripts/lib/ens-ipfs/setup.js +++ b/app/scripts/lib/ens-ipfs/setup.js @@ -1,5 +1,5 @@ const urlUtil = require('url') -const extension = require('~/brave/lib/extensionizer') +const extension = require('extensionizer') const resolveEnsToIpfsContentId = require('./resolver.js') const supportedTopLevelDomains = ['eth'] diff --git a/app/scripts/lib/get-first-preferred-lang-code.js b/app/scripts/lib/get-first-preferred-lang-code.js index 80062e3e1..469235357 100644 --- a/app/scripts/lib/get-first-preferred-lang-code.js +++ b/app/scripts/lib/get-first-preferred-lang-code.js @@ -1,4 +1,4 @@ -const extension = require('~/brave/lib/extensionizer') +const extension = require('extensionizer') const promisify = require('pify') const allLocales = require('../../_locales/index.json') diff --git a/app/scripts/lib/local-store.js b/app/scripts/lib/local-store.js index a109a218c..8fde2e911 100644 --- a/app/scripts/lib/local-store.js +++ b/app/scripts/lib/local-store.js @@ -1,4 +1,4 @@ -const extension = require('~/brave/lib/extensionizer') +const extension = require('extensionizer') const log = require('loglevel') /** diff --git a/app/scripts/lib/notification-manager.js b/app/scripts/lib/notification-manager.js index 8570f2832..721d109a1 100644 --- a/app/scripts/lib/notification-manager.js +++ b/app/scripts/lib/notification-manager.js @@ -1,4 +1,4 @@ -const extension = require('~/brave/lib/extensionizer') +const extension = require('extensionizer') const NOTIFICATION_HEIGHT = 620 const NOTIFICATION_WIDTH = 360 diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 65cbd1e05..6132feb42 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -25,12 +25,12 @@ const {setupMultiplex} = require('./lib/stream-utils.js') const KeyringController = require('eth-keyring-controller') const EnsController = require('./controllers/ens') const NetworkController = require('./controllers/network') -const PreferencesController = require('~/brave/app/scripts/controllers/preferences') +const PreferencesController = require('./controllers/preferences') const AppStateController = require('./controllers/app-state') -const InfuraController = require('~/brave/app/scripts/controllers/infura') +const InfuraController = require('./controllers/infura') const CachedBalancesController = require('./controllers/cached-balances') const OnboardingController = require('./controllers/onboarding') -const ThreeBoxController = require('~/brave/app/scripts/controllers/threebox') +const ThreeBoxController = require('./controllers/threebox') const RecentBlocksController = require('./controllers/recent-blocks') const IncomingTransactionsController = require('./controllers/incoming-transactions') const MessageManager = require('./lib/message-manager') @@ -63,7 +63,7 @@ const { ShapeShiftController, PhishingController, } = require('gaba') -const backEndMetaMetricsEvent = require('~/brave/app/scripts/lib/backend-metametrics') +const backEndMetaMetricsEvent = require('./lib/backend-metametrics') const { IN3, INFURA } = require('./controllers/network/enums') module.exports = class MetamaskController extends EventEmitter { diff --git a/app/scripts/phishing-detect.js b/app/scripts/phishing-detect.js index c8edfb319..266e4fc31 100644 --- a/app/scripts/phishing-detect.js +++ b/app/scripts/phishing-detect.js @@ -2,7 +2,7 @@ const querystring = require('querystring') const dnode = require('dnode') const { EventEmitter } = require('events') const PortStream = require('extension-port-stream') -const extension = require('~/brave/lib/extensionizer') +const extension = require('extensionizer') const {setupMultiplex} = require('./lib/stream-utils.js') const { getEnvironmentType } = require('./lib/util') const ExtensionPlatform = require('./platforms/extension') diff --git a/app/scripts/platforms/extension.js b/app/scripts/platforms/extension.js index 6c7c6595d..d54a8a7b3 100644 --- a/app/scripts/platforms/extension.js +++ b/app/scripts/platforms/extension.js @@ -1,4 +1,4 @@ -const extension = require('~/brave/lib/extensionizer') +const extension = require('extensionizer') const {createExplorerLink: explorerLink} = require('etherscan-link') const {getEnvironmentType} = require('../lib/util') diff --git a/app/scripts/ui.js b/app/scripts/ui.js index 813dd1114..f9a8dc16a 100644 --- a/app/scripts/ui.js +++ b/app/scripts/ui.js @@ -8,11 +8,11 @@ import 'abortcontroller-polyfill/dist/polyfill-patch-fetch' const PortStream = require('extension-port-stream') const { getEnvironmentType } = require('./lib/util') const { ENVIRONMENT_TYPE_NOTIFICATION, ENVIRONMENT_TYPE_FULLSCREEN, ENVIRONMENT_TYPE_POPUP } = require('./lib/enums') -const extension = require('~/brave/lib/extensionizer') +const extension = require('extensionizer') const ExtensionPlatform = require('./platforms/extension') const NotificationManager = require('./lib/notification-manager') const notificationManager = new NotificationManager() -const setupSentry = require('~/brave/app/scripts/lib/setupSentry') +const setupSentry = require('./lib/setupSentry') const {EventEmitter} = require('events') const Dnode = require('dnode') const Eth = require('ethjs') diff --git a/ui/app/components/app/account-details/account-details.container.js b/ui/app/components/app/account-details/account-details.container.js index 27c22119b..581ff1e2f 100644 --- a/ui/app/components/app/account-details/account-details.container.js +++ b/ui/app/components/app/account-details/account-details.container.js @@ -1,5 +1,5 @@ import { connect } from 'react-redux' -import { hideSidebar, showModal } from '~/brave/ui/app/store/actions' +import { hideSidebar, showModal } from '../../../store/actions' import AccountDetails from './account-details.component' function mapDispatchToProps (dispatch) { diff --git a/ui/app/components/app/account-menu/account-menu.component.js b/ui/app/components/app/account-menu/account-menu.component.js index 132d22478..1b81e33a2 100644 --- a/ui/app/components/app/account-menu/account-menu.component.js +++ b/ui/app/components/app/account-menu/account-menu.component.js @@ -1,7 +1,7 @@ import React, { PureComponent } from 'react' import PropTypes from 'prop-types' import debounce from 'lodash.debounce' -import { Menu, Item, Divider, CloseArea } from '~/brave/ui/app/components/app/dropdowns/components/menu' +import { Menu, Item, Divider, CloseArea } from '../dropdowns/components/menu' import { ENVIRONMENT_TYPE_POPUP } from '../../../../../app/scripts/lib/enums' import { getEnvironmentType } from '../../../../../app/scripts/lib/util' import Tooltip from '../../ui/tooltip' @@ -15,7 +15,7 @@ import { IMPORT_ACCOUNT_ROUTE, CONNECT_HARDWARE_ROUTE, DEFAULT_ROUTE, -} from '~/brave/ui/app/helpers/constants/routes' +} from '../../../helpers/constants/routes' export default class AccountMenu extends PureComponent { static contextTypes = { diff --git a/ui/app/components/app/account-menu/account-menu.container.js b/ui/app/components/app/account-menu/account-menu.container.js index c27928102..ae2e28e76 100644 --- a/ui/app/components/app/account-menu/account-menu.container.js +++ b/ui/app/components/app/account-menu/account-menu.container.js @@ -10,7 +10,7 @@ import { showConfigPage, showInfoPage, showModal, -} from '~/brave/ui/app/store/actions' +} from '../../../store/actions' import { getMetaMaskAccounts } from '../../../selectors/selectors' import AccountMenu from './account-menu.component' diff --git a/ui/app/components/app/app-header/app-header.component.js b/ui/app/components/app/app-header/app-header.component.js index 6988c5612..e1bc0cf24 100644 --- a/ui/app/components/app/app-header/app-header.component.js +++ b/ui/app/components/app/app-header/app-header.component.js @@ -3,7 +3,7 @@ import PropTypes from 'prop-types' import classnames from 'classnames' import Identicon from '../../ui/identicon' import MetaFoxLogo from '../../ui/metafox-logo' -import { DEFAULT_ROUTE } from '~/brave/ui/app/helpers/constants/routes' +import { DEFAULT_ROUTE } from '../../../helpers/constants/routes' const NetworkIndicator = require('../network') export default class AppHeader extends PureComponent { diff --git a/ui/app/components/app/app-header/app-header.container.js b/ui/app/components/app/app-header/app-header.container.js index 8fc4981cf..b67338245 100644 --- a/ui/app/components/app/app-header/app-header.container.js +++ b/ui/app/components/app/app-header/app-header.container.js @@ -3,7 +3,7 @@ import { withRouter } from 'react-router-dom' import { compose } from 'recompose' import AppHeader from './app-header.component' -const actions = require('~/brave/ui/app/store/actions') +const actions = require('../../../store/actions') const mapStateToProps = state => { const { appState, metamask } = state diff --git a/ui/app/components/app/customize-gas-modal/index.js b/ui/app/components/app/customize-gas-modal/index.js index 21630ded2..1f9436810 100644 --- a/ui/app/components/app/customize-gas-modal/index.js +++ b/ui/app/components/app/customize-gas-modal/index.js @@ -4,7 +4,7 @@ const h = require('react-hyperscript') const inherits = require('util').inherits const connect = require('react-redux').connect const BigNumber = require('bignumber.js') -const actions = require('~/brave/ui/app/store/actions') +const actions = require('../../../store/actions') const GasModalCard = require('./gas-modal-card') import Button from '../../ui/button' diff --git a/ui/app/components/app/dai-migration-component/dai-migration-notification.container.js b/ui/app/components/app/dai-migration-component/dai-migration-notification.container.js index 472174bd5..175083bce 100644 --- a/ui/app/components/app/dai-migration-component/dai-migration-notification.container.js +++ b/ui/app/components/app/dai-migration-component/dai-migration-notification.container.js @@ -3,7 +3,7 @@ import { compose } from 'recompose' import DaiMigrationNotification from './dai-migration-notification.component' import withTokenTracker from '../../../helpers/higher-order-components/with-token-tracker' import { getSelectedAddress, getDaiV1Token } from '../../../selectors/selectors' -import { setMkrMigrationReminderTimestamp } from '~/brave/ui/app/store/actions' +import { setMkrMigrationReminderTimestamp } from '../../../store/actions' const mapStateToProps = (state) => { const { diff --git a/ui/app/components/app/dropdowns/account-details-dropdown.js b/ui/app/components/app/dropdowns/account-details-dropdown.js index 634c98da5..cf2aa8ae8 100644 --- a/ui/app/components/app/dropdowns/account-details-dropdown.js +++ b/ui/app/components/app/dropdowns/account-details-dropdown.js @@ -3,10 +3,10 @@ const PropTypes = require('prop-types') const h = require('react-hyperscript') const inherits = require('util').inherits const connect = require('react-redux').connect -const actions = require('~/brave/ui/app/store/actions') +const actions = require('../../../store/actions') const { getSelectedIdentity, getRpcPrefsForCurrentProvider } = require('../../../selectors/selectors') const genAccountLink = require('../../../../lib/account-link.js') -const { Menu, Item, CloseArea } = require('~/brave/ui/app/components/app/dropdowns/components/menu') +const { Menu, Item, CloseArea } = require('./components/menu') AccountDetailsDropdown.contextTypes = { t: PropTypes.func, diff --git a/ui/app/components/app/dropdowns/network-dropdown.js b/ui/app/components/app/dropdowns/network-dropdown.js index aace94f57..e6a24ef11 100644 --- a/ui/app/components/app/dropdowns/network-dropdown.js +++ b/ui/app/components/app/dropdowns/network-dropdown.js @@ -5,12 +5,12 @@ const inherits = require('util').inherits const connect = require('react-redux').connect const { withRouter } = require('react-router-dom') const { compose } = require('recompose') -const actions = require('~/brave/ui/app/store/actions') +const actions = require('../../../store/actions') const Dropdown = require('./components/dropdown').Dropdown const DropdownMenuItem = require('./components/dropdown').DropdownMenuItem const NetworkDropdownIcon = require('./components/network-dropdown-icon') const R = require('ramda') -const { NETWORKS_ROUTE } = require('~/brave/ui/app/helpers/constants/routes') +const { NETWORKS_ROUTE } = require('../../../helpers/constants/routes') // classes from nodes of the toggle element. const notToggleElementClassnames = [ diff --git a/ui/app/components/app/dropdowns/tests/menu.test.js b/ui/app/components/app/dropdowns/tests/menu.test.js index a10c117cf..6413c0c2c 100644 --- a/ui/app/components/app/dropdowns/tests/menu.test.js +++ b/ui/app/components/app/dropdowns/tests/menu.test.js @@ -2,7 +2,7 @@ import React from 'react' import assert from 'assert' import sinon from 'sinon' import { shallow } from 'enzyme' -import { Menu, Item, Divider, CloseArea } from '~/brave/ui/app/components/app/dropdowns/components/menu' +import { Menu, Item, Divider, CloseArea } from '../components/menu' describe('Dropdown Menu Components', () => { diff --git a/ui/app/components/app/dropdowns/token-menu-dropdown.js b/ui/app/components/app/dropdowns/token-menu-dropdown.js index baeec63fa..e2730aea2 100644 --- a/ui/app/components/app/dropdowns/token-menu-dropdown.js +++ b/ui/app/components/app/dropdowns/token-menu-dropdown.js @@ -3,9 +3,9 @@ const PropTypes = require('prop-types') const h = require('react-hyperscript') const inherits = require('util').inherits const connect = require('react-redux').connect -const actions = require('~/brave/ui/app/store/actions') +const actions = require('../../../store/actions') const genAccountLink = require('etherscan-link').createAccountLink -const { Menu, Item, CloseArea } = require('~/brave/ui/app/components/app/dropdowns/components/menu') +const { Menu, Item, CloseArea } = require('./components/menu') TokenMenuDropdown.contextTypes = { t: PropTypes.func, diff --git a/ui/app/components/app/gas-customization/advanced-gas-inputs/advanced-gas-inputs.container.js b/ui/app/components/app/gas-customization/advanced-gas-inputs/advanced-gas-inputs.container.js index f522e37fb..4fa0d4d94 100644 --- a/ui/app/components/app/gas-customization/advanced-gas-inputs/advanced-gas-inputs.container.js +++ b/ui/app/components/app/gas-customization/advanced-gas-inputs/advanced-gas-inputs.container.js @@ -1,5 +1,5 @@ import { connect } from 'react-redux' -import { showModal } from '~/brave/ui/app/store/actions' +import { showModal } from '../../../../store/actions' import { decGWEIToHexWEI, decimalToHex, diff --git a/ui/app/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js b/ui/app/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js index a5442ba24..c3d214b63 100644 --- a/ui/app/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js +++ b/ui/app/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js @@ -11,7 +11,7 @@ import { updateSendAmount, setGasTotal, updateTransaction, -} from '~/brave/ui/app/store/actions' +} from '../../../../store/actions' import { setCustomGasPrice, setCustomGasLimit, diff --git a/ui/app/components/app/gas-customization/gas-modal-page-container/tests/gas-modal-page-container-container.test.js b/ui/app/components/app/gas-customization/gas-modal-page-container/tests/gas-modal-page-container-container.test.js index 29d6370b3..8e3d14ea4 100644 --- a/ui/app/components/app/gas-customization/gas-modal-page-container/tests/gas-modal-page-container-container.test.js +++ b/ui/app/components/app/gas-customization/gas-modal-page-container/tests/gas-modal-page-container-container.test.js @@ -40,7 +40,7 @@ proxyquire('../gas-modal-page-container.container.js', { getRenderableBasicEstimateData: (s) => `mockRenderableBasicEstimateData:${Object.keys(s).length}`, getDefaultActiveButtonIndex: (a, b) => a + b, }, - '~/brave/ui/app/store/actions': actionSpies, + '../../../../store/actions': actionSpies, '../../../../ducks/gas/gas.duck': gasActionSpies, '../../../../ducks/confirm-transaction/confirm-transaction.duck': confirmTransactionActionSpies, '../../../../ducks/send/send.duck': sendActionSpies, diff --git a/ui/app/components/app/index.scss b/ui/app/components/app/index.scss index 126181d4b..1afbebd00 100644 --- a/ui/app/components/app/index.scss +++ b/ui/app/components/app/index.scss @@ -87,4 +87,3 @@ @import 'multiple-notifications/index'; @import 'signature-request/index'; -/*BRAVE*/@import '../../../../brave/ui/app/components/app/connect-wallet/index.scss';@import '../../../../brave/ui/app/components/app/header/index.scss';@import '../../../../brave/ui/app/components/app/multiple-notifications/index.scss';@import '../../../../brave/ui/app/components/app/provider-page-container/index.scss';@import '../../../../brave/ui/app/components/app/request-signature/index.scss';@import '../../../../brave/ui/app/components/app/style/fonts.scss';@import '../../../../brave/ui/app/components/ui/theme/dark.scss';@import '../../../../brave/ui/app/pages/first-time-flow/create-password/index.scss';@import '../../../../brave/ui/app/pages/first-time-flow/index.scss';@import '../../../../brave/ui/app/pages/first-time-flow/seed-phrase/reveal-seed-phrase/index.scss';@import '../../../../brave/ui/app/pages/first-time-flow/welcome-modal/index.scss';@import '../../../../brave/ui/app/pages/first-time-flow/welcome/index.scss';@import '../../../../brave/ui/app/pages/routes/index.scss';@import '../../../../brave/ui/app/pages/settings/index.scss';@import '../../../../brave/ui/app/pages/settings/networks-tab/network-form/index.scss'; \ No newline at end of file diff --git a/ui/app/components/app/loading-network-screen/loading-network-screen.container.js b/ui/app/components/app/loading-network-screen/loading-network-screen.container.js index 970d8fa62..87f1397ce 100644 --- a/ui/app/components/app/loading-network-screen/loading-network-screen.container.js +++ b/ui/app/components/app/loading-network-screen/loading-network-screen.container.js @@ -1,6 +1,6 @@ import { connect } from 'react-redux' import LoadingNetworkScreen from './loading-network-screen.component' -import actions from '~/brave/ui/app/store/actions' +import actions from '../../../store/actions' import { getNetworkIdentifier } from '../../../selectors/selectors' const mapStateToProps = state => { diff --git a/ui/app/components/app/menu-bar/menu-bar.container.js b/ui/app/components/app/menu-bar/menu-bar.container.js index edda3cea5..059263ff3 100644 --- a/ui/app/components/app/menu-bar/menu-bar.container.js +++ b/ui/app/components/app/menu-bar/menu-bar.container.js @@ -1,7 +1,7 @@ import { connect } from 'react-redux' import { WALLET_VIEW_SIDEBAR } from '../sidebars/sidebar.constants' import MenuBar from './menu-bar.component' -import { showSidebar, hideSidebar } from '~/brave/ui/app/store/actions' +import { showSidebar, hideSidebar } from '../../../store/actions' const mapStateToProps = state => { const { appState: { sidebar: { isOpen } } } = state diff --git a/ui/app/components/app/modals/account-details-modal/account-details-modal.container.js b/ui/app/components/app/modals/account-details-modal/account-details-modal.container.js index 4759fbe86..4b2283ced 100644 --- a/ui/app/components/app/modals/account-details-modal/account-details-modal.container.js +++ b/ui/app/components/app/modals/account-details-modal/account-details-modal.container.js @@ -1,5 +1,5 @@ import { connect } from 'react-redux' -import actions from '~/brave/ui/app/store/actions' +import actions from '../../../../store/actions' import { getSelectedIdentity, getRpcPrefsForCurrentProvider } from '../../../../selectors/selectors' import AccountDetailsModal from './account-details-modal.component' diff --git a/ui/app/components/app/modals/account-modal-container.js b/ui/app/components/app/modals/account-modal-container.js index 9b9c43250..b7ae0b5b8 100644 --- a/ui/app/components/app/modals/account-modal-container.js +++ b/ui/app/components/app/modals/account-modal-container.js @@ -3,7 +3,7 @@ const PropTypes = require('prop-types') const h = require('react-hyperscript') const inherits = require('util').inherits const connect = require('react-redux').connect -const actions = require('~/brave/ui/app/store/actions') +const actions = require('../../../store/actions') const { getSelectedIdentity } = require('../../../selectors/selectors') import Identicon from '../../ui/identicon' diff --git a/ui/app/components/app/modals/add-to-addressbook-modal/add-to-addressbook-modal.container.js b/ui/app/components/app/modals/add-to-addressbook-modal/add-to-addressbook-modal.container.js index 4c022b1fa..413d4aa4a 100644 --- a/ui/app/components/app/modals/add-to-addressbook-modal/add-to-addressbook-modal.container.js +++ b/ui/app/components/app/modals/add-to-addressbook-modal/add-to-addressbook-modal.container.js @@ -1,6 +1,6 @@ import { connect } from 'react-redux' import AddToAddressBookModal from './add-to-addressbook-modal.component' -import actions from '~/brave/ui/app/store/actions' +import actions from '../../../../store/actions' function mapStateToProps (state) { return { diff --git a/ui/app/components/app/modals/cancel-transaction/cancel-transaction.container.js b/ui/app/components/app/modals/cancel-transaction/cancel-transaction.container.js index ba56af8c9..6959889d9 100644 --- a/ui/app/components/app/modals/cancel-transaction/cancel-transaction.container.js +++ b/ui/app/components/app/modals/cancel-transaction/cancel-transaction.container.js @@ -4,7 +4,7 @@ import ethUtil from 'ethereumjs-util' import { multiplyCurrencies } from '../../../../helpers/utils/conversion-util' import withModalProps from '../../../../helpers/higher-order-components/with-modal-props' import CancelTransaction from './cancel-transaction.component' -import { showModal, createCancelTransaction } from '~/brave/ui/app/store/actions' +import { showModal, createCancelTransaction } from '../../../../store/actions' import { getHexGasTotal } from '../../../../helpers/utils/confirm-tx.util' const mapStateToProps = (state, ownProps) => { diff --git a/ui/app/components/app/modals/clear-approved-origins/clear-approved-origins.container.js b/ui/app/components/app/modals/clear-approved-origins/clear-approved-origins.container.js index 51bfd0154..2276bc7e7 100644 --- a/ui/app/components/app/modals/clear-approved-origins/clear-approved-origins.container.js +++ b/ui/app/components/app/modals/clear-approved-origins/clear-approved-origins.container.js @@ -2,7 +2,7 @@ import { connect } from 'react-redux' import { compose } from 'recompose' import withModalProps from '../../../../helpers/higher-order-components/with-modal-props' import ClearApprovedOriginsComponent from './clear-approved-origins.component' -import { clearApprovedOrigins } from '~/brave/ui/app/store/actions' +import { clearApprovedOrigins } from '../../../../store/actions' const mapDispatchToProps = dispatch => { return { diff --git a/ui/app/components/app/modals/confirm-delete-network/confirm-delete-network.container.js b/ui/app/components/app/modals/confirm-delete-network/confirm-delete-network.container.js index 936953890..4c9bb279f 100644 --- a/ui/app/components/app/modals/confirm-delete-network/confirm-delete-network.container.js +++ b/ui/app/components/app/modals/confirm-delete-network/confirm-delete-network.container.js @@ -2,7 +2,7 @@ import { connect } from 'react-redux' import { compose } from 'recompose' import withModalProps from '../../../../helpers/higher-order-components/with-modal-props' import ConfirmDeleteNetwork from './confirm-delete-network.component' -import { delRpcTarget } from '~/brave/ui/app/store/actions' +import { delRpcTarget } from '../../../../store/actions' const mapDispatchToProps = dispatch => { return { diff --git a/ui/app/components/app/modals/confirm-remove-account/confirm-remove-account.component.js b/ui/app/components/app/modals/confirm-remove-account/confirm-remove-account.component.js index c1f770e6d..7fe79be5b 100644 --- a/ui/app/components/app/modals/confirm-remove-account/confirm-remove-account.component.js +++ b/ui/app/components/app/modals/confirm-remove-account/confirm-remove-account.component.js @@ -78,7 +78,7 @@ export default class ConfirmRemoveAccount extends Component { + target="_blank" href="https://metamask.zendesk.com/hc/en-us/articles/360015289932"> { t('learnMore') }
diff --git a/ui/app/components/app/modals/confirm-remove-account/confirm-remove-account.container.js b/ui/app/components/app/modals/confirm-remove-account/confirm-remove-account.container.js index f25685340..0a3cda5b6 100644 --- a/ui/app/components/app/modals/confirm-remove-account/confirm-remove-account.container.js +++ b/ui/app/components/app/modals/confirm-remove-account/confirm-remove-account.container.js @@ -2,7 +2,7 @@ import { connect } from 'react-redux' import { compose } from 'recompose' import ConfirmRemoveAccount from './confirm-remove-account.component' import withModalProps from '../../../../helpers/higher-order-components/with-modal-props' -import { removeAccount } from '~/brave/ui/app/store/actions' +import { removeAccount } from '../../../../store/actions' const mapStateToProps = state => { return { diff --git a/ui/app/components/app/modals/confirm-reset-account/confirm-reset-account.container.js b/ui/app/components/app/modals/confirm-reset-account/confirm-reset-account.container.js index a712ffbc8..ffbd40d9d 100644 --- a/ui/app/components/app/modals/confirm-reset-account/confirm-reset-account.container.js +++ b/ui/app/components/app/modals/confirm-reset-account/confirm-reset-account.container.js @@ -2,7 +2,7 @@ import { connect } from 'react-redux' import { compose } from 'recompose' import withModalProps from '../../../../helpers/higher-order-components/with-modal-props' import ConfirmResetAccount from './confirm-reset-account.component' -import { resetAccount } from '~/brave/ui/app/store/actions' +import { resetAccount } from '../../../../store/actions' const mapDispatchToProps = dispatch => { return { diff --git a/ui/app/components/app/modals/deposit-ether-modal.js b/ui/app/components/app/modals/deposit-ether-modal.js index dea2cbbff..f71e0619e 100644 --- a/ui/app/components/app/modals/deposit-ether-modal.js +++ b/ui/app/components/app/modals/deposit-ether-modal.js @@ -3,7 +3,7 @@ const PropTypes = require('prop-types') const h = require('react-hyperscript') const inherits = require('util').inherits const connect = require('react-redux').connect -const actions = require('~/brave/ui/app/store/actions') +const actions = require('../../../store/actions') const { getNetworkDisplayName } = require('../../../../../app/scripts/controllers/network/util') import Button from '../../ui/button' diff --git a/ui/app/components/app/modals/export-private-key-modal.js b/ui/app/components/app/modals/export-private-key-modal.js index 7352bcb00..1e1aaeb74 100644 --- a/ui/app/components/app/modals/export-private-key-modal.js +++ b/ui/app/components/app/modals/export-private-key-modal.js @@ -5,7 +5,7 @@ const h = require('react-hyperscript') const inherits = require('util').inherits const connect = require('react-redux').connect const { stripHexPrefix } = require('ethereumjs-util') -const actions = require('~/brave/ui/app/store/actions') +const actions = require('../../../store/actions') const AccountModalContainer = require('./account-modal-container') const { getSelectedIdentity } = require('../../../selectors/selectors') const ReadOnlyInput = require('../../ui/readonly-input') diff --git a/ui/app/components/app/modals/hide-token-confirmation-modal.js b/ui/app/components/app/modals/hide-token-confirmation-modal.js index c7efc2fea..e2b098923 100644 --- a/ui/app/components/app/modals/hide-token-confirmation-modal.js +++ b/ui/app/components/app/modals/hide-token-confirmation-modal.js @@ -3,7 +3,7 @@ const PropTypes = require('prop-types') const h = require('react-hyperscript') const inherits = require('util').inherits const connect = require('react-redux').connect -const actions = require('~/brave/ui/app/store/actions') +const actions = require('../../../store/actions') import Identicon from '../../ui/identicon' function mapStateToProps (state) { diff --git a/ui/app/components/app/modals/metametrics-opt-in-modal/metametrics-opt-in-modal.container.js b/ui/app/components/app/modals/metametrics-opt-in-modal/metametrics-opt-in-modal.container.js index 7344261bb..ea7d71a73 100644 --- a/ui/app/components/app/modals/metametrics-opt-in-modal/metametrics-opt-in-modal.container.js +++ b/ui/app/components/app/modals/metametrics-opt-in-modal/metametrics-opt-in-modal.container.js @@ -2,7 +2,7 @@ import { connect } from 'react-redux' import { compose } from 'recompose' import MetaMetricsOptInModal from './metametrics-opt-in-modal.component' import withModalProps from '../../../../helpers/higher-order-components/with-modal-props' -import { setParticipateInMetaMetrics } from '~/brave/ui/app/store/actions' +import { setParticipateInMetaMetrics } from '../../../../store/actions' const mapStateToProps = (_, ownProps) => { const { unapprovedTxCount } = ownProps diff --git a/ui/app/components/app/modals/modal.js b/ui/app/components/app/modals/modal.js index 325e973ee..ada758b99 100644 --- a/ui/app/components/app/modals/modal.js +++ b/ui/app/components/app/modals/modal.js @@ -3,7 +3,7 @@ const h = require('react-hyperscript') const inherits = require('util').inherits const connect = require('react-redux').connect const FadeModal = require('boron').FadeModal -const actions = require('~/brave/ui/app/store/actions') +const actions = require('../../../store/actions') const { resetCustomData: resetCustomGasData } = require('../../../ducks/gas/gas.duck') const isMobileView = require('../../../../lib/is-mobile-view') const { getEnvironmentType } = require('../../../../../app/scripts/lib/util') diff --git a/ui/app/components/app/modals/notification-modal.js b/ui/app/components/app/modals/notification-modal.js index ffe0a680f..a4282595f 100644 --- a/ui/app/components/app/modals/notification-modal.js +++ b/ui/app/components/app/modals/notification-modal.js @@ -2,7 +2,7 @@ const { Component } = require('react') const PropTypes = require('prop-types') const h = require('react-hyperscript') const connect = require('react-redux').connect -const actions = require('~/brave/ui/app/store/actions') +const actions = require('../../../store/actions') class NotificationModal extends Component { static contextProps = { diff --git a/ui/app/components/app/modals/qr-scanner/qr-scanner.container.js b/ui/app/components/app/modals/qr-scanner/qr-scanner.container.js index 1633e1249..2210fbed2 100644 --- a/ui/app/components/app/modals/qr-scanner/qr-scanner.container.js +++ b/ui/app/components/app/modals/qr-scanner/qr-scanner.container.js @@ -1,10 +1,10 @@ import { connect } from 'react-redux' import QrScanner from './qr-scanner.component' -const { hideModal, qrCodeDetected, showQrScanner } = require('~/brave/ui/app/store/actions') +const { hideModal, qrCodeDetected, showQrScanner } = require('../../../../store/actions') import { SEND_ROUTE, -} from '~/brave/ui/app/helpers/constants/routes' +} from '../../../../helpers/constants/routes' const mapStateToProps = state => { return { diff --git a/ui/app/components/app/provider-page-container/provider-page-container-content/provider-page-container-content.component.js b/ui/app/components/app/provider-page-container/provider-page-container-content/provider-page-container-content.component.js index 4eee68be0..4062b130f 100644 --- a/ui/app/components/app/provider-page-container/provider-page-container-content/provider-page-container-content.component.js +++ b/ui/app/components/app/provider-page-container/provider-page-container-content/provider-page-container-content.component.js @@ -70,7 +70,7 @@ export default class ProviderPageContainerContent extends PureComponent { {t('providerRequestInfo')}
diff --git a/ui/app/components/app/shift-list-item.js b/ui/app/components/app/shift-list-item.js index ef5bb39c9..f5fa00047 100644 --- a/ui/app/components/app/shift-list-item.js +++ b/ui/app/components/app/shift-list-item.js @@ -4,7 +4,7 @@ const PropTypes = require('prop-types') const h = require('react-hyperscript') const connect = require('react-redux').connect const explorerLink = require('etherscan-link').createExplorerLink -const actions = require('~/brave/ui/app/store/actions') +const actions = require('../../store/actions') const { formatDate, addressSummary } = require('../../helpers/utils/util') const CopyButton = require('../ui/copyButton') diff --git a/ui/app/components/app/signature-request-original.js b/ui/app/components/app/signature-request-original.js index 31a8932b9..e23d724cb 100644 --- a/ui/app/components/app/signature-request-original.js +++ b/ui/app/components/app/signature-request-original.js @@ -14,7 +14,7 @@ const { ObjectInspector } = require('react-inspector') import AccountListItem from '../../pages/send/account-list-item/account-list-item.component' -const actions = require('~/brave/ui/app/store/actions') +const actions = require('../../store/actions') const { conversionUtil } = require('../../helpers/utils/conversion-util') const { @@ -27,7 +27,7 @@ const { import { clearConfirmTransaction } from '../../ducks/confirm-transaction/confirm-transaction.duck' import Button from '../ui/button' -const { DEFAULT_ROUTE } = require('~/brave/ui/app/helpers/constants/routes') +const { DEFAULT_ROUTE } = require('../../helpers/constants/routes') function mapStateToProps (state) { return { diff --git a/ui/app/components/app/signature-request/signature-request.container.js b/ui/app/components/app/signature-request/signature-request.container.js index 37e659646..0b09c1a64 100644 --- a/ui/app/components/app/signature-request/signature-request.container.js +++ b/ui/app/components/app/signature-request/signature-request.container.js @@ -2,7 +2,7 @@ import { connect } from 'react-redux' import { withRouter } from 'react-router-dom' import { compose } from 'recompose' import SignatureRequest from './signature-request.component' -import { goHome } from '~/brave/ui/app/store/actions' +import { goHome } from '../../../store/actions' import { clearConfirmTransaction } from '../../../ducks/confirm-transaction/confirm-transaction.duck' import { getSelectedAccount, diff --git a/ui/app/components/app/token-cell.js b/ui/app/components/app/token-cell.js index d71228065..495b9502b 100644 --- a/ui/app/components/app/token-cell.js +++ b/ui/app/components/app/token-cell.js @@ -6,10 +6,10 @@ const connect = require('react-redux').connect import Identicon from '../ui/identicon' const prefixForNetwork = require('../../../lib/etherscan-prefix-for-network') const selectors = require('../../selectors/selectors') -const actions = require('~/brave/ui/app/store/actions') +const actions = require('../../store/actions') const { conversionUtil, multiplyCurrencies } = require('../../helpers/utils/conversion-util') -const TokenMenuDropdown = require('~/brave/ui/app/components/app/dropdowns/token-menu-dropdown') +const TokenMenuDropdown = require('./dropdowns/token-menu-dropdown.js') function mapStateToProps (state) { return { diff --git a/ui/app/components/app/transaction-list-item-details/transaction-list-item-details.container.js b/ui/app/components/app/transaction-list-item-details/transaction-list-item-details.container.js index 7da608a6c..50f93f497 100644 --- a/ui/app/components/app/transaction-list-item-details/transaction-list-item-details.container.js +++ b/ui/app/components/app/transaction-list-item-details/transaction-list-item-details.container.js @@ -1,7 +1,7 @@ import { connect } from 'react-redux' import TransactionListItemDetails from './transaction-list-item-details.component' import { checksumAddress } from '../../../helpers/utils/util' -import { tryReverseResolveAddress } from '~/brave/ui/app/store/actions' +import { tryReverseResolveAddress } from '../../../store/actions' const mapStateToProps = (state, ownProps) => { const { metamask } = state diff --git a/ui/app/components/app/transaction-list-item/transaction-list-item.component.js b/ui/app/components/app/transaction-list-item/transaction-list-item.component.js index 209f9cac7..9ab0105f9 100644 --- a/ui/app/components/app/transaction-list-item/transaction-list-item.component.js +++ b/ui/app/components/app/transaction-list-item/transaction-list-item.component.js @@ -8,7 +8,7 @@ import UserPreferencedCurrencyDisplay from '../user-preferenced-currency-display import TokenCurrencyDisplay from '../../ui/token-currency-display' import TransactionListItemDetails from '../transaction-list-item-details' import TransactionTimeRemaining from '../transaction-time-remaining' -import { CONFIRM_TRANSACTION_ROUTE } from '~/brave/ui/app/helpers/constants/routes' +import { CONFIRM_TRANSACTION_ROUTE } from '../../../helpers/constants/routes' import { UNAPPROVED_STATUS, TOKEN_METHOD_TRANSFER } from '../../../helpers/constants/transactions' import { PRIMARY, SECONDARY } from '../../../helpers/constants/common' import { getStatusKey } from '../../../helpers/utils/transactions.util' diff --git a/ui/app/components/app/transaction-list-item/transaction-list-item.container.js b/ui/app/components/app/transaction-list-item/transaction-list-item.container.js index f7eb36025..26ccec1f7 100644 --- a/ui/app/components/app/transaction-list-item/transaction-list-item.container.js +++ b/ui/app/components/app/transaction-list-item/transaction-list-item.container.js @@ -2,7 +2,7 @@ import { connect } from 'react-redux' import { withRouter } from 'react-router-dom' import { compose } from 'recompose' import TransactionListItem from './transaction-list-item.component' -import { setSelectedToken, showModal, showSidebar, getContractMethodData } from '~/brave/ui/app/store/actions' +import { setSelectedToken, showModal, showSidebar, getContractMethodData } from '../../../store/actions' import { hexToDecimal } from '../../../helpers/utils/conversions.util' import { getTokenData } from '../../../helpers/utils/transactions.util' import { getHexGasTotal, increaseLastGasPrice } from '../../../helpers/utils/confirm-tx.util' diff --git a/ui/app/components/app/transaction-list/transaction-list.container.js b/ui/app/components/app/transaction-list/transaction-list.container.js index 816482edb..4da044b2a 100644 --- a/ui/app/components/app/transaction-list/transaction-list.container.js +++ b/ui/app/components/app/transaction-list/transaction-list.container.js @@ -8,7 +8,7 @@ import { } from '../../../selectors/transactions' import { getSelectedAddress, getAssetImages, getFeatureFlags } from '../../../selectors/selectors' import { selectedTokenSelector } from '../../../selectors/tokens' -import { updateNetworkNonce } from '~/brave/ui/app/store/actions' +import { updateNetworkNonce } from '../../../store/actions' import { fetchBasicGasAndTimeEstimates, fetchGasEstimates } from '../../../ducks/gas/gas.duck' const mapStateToProps = (state) => { diff --git a/ui/app/components/app/transaction-view-balance/tests/token-view-balance.component.test.js b/ui/app/components/app/transaction-view-balance/tests/token-view-balance.component.test.js index aceda38ac..0e2882e9c 100644 --- a/ui/app/components/app/transaction-view-balance/tests/token-view-balance.component.test.js +++ b/ui/app/components/app/transaction-view-balance/tests/token-view-balance.component.test.js @@ -4,7 +4,7 @@ import { shallow } from 'enzyme' import sinon from 'sinon' import TokenBalance from '../../../ui/token-balance' import UserPreferencedCurrencyDisplay from '../../user-preferenced-currency-display' -import { SEND_ROUTE } from '~/brave/ui/app/helpers/constants/routes' +import { SEND_ROUTE } from '../../../../helpers/constants/routes' import TransactionViewBalance from '../transaction-view-balance.component' const propsMethodSpies = { diff --git a/ui/app/components/app/transaction-view-balance/transaction-view-balance.component.js b/ui/app/components/app/transaction-view-balance/transaction-view-balance.component.js index 49921c9af..73905574e 100644 --- a/ui/app/components/app/transaction-view-balance/transaction-view-balance.component.js +++ b/ui/app/components/app/transaction-view-balance/transaction-view-balance.component.js @@ -5,7 +5,7 @@ import Button from '../../ui/button' import Identicon from '../../ui/identicon' import TokenBalance from '../../ui/token-balance' import UserPreferencedCurrencyDisplay from '../user-preferenced-currency-display' -import { SEND_ROUTE } from '~/brave/ui/app/helpers/constants/routes' +import { SEND_ROUTE } from '../../../helpers/constants/routes' import { PRIMARY, SECONDARY } from '../../../helpers/constants/common' import Tooltip from '../../ui/tooltip-v2' diff --git a/ui/app/components/app/transaction-view-balance/transaction-view-balance.container.js b/ui/app/components/app/transaction-view-balance/transaction-view-balance.container.js index 065019a2a..41a4525dc 100644 --- a/ui/app/components/app/transaction-view-balance/transaction-view-balance.container.js +++ b/ui/app/components/app/transaction-view-balance/transaction-view-balance.container.js @@ -12,7 +12,7 @@ import { preferencesSelector, getIsMainnet, } from '../../../selectors/selectors' -import { showModal } from '~/brave/ui/app/store/actions' +import { showModal } from '../../../store/actions' const mapStateToProps = state => { const { showFiatInTestnets } = preferencesSelector(state) diff --git a/ui/app/components/app/wallet-view.js b/ui/app/components/app/wallet-view.js index 8a6d1aa47..55aeec333 100644 --- a/ui/app/components/app/wallet-view.js +++ b/ui/app/components/app/wallet-view.js @@ -7,11 +7,11 @@ const { compose } = require('recompose') const inherits = require('util').inherits const { checksumAddress } = require('../../helpers/utils/util') // const AccountDropdowns = require('./dropdowns/index.js').AccountDropdowns -const actions = require('~/brave/ui/app/store/actions') +const actions = require('../../store/actions') import BalanceComponent from '../ui/balance' const TokenList = require('./token-list') const selectors = require('../../selectors/selectors') -const { ADD_TOKEN_ROUTE } = require('~/brave/ui/app/helpers/constants/routes') +const { ADD_TOKEN_ROUTE } = require('../../helpers/constants/routes') import AddTokenButton from './add-token-button' import AccountDetails from './account-details' diff --git a/ui/app/components/ui/metafox-logo/index.js b/ui/app/components/ui/metafox-logo/index.js index 60a3c8f23..0aeaed743 100644 --- a/ui/app/components/ui/metafox-logo/index.js +++ b/ui/app/components/ui/metafox-logo/index.js @@ -1 +1 @@ -export { default } from '~/brave/ui/app/components/ui/metafox-logo/metafox-logo.component' +export { default } from './metafox-logo.component' diff --git a/ui/app/ducks/app/app.js b/ui/app/ducks/app/app.js index 7f768523f..fbdaf7b8d 100644 --- a/ui/app/ducks/app/app.js +++ b/ui/app/ducks/app/app.js @@ -1,5 +1,5 @@ const extend = require('xtend') -const actions = require('~/brave/ui/app/store/actions') +const actions = require('../../store/actions') const txHelper = require('../../../lib/tx-helper') const log = require('loglevel') diff --git a/ui/app/ducks/index.js b/ui/app/ducks/index.js index 12bd46d51..6808252ef 100644 --- a/ui/app/ducks/index.js +++ b/ui/app/ducks/index.js @@ -5,7 +5,7 @@ const copyToClipboard = require('copy-to-clipboard') // // Sub-Reducers take in the complete state and return their sub-state // -const reduceMetamask = require('~/brave/ui/app/ducks/metamask/metamask') +const reduceMetamask = require('./metamask/metamask') const reduceLocale = require('./locale/locale') const reduceSend = require('./send/send.duck').default import reduceApp from './app/app' diff --git a/ui/app/ducks/locale/locale.js b/ui/app/ducks/locale/locale.js index 5e5aaf04f..747e227ec 100644 --- a/ui/app/ducks/locale/locale.js +++ b/ui/app/ducks/locale/locale.js @@ -1,5 +1,5 @@ const extend = require('xtend') -const actions = require('~/brave/ui/app/store/actions') +const actions = require('../../store/actions') module.exports = reduceMetamask diff --git a/ui/app/ducks/metamask/metamask.js b/ui/app/ducks/metamask/metamask.js index a51dc22a2..5eb590231 100644 --- a/ui/app/ducks/metamask/metamask.js +++ b/ui/app/ducks/metamask/metamask.js @@ -1,5 +1,5 @@ const extend = require('xtend') -const actions = require('~/brave/ui/app/store/actions') +const actions = require('../../store/actions') const { getEnvironmentType } = require('../../../../app/scripts/lib/util') const { ENVIRONMENT_TYPE_POPUP } = require('../../../../app/scripts/lib/enums') const { OLD_UI_NETWORK_TYPE } = require('../../../../app/scripts/controllers/network/enums') diff --git a/ui/app/helpers/higher-order-components/authenticated/authenticated.component.js b/ui/app/helpers/higher-order-components/authenticated/authenticated.component.js index c4651aff0..c195d0e21 100644 --- a/ui/app/helpers/higher-order-components/authenticated/authenticated.component.js +++ b/ui/app/helpers/higher-order-components/authenticated/authenticated.component.js @@ -1,7 +1,7 @@ import React from 'react' import PropTypes from 'prop-types' import { Redirect, Route } from 'react-router-dom' -import { UNLOCK_ROUTE, INITIALIZE_ROUTE } from '~/brave/ui/app/helpers/constants/routes' +import { UNLOCK_ROUTE, INITIALIZE_ROUTE } from '../../constants/routes' export default function Authenticated (props) { const { isUnlocked, completedOnboarding } = props diff --git a/ui/app/helpers/higher-order-components/initialized/initialized.component.js b/ui/app/helpers/higher-order-components/initialized/initialized.component.js index 3925c9841..2042c0046 100644 --- a/ui/app/helpers/higher-order-components/initialized/initialized.component.js +++ b/ui/app/helpers/higher-order-components/initialized/initialized.component.js @@ -1,7 +1,7 @@ import React from 'react' import PropTypes from 'prop-types' import { Redirect, Route } from 'react-router-dom' -import { INITIALIZE_ROUTE } from '~/brave/ui/app/helpers/constants/routes' +import { INITIALIZE_ROUTE } from '../../constants/routes' export default function Initialized (props) { return props.completedOnboarding diff --git a/ui/app/helpers/higher-order-components/with-modal-props/with-modal-props.js b/ui/app/helpers/higher-order-components/with-modal-props/with-modal-props.js index 45152bdf6..aac6b5a61 100644 --- a/ui/app/helpers/higher-order-components/with-modal-props/with-modal-props.js +++ b/ui/app/helpers/higher-order-components/with-modal-props/with-modal-props.js @@ -1,5 +1,5 @@ import { connect } from 'react-redux' -import { hideModal } from '~/brave/ui/app/store/actions' +import { hideModal } from '../../../store/actions' const mapStateToProps = state => { const { appState } = state diff --git a/ui/app/pages/add-token/add-token.component.js b/ui/app/pages/add-token/add-token.component.js index 8ceb8393a..40c1ff7fd 100644 --- a/ui/app/pages/add-token/add-token.component.js +++ b/ui/app/pages/add-token/add-token.component.js @@ -3,7 +3,7 @@ import PropTypes from 'prop-types' import ethUtil from 'ethereumjs-util' import { checkExistingAddresses } from './util' import { tokenInfoGetter } from '../../helpers/utils/token-util' -import { DEFAULT_ROUTE, CONFIRM_ADD_TOKEN_ROUTE } from '~/brave/ui/app/helpers/constants/routes' +import { DEFAULT_ROUTE, CONFIRM_ADD_TOKEN_ROUTE } from '../../helpers/constants/routes' import TextField from '../../components/ui/text-field' import TokenList from './token-list' import TokenSearch from './token-search' diff --git a/ui/app/pages/add-token/add-token.container.js b/ui/app/pages/add-token/add-token.container.js index 81660207a..eee16dfc7 100644 --- a/ui/app/pages/add-token/add-token.container.js +++ b/ui/app/pages/add-token/add-token.container.js @@ -1,7 +1,7 @@ import { connect } from 'react-redux' import AddToken from './add-token.component' -const { setPendingTokens, clearPendingTokens } = require('~/brave/ui/app/store/actions') +const { setPendingTokens, clearPendingTokens } = require('../../store/actions') const mapStateToProps = ({ metamask }) => { const { identities, tokens, pendingTokens } = metamask diff --git a/ui/app/pages/confirm-add-suggested-token/confirm-add-suggested-token.component.js b/ui/app/pages/confirm-add-suggested-token/confirm-add-suggested-token.component.js index 83da71483..7430933b3 100644 --- a/ui/app/pages/confirm-add-suggested-token/confirm-add-suggested-token.component.js +++ b/ui/app/pages/confirm-add-suggested-token/confirm-add-suggested-token.component.js @@ -1,6 +1,6 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' -import { DEFAULT_ROUTE } from '~/brave/ui/app/helpers/constants/routes' +import { DEFAULT_ROUTE } from '../../helpers/constants/routes' import Button from '../../components/ui/button' import Identicon from '../../components/ui/identicon' import TokenBalance from '../../components/ui/token-balance' diff --git a/ui/app/pages/confirm-add-suggested-token/confirm-add-suggested-token.container.js b/ui/app/pages/confirm-add-suggested-token/confirm-add-suggested-token.container.js index 289eba192..63932ffa5 100644 --- a/ui/app/pages/confirm-add-suggested-token/confirm-add-suggested-token.container.js +++ b/ui/app/pages/confirm-add-suggested-token/confirm-add-suggested-token.container.js @@ -5,7 +5,7 @@ import { withRouter } from 'react-router-dom' const extend = require('xtend') -const { addToken, removeSuggestedTokens } = require('~/brave/ui/app/store/actions') +const { addToken, removeSuggestedTokens } = require('../../store/actions') const mapStateToProps = ({ metamask }) => { const { pendingTokens, suggestedTokens, tokens } = metamask diff --git a/ui/app/pages/confirm-add-token/confirm-add-token.component.js b/ui/app/pages/confirm-add-token/confirm-add-token.component.js index 94c88c54c..d918d7e39 100644 --- a/ui/app/pages/confirm-add-token/confirm-add-token.component.js +++ b/ui/app/pages/confirm-add-token/confirm-add-token.component.js @@ -1,6 +1,6 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' -import { DEFAULT_ROUTE, ADD_TOKEN_ROUTE } from '~/brave/ui/app/helpers/constants/routes' +import { DEFAULT_ROUTE, ADD_TOKEN_ROUTE } from '../../helpers/constants/routes' import Button from '../../components/ui/button' import Identicon from '../../components/ui/identicon' import TokenBalance from '../../components/ui/token-balance' diff --git a/ui/app/pages/confirm-add-token/confirm-add-token.container.js b/ui/app/pages/confirm-add-token/confirm-add-token.container.js index 73acd8448..961626177 100644 --- a/ui/app/pages/confirm-add-token/confirm-add-token.container.js +++ b/ui/app/pages/confirm-add-token/confirm-add-token.container.js @@ -1,7 +1,7 @@ import { connect } from 'react-redux' import ConfirmAddToken from './confirm-add-token.component' -const { addTokens, clearPendingTokens } = require('~/brave/ui/app/store/actions') +const { addTokens, clearPendingTokens } = require('../../store/actions') const mapStateToProps = ({ metamask }) => { const { pendingTokens } = metamask diff --git a/ui/app/pages/confirm-approve/confirm-approve.container.js b/ui/app/pages/confirm-approve/confirm-approve.container.js index dc93df50e..185c0f9c6 100644 --- a/ui/app/pages/confirm-approve/confirm-approve.container.js +++ b/ui/app/pages/confirm-approve/confirm-approve.container.js @@ -5,7 +5,7 @@ import { contractExchangeRateSelector, transactionFeeSelector, } from '../../selectors/confirm-transaction' -import { showModal } from '~/brave/ui/app/store/actions' +import { showModal } from '../../store/actions' import { tokenSelector } from '../../selectors/tokens' import { getTokenData, diff --git a/ui/app/pages/confirm-send-ether/confirm-send-ether.component.js b/ui/app/pages/confirm-send-ether/confirm-send-ether.component.js index cda0d0f91..6bc252dbb 100644 --- a/ui/app/pages/confirm-send-ether/confirm-send-ether.component.js +++ b/ui/app/pages/confirm-send-ether/confirm-send-ether.component.js @@ -1,7 +1,7 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' import ConfirmTransactionBase from '../confirm-transaction-base' -import { SEND_ROUTE } from '~/brave/ui/app/helpers/constants/routes' +import { SEND_ROUTE } from '../../helpers/constants/routes' export default class ConfirmSendEther extends Component { static contextTypes = { diff --git a/ui/app/pages/confirm-send-ether/confirm-send-ether.container.js b/ui/app/pages/confirm-send-ether/confirm-send-ether.container.js index 457d58c12..713da702d 100644 --- a/ui/app/pages/confirm-send-ether/confirm-send-ether.container.js +++ b/ui/app/pages/confirm-send-ether/confirm-send-ether.container.js @@ -1,7 +1,7 @@ import { connect } from 'react-redux' import { compose } from 'recompose' import { withRouter } from 'react-router-dom' -import { updateSend } from '~/brave/ui/app/store/actions' +import { updateSend } from '../../store/actions' import { clearConfirmTransaction } from '../../ducks/confirm-transaction/confirm-transaction.duck' import ConfirmSendEther from './confirm-send-ether.component' diff --git a/ui/app/pages/confirm-send-token/confirm-send-token.component.js b/ui/app/pages/confirm-send-token/confirm-send-token.component.js index 62395d541..7f3b1c082 100644 --- a/ui/app/pages/confirm-send-token/confirm-send-token.component.js +++ b/ui/app/pages/confirm-send-token/confirm-send-token.component.js @@ -1,7 +1,7 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' import ConfirmTokenTransactionBase from '../confirm-token-transaction-base' -import { SEND_ROUTE } from '~/brave/ui/app/helpers/constants/routes' +import { SEND_ROUTE } from '../../helpers/constants/routes' export default class ConfirmSendToken extends Component { static propTypes = { diff --git a/ui/app/pages/confirm-send-token/confirm-send-token.container.js b/ui/app/pages/confirm-send-token/confirm-send-token.container.js index 4dc383942..db9b08c48 100644 --- a/ui/app/pages/confirm-send-token/confirm-send-token.container.js +++ b/ui/app/pages/confirm-send-token/confirm-send-token.container.js @@ -3,7 +3,7 @@ import { compose } from 'recompose' import { withRouter } from 'react-router-dom' import ConfirmSendToken from './confirm-send-token.component' import { clearConfirmTransaction } from '../../ducks/confirm-transaction/confirm-transaction.duck' -import { setSelectedToken, updateSend, showSendTokenPage } from '~/brave/ui/app/store/actions' +import { setSelectedToken, updateSend, showSendTokenPage } from '../../store/actions' import { conversionUtil } from '../../helpers/utils/conversion-util' import { sendTokenTokenAmountAndToAddressSelector } from '../../selectors/confirm-transaction' diff --git a/ui/app/pages/confirm-transaction-base/confirm-transaction-base.component.js b/ui/app/pages/confirm-transaction-base/confirm-transaction-base.component.js index e0da03e9d..f67daca62 100644 --- a/ui/app/pages/confirm-transaction-base/confirm-transaction-base.component.js +++ b/ui/app/pages/confirm-transaction-base/confirm-transaction-base.component.js @@ -5,7 +5,7 @@ import { ENVIRONMENT_TYPE_NOTIFICATION } from '../../../../app/scripts/lib/enums import { getEnvironmentType } from '../../../../app/scripts/lib/util' import ConfirmPageContainer, { ConfirmDetailRow } from '../../components/app/confirm-page-container' import { isBalanceSufficient } from '../send/send.utils' -import { DEFAULT_ROUTE, CONFIRM_TRANSACTION_ROUTE } from '~/brave/ui/app/helpers/constants/routes' +import { DEFAULT_ROUTE, CONFIRM_TRANSACTION_ROUTE } from '../../helpers/constants/routes' import { INSUFFICIENT_FUNDS_ERROR_KEY, TRANSACTION_ERROR_KEY, diff --git a/ui/app/pages/confirm-transaction-base/confirm-transaction-base.container.js b/ui/app/pages/confirm-transaction-base/confirm-transaction-base.container.js index a4006774a..139edbc02 100644 --- a/ui/app/pages/confirm-transaction-base/confirm-transaction-base.container.js +++ b/ui/app/pages/confirm-transaction-base/confirm-transaction-base.container.js @@ -18,7 +18,7 @@ import { updateTransaction, getNextNonce, tryReverseResolveAddress, -} from '~/brave/ui/app/store/actions' +} from '../../store/actions' import { INSUFFICIENT_FUNDS_ERROR_KEY, GAS_LIMIT_TOO_LOW_ERROR_KEY, diff --git a/ui/app/pages/confirm-transaction-switch/confirm-transaction-switch.component.js b/ui/app/pages/confirm-transaction-switch/confirm-transaction-switch.component.js index 2f85fb661..fc0606365 100644 --- a/ui/app/pages/confirm-transaction-switch/confirm-transaction-switch.component.js +++ b/ui/app/pages/confirm-transaction-switch/confirm-transaction-switch.component.js @@ -11,7 +11,7 @@ import { CONFIRM_TRANSFER_FROM_PATH, CONFIRM_TOKEN_METHOD_PATH, SIGNATURE_REQUEST_PATH, -} from '~/brave/ui/app/helpers/constants/routes' +} from '../../helpers/constants/routes' import { TOKEN_METHOD_TRANSFER, TOKEN_METHOD_APPROVE, diff --git a/ui/app/pages/confirm-transaction/conf-tx.js b/ui/app/pages/confirm-transaction/conf-tx.js index 920e3f498..ce1edde5c 100644 --- a/ui/app/pages/confirm-transaction/conf-tx.js +++ b/ui/app/pages/confirm-transaction/conf-tx.js @@ -4,7 +4,7 @@ const h = require('react-hyperscript') const connect = require('react-redux').connect const { withRouter } = require('react-router-dom') const { compose } = require('recompose') -const actions = require('~/brave/ui/app/store/actions') +const actions = require('../../store/actions') const txHelper = require('../../../lib/tx-helper') const log = require('loglevel') const R = require('ramda') @@ -12,7 +12,7 @@ const R = require('ramda') const SignatureRequest = require('../../components/app/signature-request').default const SignatureRequestOriginal = require('../../components/app/signature-request-original') const Loading = require('../../components/ui/loading-screen') -const { DEFAULT_ROUTE } = require('~/brave/ui/app/helpers/constants/routes') +const { DEFAULT_ROUTE } = require('../../helpers/constants/routes') module.exports = compose( withRouter, diff --git a/ui/app/pages/confirm-transaction/confirm-transaction.component.js b/ui/app/pages/confirm-transaction/confirm-transaction.component.js index 42d8121ba..9cb69e0da 100644 --- a/ui/app/pages/confirm-transaction/confirm-transaction.component.js +++ b/ui/app/pages/confirm-transaction/confirm-transaction.component.js @@ -20,7 +20,7 @@ import { CONFIRM_TRANSFER_FROM_PATH, CONFIRM_TOKEN_METHOD_PATH, SIGNATURE_REQUEST_PATH, -} from '~/brave/ui/app/helpers/constants/routes' +} from '../../helpers/constants/routes' export default class ConfirmTransaction extends Component { static contextTypes = { diff --git a/ui/app/pages/confirm-transaction/confirm-transaction.container.js b/ui/app/pages/confirm-transaction/confirm-transaction.container.js index c04446617..9a45c6405 100644 --- a/ui/app/pages/confirm-transaction/confirm-transaction.container.js +++ b/ui/app/pages/confirm-transaction/confirm-transaction.container.js @@ -15,7 +15,7 @@ import { import { getContractMethodData, getTokenParams, -} from '~/brave/ui/app/store/actions' +} from '../../store/actions' import ConfirmTransaction from './confirm-transaction.component' import { unconfirmedTransactionsListSelector } from '../../selectors/confirm-transaction' diff --git a/ui/app/pages/create-account/connect-hardware/index.js b/ui/app/pages/create-account/connect-hardware/index.js index c0932f7cb..ff8506142 100644 --- a/ui/app/pages/create-account/connect-hardware/index.js +++ b/ui/app/pages/create-account/connect-hardware/index.js @@ -2,11 +2,11 @@ const { Component } = require('react') const PropTypes = require('prop-types') const h = require('react-hyperscript') const connect = require('react-redux').connect -const actions = require('~/brave/ui/app/store/actions') +const actions = require('../../../store/actions') const { getMetaMaskAccounts } = require('../../../selectors/selectors') -const ConnectScreen = require('~/brave/ui/app/pages/create-account/connect-hardware/connect-screen') +const ConnectScreen = require('./connect-screen') const AccountList = require('./account-list') -const { DEFAULT_ROUTE } = require('~/brave/ui/app/helpers/constants/routes') +const { DEFAULT_ROUTE } = require('../../../helpers/constants/routes') const { formatBalance } = require('../../../helpers/utils/util') class ConnectHardwareForm extends Component { diff --git a/ui/app/pages/create-account/create-account.component.js b/ui/app/pages/create-account/create-account.component.js index 3f3ffd843..aa05af975 100644 --- a/ui/app/pages/create-account/create-account.component.js +++ b/ui/app/pages/create-account/create-account.component.js @@ -9,7 +9,7 @@ import { NEW_ACCOUNT_ROUTE, IMPORT_ACCOUNT_ROUTE, CONNECT_HARDWARE_ROUTE, -} from '~/brave/ui/app/helpers/constants/routes' +} from '../../helpers/constants/routes' export default class CreateAccountPage extends Component { renderTabs () { diff --git a/ui/app/pages/create-account/create-account.container.js b/ui/app/pages/create-account/create-account.container.js index 9c8745f15..04205cfea 100644 --- a/ui/app/pages/create-account/create-account.container.js +++ b/ui/app/pages/create-account/create-account.container.js @@ -1,5 +1,5 @@ import { connect } from 'react-redux' -import actions from '~/brave/ui/app/store/actions' +import actions from '../../store/actions' import { getCurrentViewContext } from '../../selectors/selectors' import CreateAccountPage from './create-account.component' diff --git a/ui/app/pages/create-account/import-account/index.js b/ui/app/pages/create-account/import-account/index.js index c77abb7d2..48d8f8838 100644 --- a/ui/app/pages/create-account/import-account/index.js +++ b/ui/app/pages/create-account/import-account/index.js @@ -46,7 +46,7 @@ AccountImportSubview.prototype.render = function () { }, onClick: () => { global.platform.openWindow({ - url: 'https://support.brave.com/hc/en-us/articles/360035488071-How-do-I-manage-my-Crypto-Wallets-', + url: 'https://metamask.zendesk.com/hc/en-us/articles/360015289932', }) }, }, this.context.t('here')), diff --git a/ui/app/pages/create-account/import-account/json.js b/ui/app/pages/create-account/import-account/json.js index fa5f32b8c..b0fb63dbf 100644 --- a/ui/app/pages/create-account/import-account/json.js +++ b/ui/app/pages/create-account/import-account/json.js @@ -4,9 +4,9 @@ const h = require('react-hyperscript') const { withRouter } = require('react-router-dom') const { compose } = require('recompose') const connect = require('react-redux').connect -const actions = require('~/brave/ui/app/store/actions') +const actions = require('../../../store/actions') const FileInput = require('react-simple-file-input').default -const { DEFAULT_ROUTE } = require('~/brave/ui/app/helpers/constants/routes') +const { DEFAULT_ROUTE } = require('../../../helpers/constants/routes') const { getMetaMaskAccounts } = require('../../../selectors/selectors') import Button from '../../../components/ui/button' diff --git a/ui/app/pages/create-account/import-account/private-key.js b/ui/app/pages/create-account/import-account/private-key.js index 2ca12f9e9..0cdf25ce9 100644 --- a/ui/app/pages/create-account/import-account/private-key.js +++ b/ui/app/pages/create-account/import-account/private-key.js @@ -5,8 +5,8 @@ const { withRouter } = require('react-router-dom') const { compose } = require('recompose') const PropTypes = require('prop-types') const connect = require('react-redux').connect -const actions = require('~/brave/ui/app/store/actions') -const { DEFAULT_ROUTE } = require('~/brave/ui/app/helpers/constants/routes') +const actions = require('../../../store/actions') +const { DEFAULT_ROUTE } = require('../../../helpers/constants/routes') const { getMetaMaskAccounts } = require('../../../selectors/selectors') import Button from '../../../components/ui/button' diff --git a/ui/app/pages/create-account/new-account.component.js b/ui/app/pages/create-account/new-account.component.js index fb46955c4..6dc6419b5 100644 --- a/ui/app/pages/create-account/new-account.component.js +++ b/ui/app/pages/create-account/new-account.component.js @@ -1,6 +1,6 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' -import { DEFAULT_ROUTE } from '~/brave/ui/app/helpers/constants/routes' +import { DEFAULT_ROUTE } from '../../helpers/constants/routes' import Button from '../../components/ui/button' export default class NewAccountCreateForm extends Component { diff --git a/ui/app/pages/create-account/new-account.container.js b/ui/app/pages/create-account/new-account.container.js index bb4817c40..9f3af5003 100644 --- a/ui/app/pages/create-account/new-account.container.js +++ b/ui/app/pages/create-account/new-account.container.js @@ -1,5 +1,5 @@ import { connect } from 'react-redux' -import actions from '~/brave/ui/app/store/actions' +import actions from '../../store/actions' import NewAccountCreateForm from './new-account.component' const mapStateToProps = state => { diff --git a/ui/app/pages/first-time-flow/create-password/create-password.component.js b/ui/app/pages/first-time-flow/create-password/create-password.component.js index 8be4be101..fbeb34d77 100644 --- a/ui/app/pages/first-time-flow/create-password/create-password.component.js +++ b/ui/app/pages/first-time-flow/create-password/create-password.component.js @@ -8,7 +8,7 @@ import { INITIALIZE_CREATE_PASSWORD_ROUTE, INITIALIZE_IMPORT_WITH_SEED_PHRASE_ROUTE, INITIALIZE_SEED_PHRASE_ROUTE, -} from '~/brave/ui/app/helpers/constants/routes' +} from '../../../helpers/constants/routes' export default class CreatePassword extends PureComponent { static propTypes = { diff --git a/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.component.js b/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.component.js index f27f8f60a..e1c0b21ed 100644 --- a/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.component.js +++ b/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.component.js @@ -6,7 +6,7 @@ import Button from '../../../../components/ui/button' import { INITIALIZE_SELECT_ACTION_ROUTE, INITIALIZE_END_OF_FLOW_ROUTE, -} from '~/brave/ui/app/helpers/constants/routes' +} from '../../../../helpers/constants/routes' export default class ImportWithSeedPhrase extends PureComponent { static contextTypes = { diff --git a/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.container.js b/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.container.js index 13d4ff9ec..70360443c 100644 --- a/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.container.js +++ b/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.container.js @@ -1,9 +1,9 @@ import { connect } from 'react-redux' -import ImportWithSeedPhrase from '~/brave/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.component' +import ImportWithSeedPhrase from './import-with-seed-phrase.component' import { setSeedPhraseBackedUp, initializeThreeBox, -} from '~/brave/ui/app/store/actions' +} from '../../../../store/actions' const mapDispatchToProps = dispatch => { return { diff --git a/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/tests/import-with-seed-phrase.component.test.js b/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/tests/import-with-seed-phrase.component.test.js index 87290e5b4..7960d17b2 100644 --- a/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/tests/import-with-seed-phrase.component.test.js +++ b/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/tests/import-with-seed-phrase.component.test.js @@ -2,7 +2,7 @@ import React from 'react' import assert from 'assert' import { shallow } from 'enzyme' import sinon from 'sinon' -import ImportWithSeedPhrase from '~/brave/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.component' +import ImportWithSeedPhrase from '../import-with-seed-phrase.component' function shallowRender (props = {}, context = {}) { return shallow(, { diff --git a/ui/app/pages/first-time-flow/create-password/new-account/index.js b/ui/app/pages/first-time-flow/create-password/new-account/index.js index f1749b83f..97db39cc3 100644 --- a/ui/app/pages/first-time-flow/create-password/new-account/index.js +++ b/ui/app/pages/first-time-flow/create-password/new-account/index.js @@ -1 +1 @@ -export { default } from '~/brave/ui/app/pages/first-time-flow/create-password/new-account/new-account.component' +export { default } from './new-account.component' diff --git a/ui/app/pages/first-time-flow/create-password/new-account/new-account.component.js b/ui/app/pages/first-time-flow/create-password/new-account/new-account.component.js index 24e71ba8b..de073af2f 100644 --- a/ui/app/pages/first-time-flow/create-password/new-account/new-account.component.js +++ b/ui/app/pages/first-time-flow/create-password/new-account/new-account.component.js @@ -5,7 +5,7 @@ import { INITIALIZE_SEED_PHRASE_ROUTE, INITIALIZE_IMPORT_WITH_SEED_PHRASE_ROUTE, INITIALIZE_SELECT_ACTION_ROUTE, -} from '~/brave/ui/app/helpers/constants/routes' +} from '../../../../helpers/constants/routes' import TextField from '../../../../components/ui/text-field' export default class NewAccount extends PureComponent { diff --git a/ui/app/pages/first-time-flow/create-password/unique-image/unique-image.component.js b/ui/app/pages/first-time-flow/create-password/unique-image/unique-image.component.js index c202470a1..590cf0303 100644 --- a/ui/app/pages/first-time-flow/create-password/unique-image/unique-image.component.js +++ b/ui/app/pages/first-time-flow/create-password/unique-image/unique-image.component.js @@ -1,7 +1,7 @@ import React, { PureComponent } from 'react' import PropTypes from 'prop-types' import Button from '../../../../components/ui/button' -import { INITIALIZE_END_OF_FLOW_ROUTE } from '~/brave/ui/app/helpers/constants/routes' +import { INITIALIZE_END_OF_FLOW_ROUTE } from '../../../../helpers/constants/routes' export default class UniqueImageScreen extends PureComponent { static contextTypes = { diff --git a/ui/app/pages/first-time-flow/end-of-flow/end-of-flow.component.js b/ui/app/pages/first-time-flow/end-of-flow/end-of-flow.component.js index 904fdf5b7..8cbf4d69f 100644 --- a/ui/app/pages/first-time-flow/end-of-flow/end-of-flow.component.js +++ b/ui/app/pages/first-time-flow/end-of-flow/end-of-flow.component.js @@ -2,7 +2,7 @@ import React, { PureComponent } from 'react' import PropTypes from 'prop-types' import Button from '../../../components/ui/button' import MetaFoxLogo from '../../../components/ui/metafox-logo' -import { DEFAULT_ROUTE } from '~/brave/ui/app/helpers/constants/routes' +import { DEFAULT_ROUTE } from '../../../helpers/constants/routes' export default class EndOfFlowScreen extends PureComponent { static contextTypes = { @@ -50,7 +50,7 @@ export default class EndOfFlowScreen extends PureComponent {
{ '*' + t('endOfFlowMessage8') } diff --git a/ui/app/pages/first-time-flow/end-of-flow/end-of-flow.container.js b/ui/app/pages/first-time-flow/end-of-flow/end-of-flow.container.js index ad6991f13..38313806c 100644 --- a/ui/app/pages/first-time-flow/end-of-flow/end-of-flow.container.js +++ b/ui/app/pages/first-time-flow/end-of-flow/end-of-flow.container.js @@ -1,6 +1,6 @@ import { connect } from 'react-redux' import EndOfFlow from './end-of-flow.component' -import { setCompletedOnboarding } from '~/brave/ui/app/store/actions' +import { setCompletedOnboarding } from '../../../store/actions' const firstTimeFlowTypeNameMap = { create: 'New Wallet Created', diff --git a/ui/app/pages/first-time-flow/first-time-flow-switch/first-time-flow-switch.component.js b/ui/app/pages/first-time-flow/first-time-flow-switch/first-time-flow-switch.component.js index 24639b9df..6bc89245b 100644 --- a/ui/app/pages/first-time-flow/first-time-flow-switch/first-time-flow-switch.component.js +++ b/ui/app/pages/first-time-flow/first-time-flow-switch/first-time-flow-switch.component.js @@ -7,7 +7,7 @@ import { INITIALIZE_WELCOME_ROUTE, INITIALIZE_UNLOCK_ROUTE, INITIALIZE_METAMETRICS_OPT_IN_ROUTE, -} from '~/brave/ui/app/helpers/constants/routes' +} from '../../../helpers/constants/routes' export default class FirstTimeFlowSwitch extends PureComponent { static propTypes = { diff --git a/ui/app/pages/first-time-flow/first-time-flow.component.js b/ui/app/pages/first-time-flow/first-time-flow.component.js index 922f29d09..d77171f87 100644 --- a/ui/app/pages/first-time-flow/first-time-flow.component.js +++ b/ui/app/pages/first-time-flow/first-time-flow.component.js @@ -19,7 +19,7 @@ import { INITIALIZE_END_OF_FLOW_ROUTE, INITIALIZE_METAMETRICS_OPT_IN_ROUTE, INITIALIZE_BACKUP_SEED_PHRASE_ROUTE, -} from '~/brave/ui/app/helpers/constants/routes' +} from '../../helpers/constants/routes' export default class FirstTimeFlow extends PureComponent { static propTypes = { diff --git a/ui/app/pages/first-time-flow/first-time-flow.container.js b/ui/app/pages/first-time-flow/first-time-flow.container.js index 6975e4d01..ec9920d74 100644 --- a/ui/app/pages/first-time-flow/first-time-flow.container.js +++ b/ui/app/pages/first-time-flow/first-time-flow.container.js @@ -6,10 +6,10 @@ import { createNewVaultAndRestore, unlockAndGetSeedPhrase, verifySeedPhrase, -} from '~/brave/ui/app/store/actions' +} from '../../store/actions' import { INITIALIZE_BACKUP_SEED_PHRASE_ROUTE, -} from '~/brave/ui/app/helpers/constants/routes' +} from '../../helpers/constants/routes' const mapStateToProps = (state, ownProps) => { const { metamask: { completedOnboarding, isInitialized, isUnlocked, seedPhraseBackedUp } } = state diff --git a/ui/app/pages/first-time-flow/first-time-flow.selectors.js b/ui/app/pages/first-time-flow/first-time-flow.selectors.js index 12a627dce..e6cd5a84a 100644 --- a/ui/app/pages/first-time-flow/first-time-flow.selectors.js +++ b/ui/app/pages/first-time-flow/first-time-flow.selectors.js @@ -2,7 +2,7 @@ import { INITIALIZE_CREATE_PASSWORD_ROUTE, INITIALIZE_IMPORT_WITH_SEED_PHRASE_ROUTE, DEFAULT_ROUTE, -} from '~/brave/ui/app/helpers/constants/routes' +} from '../../helpers/constants/routes' const selectors = { getFirstTimeFlowTypeRoute, diff --git a/ui/app/pages/first-time-flow/metametrics-opt-in/metametrics-opt-in.container.js b/ui/app/pages/first-time-flow/metametrics-opt-in/metametrics-opt-in.container.js index 1b4b4bc64..2566a2a56 100644 --- a/ui/app/pages/first-time-flow/metametrics-opt-in/metametrics-opt-in.container.js +++ b/ui/app/pages/first-time-flow/metametrics-opt-in/metametrics-opt-in.container.js @@ -1,6 +1,6 @@ import { connect } from 'react-redux' import MetaMetricsOptIn from './metametrics-opt-in.component' -import { setParticipateInMetaMetrics } from '~/brave/ui/app/store/actions' +import { setParticipateInMetaMetrics } from '../../../store/actions' import { getFirstTimeFlowTypeRoute } from '../first-time-flow.selectors' const firstTimeFlowTypeNameMap = { diff --git a/ui/app/pages/first-time-flow/seed-phrase/confirm-seed-phrase/confirm-seed-phrase.component.js b/ui/app/pages/first-time-flow/seed-phrase/confirm-seed-phrase/confirm-seed-phrase.component.js index c68e4a0ba..d6674c266 100644 --- a/ui/app/pages/first-time-flow/seed-phrase/confirm-seed-phrase/confirm-seed-phrase.component.js +++ b/ui/app/pages/first-time-flow/seed-phrase/confirm-seed-phrase/confirm-seed-phrase.component.js @@ -7,7 +7,7 @@ import { INITIALIZE_END_OF_FLOW_ROUTE, INITIALIZE_SEED_PHRASE_ROUTE, DEFAULT_ROUTE, -} from '~/brave/ui/app/helpers/constants/routes' +} from '../../../../helpers/constants/routes' import { exportAsFile } from '../../../../helpers/utils/util' import DraggableSeed from './draggable-seed.component' diff --git a/ui/app/pages/first-time-flow/seed-phrase/confirm-seed-phrase/confirm-seed-phrase.container.js b/ui/app/pages/first-time-flow/seed-phrase/confirm-seed-phrase/confirm-seed-phrase.container.js index 1a5524974..a78c65adc 100644 --- a/ui/app/pages/first-time-flow/seed-phrase/confirm-seed-phrase/confirm-seed-phrase.container.js +++ b/ui/app/pages/first-time-flow/seed-phrase/confirm-seed-phrase/confirm-seed-phrase.container.js @@ -1,10 +1,10 @@ import { connect } from 'react-redux' -import ConfirmSeedPhrase from '~/brave/ui/app/pages/first-time-flow/seed-phrase/confirm-seed-phrase/confirm-seed-phrase.component' +import ConfirmSeedPhrase from './confirm-seed-phrase.component' import { setSeedPhraseBackedUp, hideSeedPhraseBackupAfterOnboarding, initializeThreeBox, -} from '~/brave/ui/app/store/actions' +} from '../../../../store/actions' import { getSelectedAddress } from '../../../../selectors/selectors' const mapStateToProps = state => { diff --git a/ui/app/pages/first-time-flow/seed-phrase/reveal-seed-phrase/reveal-seed-phrase.component.js b/ui/app/pages/first-time-flow/seed-phrase/reveal-seed-phrase/reveal-seed-phrase.component.js index be6f18563..4144fb878 100644 --- a/ui/app/pages/first-time-flow/seed-phrase/reveal-seed-phrase/reveal-seed-phrase.component.js +++ b/ui/app/pages/first-time-flow/seed-phrase/reveal-seed-phrase/reveal-seed-phrase.component.js @@ -3,7 +3,7 @@ import PropTypes from 'prop-types' import classnames from 'classnames' import LockIcon from '../../../../components/ui/lock-icon' import Button from '../../../../components/ui/button' -import { INITIALIZE_CONFIRM_SEED_PHRASE_ROUTE, DEFAULT_ROUTE } from '~/brave/ui/app/helpers/constants/routes' +import { INITIALIZE_CONFIRM_SEED_PHRASE_ROUTE, DEFAULT_ROUTE } from '../../../../helpers/constants/routes' import { exportAsFile } from '../../../../helpers/utils/util' export default class RevealSeedPhrase extends PureComponent { diff --git a/ui/app/pages/first-time-flow/seed-phrase/reveal-seed-phrase/reveal-seed-phrase.container.js b/ui/app/pages/first-time-flow/seed-phrase/reveal-seed-phrase/reveal-seed-phrase.container.js index 228f87648..7ada36afc 100644 --- a/ui/app/pages/first-time-flow/seed-phrase/reveal-seed-phrase/reveal-seed-phrase.container.js +++ b/ui/app/pages/first-time-flow/seed-phrase/reveal-seed-phrase/reveal-seed-phrase.container.js @@ -1,9 +1,9 @@ import { connect } from 'react-redux' -import RevealSeedPhrase from '~/brave/ui/app/pages/first-time-flow/seed-phrase/reveal-seed-phrase/reveal-seed-phrase.component' +import RevealSeedPhrase from './reveal-seed-phrase.component' import { setCompletedOnboarding, setSeedPhraseBackedUp, -} from '~/brave/ui/app/store/actions' +} from '../../../../store/actions' const mapDispatchToProps = dispatch => { return { diff --git a/ui/app/pages/first-time-flow/seed-phrase/seed-phrase.component.js b/ui/app/pages/first-time-flow/seed-phrase/seed-phrase.component.js index 3fb93f4c2..ae38757d9 100644 --- a/ui/app/pages/first-time-flow/seed-phrase/seed-phrase.component.js +++ b/ui/app/pages/first-time-flow/seed-phrase/seed-phrase.component.js @@ -8,7 +8,7 @@ import { INITIALIZE_CONFIRM_SEED_PHRASE_ROUTE, INITIALIZE_BACKUP_SEED_PHRASE_ROUTE, DEFAULT_ROUTE, -} from '~/brave/ui/app/helpers/constants/routes' +} from '../../../helpers/constants/routes' import HTML5Backend from 'react-dnd-html5-backend' import {DragDropContextProvider} from 'react-dnd' import MetaFoxLogo from '../../../components/ui/metafox-logo' diff --git a/ui/app/pages/first-time-flow/seed-phrase/tests/confirm-seed-phrase-component.test.js b/ui/app/pages/first-time-flow/seed-phrase/tests/confirm-seed-phrase-component.test.js index 6055b38ca..b98c74751 100644 --- a/ui/app/pages/first-time-flow/seed-phrase/tests/confirm-seed-phrase-component.test.js +++ b/ui/app/pages/first-time-flow/seed-phrase/tests/confirm-seed-phrase-component.test.js @@ -2,7 +2,7 @@ import React from 'react' import assert from 'assert' import { shallow } from 'enzyme' import sinon from 'sinon' -import ConfirmSeedPhrase from '~/brave/ui/app/pages/first-time-flow/seed-phrase/confirm-seed-phrase/confirm-seed-phrase.component' +import ConfirmSeedPhrase from '../confirm-seed-phrase/confirm-seed-phrase.component' function shallowRender (props = {}, context = {}) { return shallow( diff --git a/ui/app/pages/first-time-flow/select-action/select-action.component.js b/ui/app/pages/first-time-flow/select-action/select-action.component.js index 9955557cb..5379952f1 100644 --- a/ui/app/pages/first-time-flow/select-action/select-action.component.js +++ b/ui/app/pages/first-time-flow/select-action/select-action.component.js @@ -4,7 +4,7 @@ import Button from '../../../components/ui/button' import MetaFoxLogo from '../../../components/ui/metafox-logo' import { INITIALIZE_METAMETRICS_OPT_IN_ROUTE, -} from '~/brave/ui/app/helpers/constants/routes' +} from '../../../helpers/constants/routes' export default class SelectAction extends PureComponent { static propTypes = { diff --git a/ui/app/pages/first-time-flow/select-action/select-action.container.js b/ui/app/pages/first-time-flow/select-action/select-action.container.js index dcaa5eae4..9dc988430 100644 --- a/ui/app/pages/first-time-flow/select-action/select-action.container.js +++ b/ui/app/pages/first-time-flow/select-action/select-action.container.js @@ -1,9 +1,9 @@ import { connect } from 'react-redux' import { withRouter } from 'react-router-dom' import { compose } from 'recompose' -import { setFirstTimeFlowType } from '~/brave/ui/app/store/actions' +import { setFirstTimeFlowType } from '../../../store/actions' import { getFirstTimeFlowTypeRoute } from '../first-time-flow.selectors' -import Welcome from '~/brave/ui/app/pages/first-time-flow/welcome/welcome.component' +import Welcome from './select-action.component' const mapStateToProps = (state) => { return { diff --git a/ui/app/pages/first-time-flow/welcome/welcome.component.js b/ui/app/pages/first-time-flow/welcome/welcome.component.js index 44f8ccb48..c720d2572 100644 --- a/ui/app/pages/first-time-flow/welcome/welcome.component.js +++ b/ui/app/pages/first-time-flow/welcome/welcome.component.js @@ -1,9 +1,9 @@ import EventEmitter from 'events' import React, { PureComponent } from 'react' import PropTypes from 'prop-types' -import Mascot from '~/brave/ui/app/components/ui/mascot' +import Mascot from '../../../components/ui/mascot' import Button from '../../../components/ui/button' -import { INITIALIZE_CREATE_PASSWORD_ROUTE, INITIALIZE_SELECT_ACTION_ROUTE } from '~/brave/ui/app/helpers/constants/routes' +import { INITIALIZE_CREATE_PASSWORD_ROUTE, INITIALIZE_SELECT_ACTION_ROUTE } from '../../../helpers/constants/routes' export default class Welcome extends PureComponent { static propTypes = { diff --git a/ui/app/pages/first-time-flow/welcome/welcome.container.js b/ui/app/pages/first-time-flow/welcome/welcome.container.js index 66f285986..ce4b2b471 100644 --- a/ui/app/pages/first-time-flow/welcome/welcome.container.js +++ b/ui/app/pages/first-time-flow/welcome/welcome.container.js @@ -1,8 +1,8 @@ import { connect } from 'react-redux' import { withRouter } from 'react-router-dom' import { compose } from 'recompose' -import { closeWelcomeScreen } from '~/brave/ui/app/store/actions' -import Welcome from '~/brave/ui/app/pages/first-time-flow/welcome/welcome.component' +import { closeWelcomeScreen } from '../../../store/actions' +import Welcome from './welcome.component' const mapStateToProps = ({ metamask }) => { const { welcomeScreenSeen, isInitialized, participateInMetaMetrics } = metamask diff --git a/ui/app/pages/home/home.component.js b/ui/app/pages/home/home.component.js index 72619c792..e51c82177 100644 --- a/ui/app/pages/home/home.component.js +++ b/ui/app/pages/home/home.component.js @@ -15,7 +15,7 @@ import { CONFIRM_TRANSACTION_ROUTE, CONFIRM_ADD_SUGGESTED_TOKEN_ROUTE, INITIALIZE_BACKUP_SEED_PHRASE_ROUTE, -} from '~/brave/ui/app/helpers/constants/routes' +} from '../../helpers/constants/routes' export default class Home extends PureComponent { static contextTypes = { diff --git a/ui/app/pages/home/home.container.js b/ui/app/pages/home/home.container.js index e455828d1..4a2106a55 100644 --- a/ui/app/pages/home/home.container.js +++ b/ui/app/pages/home/home.container.js @@ -10,7 +10,7 @@ import { turnThreeBoxSyncingOn, getThreeBoxLastUpdated, setShowRestorePromptToFalse, -} from '~/brave/ui/app/store/actions' +} from '../../store/actions' import { setThreeBoxLastUpdated } from '../../ducks/app/app' import { getEnvironmentType } from '../../../../app/scripts/lib/util' import { ENVIRONMENT_TYPE_POPUP } from '../../../../app/scripts/lib/enums' diff --git a/ui/app/pages/index.js b/ui/app/pages/index.js index efc9b0368..56fc4af04 100644 --- a/ui/app/pages/index.js +++ b/ui/app/pages/index.js @@ -2,7 +2,7 @@ import React, { Component } from 'react' const PropTypes = require('prop-types') const { Provider } = require('react-redux') const { HashRouter } = require('react-router-dom') -const Routes = require('~/brave/ui/app/pages/routes') +const Routes = require('./routes') const I18nProvider = require('../helpers/higher-order-components/i18n-provider') const MetaMetricsProvider = require('../helpers/higher-order-components/metametrics/metametrics.provider') diff --git a/ui/app/pages/keychains/restore-vault.js b/ui/app/pages/keychains/restore-vault.js index 51694f876..93c2975bb 100644 --- a/ui/app/pages/keychains/restore-vault.js +++ b/ui/app/pages/keychains/restore-vault.js @@ -5,8 +5,8 @@ import { createNewVaultAndRestore, unMarkPasswordForgotten, initializeThreeBox, -} from '~/brave/ui/app/store/actions' -import { DEFAULT_ROUTE } from '~/brave/ui/app/helpers/constants/routes' +} from '../../store/actions' +import { DEFAULT_ROUTE } from '../../helpers/constants/routes' import TextField from '../../components/ui/text-field' import Button from '../../components/ui/button' diff --git a/ui/app/pages/keychains/reveal-seed.js b/ui/app/pages/keychains/reveal-seed.js index fa3011d5d..e83e3fd98 100644 --- a/ui/app/pages/keychains/reveal-seed.js +++ b/ui/app/pages/keychains/reveal-seed.js @@ -4,8 +4,8 @@ const PropTypes = require('prop-types') const h = require('react-hyperscript') const classnames = require('classnames') -const { requestRevealSeedWords } = require('~/brave/ui/app/store/actions') -const { DEFAULT_ROUTE } = require('~/brave/ui/app/helpers/constants/routes') +const { requestRevealSeedWords } = require('../../store/actions') +const { DEFAULT_ROUTE } = require('../../helpers/constants/routes') const ExportTextContainer = require('../../components/ui/export-text-container') import Button from '../../components/ui/button' diff --git a/ui/app/pages/lock/lock.component.js b/ui/app/pages/lock/lock.component.js index 08352c244..1145158c5 100644 --- a/ui/app/pages/lock/lock.component.js +++ b/ui/app/pages/lock/lock.component.js @@ -1,7 +1,7 @@ import React, { PureComponent } from 'react' import PropTypes from 'prop-types' import Loading from '../../components/ui/loading-screen' -import { DEFAULT_ROUTE } from '~/brave/ui/app/helpers/constants/routes' +import { DEFAULT_ROUTE } from '../../helpers/constants/routes' export default class Lock extends PureComponent { static propTypes = { diff --git a/ui/app/pages/lock/lock.container.js b/ui/app/pages/lock/lock.container.js index 2e718fe3c..6a20b6ed1 100644 --- a/ui/app/pages/lock/lock.container.js +++ b/ui/app/pages/lock/lock.container.js @@ -2,7 +2,7 @@ import Lock from './lock.component' import { compose } from 'recompose' import { connect } from 'react-redux' import { withRouter } from 'react-router-dom' -import { lockMetamask } from '~/brave/ui/app/store/actions' +import { lockMetamask } from '../../store/actions' const mapStateToProps = state => { const { metamask: { isUnlocked } } = state diff --git a/ui/app/pages/mobile-sync/index.js b/ui/app/pages/mobile-sync/index.js index 24380c99d..bd2385808 100644 --- a/ui/app/pages/mobile-sync/index.js +++ b/ui/app/pages/mobile-sync/index.js @@ -5,9 +5,9 @@ const h = require('react-hyperscript') const classnames = require('classnames') const PubNub = require('pubnub') -const { requestRevealSeedWords, fetchInfoToSync } = require('~/brave/ui/app/store/actions') -const { DEFAULT_ROUTE } = require('~/brave/ui/app/helpers/constants/routes') -const actions = require('~/brave/ui/app/store/actions') +const { requestRevealSeedWords, fetchInfoToSync } = require('../../store/actions') +const { DEFAULT_ROUTE } = require('../../helpers/constants/routes') +const actions = require('../../store/actions') const qrCode = require('qrcode-generator') diff --git a/ui/app/pages/provider-approval/provider-approval.container.js b/ui/app/pages/provider-approval/provider-approval.container.js index ef574cfc7..1e167ddb7 100644 --- a/ui/app/pages/provider-approval/provider-approval.container.js +++ b/ui/app/pages/provider-approval/provider-approval.container.js @@ -1,6 +1,6 @@ import { connect } from 'react-redux' import ProviderApproval from './provider-approval.component' -import { approveProviderRequestByOrigin, rejectProviderRequestByOrigin } from '~/brave/ui/app/store/actions' +import { approveProviderRequestByOrigin, rejectProviderRequestByOrigin } from '../../store/actions' function mapDispatchToProps (dispatch) { return { diff --git a/ui/app/pages/routes/index.js b/ui/app/pages/routes/index.js index 643550a19..01e61b1b4 100644 --- a/ui/app/pages/routes/index.js +++ b/ui/app/pages/routes/index.js @@ -3,7 +3,7 @@ import PropTypes from 'prop-types' import { connect } from 'react-redux' import { Route, Switch, withRouter, matchPath } from 'react-router-dom' import { compose } from 'recompose' -import actions from '~/brave/ui/app/store/actions' +import actions from '../../store/actions' import log from 'loglevel' import IdleTimer from 'react-idle-timer' import {getNetworkIdentifier, preferencesSelector} from '../../selectors/selectors' @@ -20,12 +20,12 @@ const Sidebar = require('../../components/app/sidebars').default const { WALLET_VIEW_SIDEBAR } = require('../../components/app/sidebars/sidebar.constants') // other views -import Home from '~/brave/ui/app/pages/home' +import Home from '../home' import Settings from '../settings' import Authenticated from '../../helpers/higher-order-components/authenticated' import Initialized from '../../helpers/higher-order-components/initialized' import Lock from '../lock' -const RestoreVaultPage = require('~/brave/ui/app/pages/keychains/restore-vault').default +const RestoreVaultPage = require('../keychains/restore-vault').default const RevealSeedConfirmation = require('../keychains/reveal-seed') const MobileSyncPage = require('../mobile-sync') const AddTokenPage = require('../add-token') @@ -67,7 +67,7 @@ import { CONFIRM_TRANSACTION_ROUTE, INITIALIZE_ROUTE, INITIALIZE_UNLOCK_ROUTE, -} from '~/brave/ui/app/helpers/constants/routes' +} from '../../helpers/constants/routes' // enums import { diff --git a/ui/app/pages/send/send-content/add-recipient/add-recipient.container.js b/ui/app/pages/send/send-content/add-recipient/add-recipient.container.js index 8ccb05058..eb980aa82 100644 --- a/ui/app/pages/send/send-content/add-recipient/add-recipient.container.js +++ b/ui/app/pages/send/send-content/add-recipient/add-recipient.container.js @@ -10,7 +10,7 @@ import { } from '../../../../selectors/selectors' import { updateSendTo, -} from '~/brave/ui/app/store/actions' +} from '../../../../store/actions' import AddRecipient from './add-recipient.component' export default connect(mapStateToProps, mapDispatchToProps)(AddRecipient) diff --git a/ui/app/pages/send/send-content/add-recipient/tests/add-recipient-container.test.js b/ui/app/pages/send/send-content/add-recipient/tests/add-recipient-container.test.js index 15698c2bd..5ca0b2c23 100644 --- a/ui/app/pages/send/send-content/add-recipient/tests/add-recipient-container.test.js +++ b/ui/app/pages/send/send-content/add-recipient/tests/add-recipient-container.test.js @@ -26,7 +26,7 @@ proxyquire('../add-recipient.container.js', { getAddressBook: (s) => [{ name: `mockAddressBook:${s}` }], getAddressBookEntry: (s) => `mockAddressBookEntry:${s}`, }, - '~/brave/ui/app/store/actions': actionSpies, + '../../../../store/actions': actionSpies, }) describe('add-recipient container', () => { diff --git a/ui/app/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.container.js b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.container.js index 93c3d0f13..e444589a1 100644 --- a/ui/app/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.container.js +++ b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.container.js @@ -11,7 +11,7 @@ import { calcMaxAmount } from './amount-max-button.utils.js' import { updateSendAmount, setMaxModeTo, -} from '~/brave/ui/app/store/actions' +} from '../../../../../store/actions' import AmountMaxButton from './amount-max-button.component' import { updateSendErrors, diff --git a/ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-container.test.js b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-container.test.js index 02fe60d54..dcee8fda0 100644 --- a/ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-container.test.js +++ b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-container.test.js @@ -30,7 +30,7 @@ proxyquire('../amount-max-button.container.js', { './amount-max-button.selectors.js': { getMaxModeOn: (s) => `mockMaxModeOn:${s}` }, './amount-max-button.utils.js': { calcMaxAmount: (mockObj) => mockObj.val + 1 }, '../../../../../selectors/custom-gas': { getBasicGasEstimateLoadingStatus: (s) => `mockButtonDataLoading:${s}`}, - '~/brave/ui/app/store/actions': actionSpies, + '../../../../../store/actions': actionSpies, '../../../../../ducks/send/send.duck': duckActionSpies, }) diff --git a/ui/app/pages/send/send-content/send-amount-row/send-amount-row.container.js b/ui/app/pages/send/send-content/send-amount-row/send-amount-row.container.js index 993eae38c..2b3470da4 100644 --- a/ui/app/pages/send/send-content/send-amount-row/send-amount-row.container.js +++ b/ui/app/pages/send/send-content/send-amount-row/send-amount-row.container.js @@ -17,7 +17,7 @@ import { getAmountErrorObject, getGasFeeErrorObject } from '../../send.utils' import { setMaxModeTo, updateSendAmount, -} from '~/brave/ui/app/store/actions' +} from '../../../../store/actions' import { updateSendErrors, } from '../../../../ducks/send/send.duck' diff --git a/ui/app/pages/send/send-content/send-amount-row/tests/send-amount-row-container.test.js b/ui/app/pages/send/send-content/send-amount-row/tests/send-amount-row-container.test.js index 0d66ce765..dada1c5e9 100644 --- a/ui/app/pages/send/send-content/send-amount-row/tests/send-amount-row-container.test.js +++ b/ui/app/pages/send/send-content/send-amount-row/tests/send-amount-row-container.test.js @@ -37,7 +37,7 @@ proxyquire('../send-amount-row.container.js', { getAmountErrorObject: (mockDataObject) => ({ ...mockDataObject, mockChange: true }), getGasFeeErrorObject: (mockDataObject) => ({ ...mockDataObject, mockGasFeeErrorChange: true }), }, - '~/brave/ui/app/store/actions': actionSpies, + '../../../../store/actions': actionSpies, '../../../../ducks/send/send.duck': duckActionSpies, }) diff --git a/ui/app/pages/send/send-content/send-asset-row/send-asset-row.container.js b/ui/app/pages/send/send-content/send-asset-row/send-asset-row.container.js index 0fa1edfe8..57b62fba1 100644 --- a/ui/app/pages/send/send-content/send-asset-row/send-asset-row.container.js +++ b/ui/app/pages/send/send-content/send-asset-row/send-asset-row.container.js @@ -1,7 +1,7 @@ import { connect } from 'react-redux' import SendAssetRow from './send-asset-row.component' import {getMetaMaskAccounts} from '../../../../selectors/selectors' -import { setSelectedToken } from '~/brave/ui/app/store/actions' +import { setSelectedToken } from '../../../../store/actions' function mapStateToProps (state) { return { diff --git a/ui/app/pages/send/send-content/send-content.container.js b/ui/app/pages/send/send-content/send-content.container.js index 7f286705d..a122aca1a 100644 --- a/ui/app/pages/send/send-content/send-content.container.js +++ b/ui/app/pages/send/send-content/send-content.container.js @@ -7,7 +7,7 @@ import { import { getAddressBookEntry, } from '../../../selectors/selectors' -import actions from '~/brave/ui/app/store/actions' +import actions from '../../../store/actions' function mapStateToProps (state) { const ownedAccounts = accountsWithSendEtherInfoSelector(state) diff --git a/ui/app/pages/send/send-content/send-gas-row/send-gas-row.container.js b/ui/app/pages/send/send-content/send-gas-row/send-gas-row.container.js index d8cc576ec..10eaa50b8 100644 --- a/ui/app/pages/send/send-content/send-gas-row/send-gas-row.container.js +++ b/ui/app/pages/send/send-content/send-gas-row/send-gas-row.container.js @@ -32,7 +32,7 @@ import { setCustomGasLimit, } from '../../../../ducks/gas/gas.duck' import { getGasLoadingError, gasFeeIsInError, getGasButtonGroupShown } from './send-gas-row.selectors.js' -import { showModal, setGasPrice, setGasLimit, setGasTotal, updateSendAmount } from '~/brave/ui/app/store/actions' +import { showModal, setGasPrice, setGasLimit, setGasTotal, updateSendAmount } from '../../../../store/actions' import { getAdvancedInlineGasShown, getCurrentEthBalance, getSelectedToken } from '../../../../selectors/selectors' import SendGasRow from './send-gas-row.component' diff --git a/ui/app/pages/send/send-content/send-gas-row/tests/send-gas-row-container.test.js b/ui/app/pages/send/send-content/send-gas-row/tests/send-gas-row-container.test.js index 56af21f8b..4acb310f8 100644 --- a/ui/app/pages/send/send-content/send-gas-row/tests/send-gas-row-container.test.js +++ b/ui/app/pages/send/send-content/send-gas-row/tests/send-gas-row-container.test.js @@ -64,7 +64,7 @@ proxyquire('../send-gas-row.container.js', { gasFeeIsInError: (s) => `mockGasFeeError:${s}`, getGasButtonGroupShown: (s) => `mockGetGasButtonGroupShown:${s}`, }, - '~/brave/ui/app/store/actions': actionSpies, + '../../../../store/actions': actionSpies, '../../../../selectors/custom-gas': { getBasicGasEstimateLoadingStatus: (s) => `mockBasicGasEstimateLoadingStatus:${s}`, getRenderableEstimateDataForSmallButtonsFromGWEI: (s) => `mockGasButtonInfo:${s}`, diff --git a/ui/app/pages/send/send-content/send-hex-data-row/send-hex-data-row.container.js b/ui/app/pages/send/send-content/send-hex-data-row/send-hex-data-row.container.js index a4c84a160..8b1c540c3 100644 --- a/ui/app/pages/send/send-content/send-hex-data-row/send-hex-data-row.container.js +++ b/ui/app/pages/send/send-content/send-hex-data-row/send-hex-data-row.container.js @@ -1,7 +1,7 @@ import { connect } from 'react-redux' import { updateSendHexData, -} from '~/brave/ui/app/store/actions' +} from '../../../../store/actions' import SendHexDataRow from './send-hex-data-row.component' export default connect(mapStateToProps, mapDispatchToProps)(SendHexDataRow) diff --git a/ui/app/pages/send/send-footer/send-footer.component.js b/ui/app/pages/send/send-footer/send-footer.component.js index a2907d86d..20ab50c3c 100644 --- a/ui/app/pages/send/send-footer/send-footer.component.js +++ b/ui/app/pages/send/send-footer/send-footer.component.js @@ -1,7 +1,7 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' import PageContainerFooter from '../../../components/ui/page-container/page-container-footer' -import { CONFIRM_TRANSACTION_ROUTE, DEFAULT_ROUTE } from '~/brave/ui/app/helpers/constants/routes' +import { CONFIRM_TRANSACTION_ROUTE, DEFAULT_ROUTE } from '../../../helpers/constants/routes' export default class SendFooter extends Component { diff --git a/ui/app/pages/send/send-footer/send-footer.container.js b/ui/app/pages/send/send-footer/send-footer.container.js index 21a17d330..52348ca89 100644 --- a/ui/app/pages/send/send-footer/send-footer.container.js +++ b/ui/app/pages/send/send-footer/send-footer.container.js @@ -6,7 +6,7 @@ import { signTokenTx, signTx, updateTransaction, -} from '~/brave/ui/app/store/actions' +} from '../../../store/actions' import SendFooter from './send-footer.component' import { getGasLimit, diff --git a/ui/app/pages/send/send-footer/tests/send-footer-component.test.js b/ui/app/pages/send/send-footer/tests/send-footer-component.test.js index 284172661..4f35e1b25 100644 --- a/ui/app/pages/send/send-footer/tests/send-footer-component.test.js +++ b/ui/app/pages/send/send-footer/tests/send-footer-component.test.js @@ -2,7 +2,7 @@ import React from 'react' import assert from 'assert' import { shallow } from 'enzyme' import sinon from 'sinon' -import { CONFIRM_TRANSACTION_ROUTE, DEFAULT_ROUTE } from '~/brave/ui/app/helpers/constants/routes' +import { CONFIRM_TRANSACTION_ROUTE, DEFAULT_ROUTE } from '../../../../helpers/constants/routes' import SendFooter from '../send-footer.component.js' import PageContainerFooter from '../../../../components/ui/page-container/page-container-footer' diff --git a/ui/app/pages/send/send-footer/tests/send-footer-container.test.js b/ui/app/pages/send/send-footer/tests/send-footer-container.test.js index 0da5fc2c5..70bc078c8 100644 --- a/ui/app/pages/send/send-footer/tests/send-footer-container.test.js +++ b/ui/app/pages/send/send-footer/tests/send-footer-container.test.js @@ -26,7 +26,7 @@ proxyquire('../send-footer.container.js', { return () => ({}) }, }, - '~/brave/ui/app/store/actions': actionSpies, + '../../../store/actions': actionSpies, '../send.selectors': { getGasLimit: (s) => `mockGasLimit:${s}`, getGasPrice: (s) => `mockGasPrice:${s}`, diff --git a/ui/app/pages/send/send-header/send-header.component.js b/ui/app/pages/send/send-header/send-header.component.js index c378a0803..c4c4f866d 100644 --- a/ui/app/pages/send/send-header/send-header.component.js +++ b/ui/app/pages/send/send-header/send-header.component.js @@ -1,7 +1,7 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' import PageContainerHeader from '../../../components/ui/page-container/page-container-header' -import { DEFAULT_ROUTE } from '~/brave/ui/app/helpers/constants/routes' +import { DEFAULT_ROUTE } from '../../../helpers/constants/routes' export default class SendHeader extends Component { diff --git a/ui/app/pages/send/send-header/send-header.container.js b/ui/app/pages/send/send-header/send-header.container.js index bdd133c92..7d57a71e9 100644 --- a/ui/app/pages/send/send-header/send-header.container.js +++ b/ui/app/pages/send/send-header/send-header.container.js @@ -1,5 +1,5 @@ import { connect } from 'react-redux' -import { clearSend } from '~/brave/ui/app/store/actions' +import { clearSend } from '../../../store/actions' import SendHeader from './send-header.component' import { getTitleKey } from './send-header.selectors' diff --git a/ui/app/pages/send/send-header/tests/send-header-component.test.js b/ui/app/pages/send/send-header/tests/send-header-component.test.js index ff98431d6..6c24c24fa 100644 --- a/ui/app/pages/send/send-header/tests/send-header-component.test.js +++ b/ui/app/pages/send/send-header/tests/send-header-component.test.js @@ -2,7 +2,7 @@ import React from 'react' import assert from 'assert' import { shallow } from 'enzyme' import sinon from 'sinon' -import { DEFAULT_ROUTE } from '~/brave/ui/app/helpers/constants/routes' +import { DEFAULT_ROUTE } from '../../../../helpers/constants/routes' import SendHeader from '../send-header.component.js' import PageContainerHeader from '../../../../components/ui/page-container/page-container-header' diff --git a/ui/app/pages/send/send-header/tests/send-header-container.test.js b/ui/app/pages/send/send-header/tests/send-header-container.test.js index a8b46cb70..0ff7491f0 100644 --- a/ui/app/pages/send/send-header/tests/send-header-container.test.js +++ b/ui/app/pages/send/send-header/tests/send-header-container.test.js @@ -17,7 +17,7 @@ proxyquire('../send-header.container.js', { return () => ({}) }, }, - '~/brave/ui/app/store/actions': actionSpies, + '../../../store/actions': actionSpies, './send-header.selectors': { getTitleKey: (s) => `mockTitleKey:${s}`, }, diff --git a/ui/app/pages/send/send.container.js b/ui/app/pages/send/send.container.js index 450e0c4eb..f8512a7bb 100644 --- a/ui/app/pages/send/send.container.js +++ b/ui/app/pages/send/send.container.js @@ -43,7 +43,7 @@ import { qrCodeDetected, updateSendEnsResolution, updateSendEnsResolutionError, -} from '~/brave/ui/app/store/actions' +} from '../../store/actions' import { resetSendState, updateSendErrors, @@ -60,7 +60,7 @@ import { import { SEND_ROUTE, -} from '~/brave/ui/app/helpers/constants/routes' +} from '../../helpers/constants/routes' function mapStateToProps (state) { return { diff --git a/ui/app/pages/send/tests/send-container.test.js b/ui/app/pages/send/tests/send-container.test.js index 617c61659..f4142bc2d 100644 --- a/ui/app/pages/send/tests/send-container.test.js +++ b/ui/app/pages/send/tests/send-container.test.js @@ -56,7 +56,7 @@ proxyquire('../send.container.js', { getAddressBook: (s) => `mockAddressBook:${s}`, getSelectedAddress: (s) => `mockSelectedAddress:${s}`, }, - '~/brave/ui/app/store/actions': actionSpies, + '../../store/actions': actionSpies, '../../ducks/send/send.duck': duckActionSpies, './send.utils.js': { calcGasTotal: (gasLimit, gasPrice) => gasLimit + gasPrice, diff --git a/ui/app/pages/settings/advanced-tab/advanced-tab.component.js b/ui/app/pages/settings/advanced-tab/advanced-tab.component.js index b51fe3d96..62c153584 100644 --- a/ui/app/pages/settings/advanced-tab/advanced-tab.component.js +++ b/ui/app/pages/settings/advanced-tab/advanced-tab.component.js @@ -5,7 +5,7 @@ import { exportAsFile } from '../../../helpers/utils/util' import ToggleButton from '../../../components/ui/toggle-button' import TextField from '../../../components/ui/text-field' import Button from '../../../components/ui/button' -import { MOBILE_SYNC_ROUTE } from '~/brave/ui/app/helpers/constants/routes' +import { MOBILE_SYNC_ROUTE } from '../../../helpers/constants/routes' export default class AdvancedTab extends PureComponent { static contextTypes = { diff --git a/ui/app/pages/settings/advanced-tab/advanced-tab.container.js b/ui/app/pages/settings/advanced-tab/advanced-tab.container.js index ede731bf2..4f41cb536 100644 --- a/ui/app/pages/settings/advanced-tab/advanced-tab.container.js +++ b/ui/app/pages/settings/advanced-tab/advanced-tab.container.js @@ -1,4 +1,4 @@ -import AdvancedTab from '~/brave/ui/app/pages/settings/advanced-tab/advanced-tab.component' +import AdvancedTab from './advanced-tab.component' import { compose } from 'recompose' import { connect } from 'react-redux' import { withRouter } from 'react-router-dom' @@ -13,7 +13,7 @@ import { turnThreeBoxSyncingOnAndInitialize, setUseIn3, setUseNonceField, -} from '~/brave/ui/app/store/actions' +} from '../../../store/actions' import {preferencesSelector} from '../../../selectors/selectors' export const mapStateToProps = state => { diff --git a/ui/app/pages/settings/advanced-tab/tests/advanced-tab-component.test.js b/ui/app/pages/settings/advanced-tab/tests/advanced-tab-component.test.js index 418d189f2..15e5306c2 100644 --- a/ui/app/pages/settings/advanced-tab/tests/advanced-tab-component.test.js +++ b/ui/app/pages/settings/advanced-tab/tests/advanced-tab-component.test.js @@ -2,7 +2,7 @@ import React from 'react' import assert from 'assert' import sinon from 'sinon' import { shallow } from 'enzyme' -import AdvancedTab from '~/brave/ui/app/pages/settings/advanced-tab/advanced-tab.component' +import AdvancedTab from '../advanced-tab.component' import TextField from '../../../../components/ui/text-field' describe('AdvancedTab Component', () => { diff --git a/ui/app/pages/settings/connections-tab/connections-tab.container.js b/ui/app/pages/settings/connections-tab/connections-tab.container.js index 6008e3d2e..cf3efc2b4 100644 --- a/ui/app/pages/settings/connections-tab/connections-tab.container.js +++ b/ui/app/pages/settings/connections-tab/connections-tab.container.js @@ -6,7 +6,7 @@ import { approveProviderRequestByOrigin, rejectProviderRequestByOrigin, showModal, -} from '~/brave/ui/app/store/actions' +} from '../../../store/actions' export const mapStateToProps = state => { const { diff --git a/ui/app/pages/settings/contact-list-tab/add-contact/add-contact.container.js b/ui/app/pages/settings/contact-list-tab/add-contact/add-contact.container.js index c5879c3c8..0a0fc450c 100644 --- a/ui/app/pages/settings/contact-list-tab/add-contact/add-contact.container.js +++ b/ui/app/pages/settings/contact-list-tab/add-contact/add-contact.container.js @@ -2,10 +2,10 @@ import AddContact from './add-contact.component' import { compose } from 'recompose' import { connect } from 'react-redux' import { withRouter } from 'react-router-dom' -import { addToAddressBook, showQrScanner, qrCodeDetected } from '~/brave/ui/app/store/actions' +import { addToAddressBook, showQrScanner, qrCodeDetected } from '../../../../store/actions' import { CONTACT_ADD_ROUTE, -} from '~/brave/ui/app/helpers/constants/routes' +} from '../../../../helpers/constants/routes' import { getQrCodeData, } from '../../../../pages/send/send.selectors' diff --git a/ui/app/pages/settings/contact-list-tab/contact-list-tab.component.js b/ui/app/pages/settings/contact-list-tab/contact-list-tab.component.js index 70d79ed92..f7a01d672 100644 --- a/ui/app/pages/settings/contact-list-tab/contact-list-tab.component.js +++ b/ui/app/pages/settings/contact-list-tab/contact-list-tab.component.js @@ -9,7 +9,7 @@ import { CONTACT_ADD_ROUTE, CONTACT_VIEW_ROUTE, CONTACT_MY_ACCOUNTS_ROUTE, -} from '~/brave/ui/app/helpers/constants/routes' +} from '../../../helpers/constants/routes' export default class ContactListTab extends Component { static contextTypes = { diff --git a/ui/app/pages/settings/contact-list-tab/contact-list-tab.container.js b/ui/app/pages/settings/contact-list-tab/contact-list-tab.container.js index 58a01f0d3..2c7139b5d 100644 --- a/ui/app/pages/settings/contact-list-tab/contact-list-tab.container.js +++ b/ui/app/pages/settings/contact-list-tab/contact-list-tab.container.js @@ -13,7 +13,7 @@ import { CONTACT_MY_ACCOUNTS_ROUTE, CONTACT_MY_ACCOUNTS_VIEW_ROUTE, CONTACT_MY_ACCOUNTS_EDIT_ROUTE, -} from '~/brave/ui/app/helpers/constants/routes' +} from '../../../helpers/constants/routes' const mapStateToProps = (state, ownProps) => { diff --git a/ui/app/pages/settings/contact-list-tab/edit-contact/edit-contact.container.js b/ui/app/pages/settings/contact-list-tab/edit-contact/edit-contact.container.js index eac95bef6..639fb841e 100644 --- a/ui/app/pages/settings/contact-list-tab/edit-contact/edit-contact.container.js +++ b/ui/app/pages/settings/contact-list-tab/edit-contact/edit-contact.container.js @@ -9,8 +9,8 @@ import { CONTACT_MY_ACCOUNTS_VIEW_ROUTE, CONTACT_MY_ACCOUNTS_EDIT_ROUTE, CONTACT_LIST_ROUTE, -} from '~/brave/ui/app/helpers/constants/routes' -import { addToAddressBook, removeFromAddressBook, setAccountLabel } from '~/brave/ui/app/store/actions' +} from '../../../../helpers/constants/routes' +import { addToAddressBook, removeFromAddressBook, setAccountLabel } from '../../../../store/actions' const mapStateToProps = (state, ownProps) => { const { location } = ownProps diff --git a/ui/app/pages/settings/contact-list-tab/my-accounts/my-accounts.component.js b/ui/app/pages/settings/contact-list-tab/my-accounts/my-accounts.component.js index 63653ff77..f43b59e07 100644 --- a/ui/app/pages/settings/contact-list-tab/my-accounts/my-accounts.component.js +++ b/ui/app/pages/settings/contact-list-tab/my-accounts/my-accounts.component.js @@ -1,7 +1,7 @@ import React, { PureComponent } from 'react' import PropTypes from 'prop-types' import ContactList from '../../../../components/app/contact-list' -import { CONTACT_MY_ACCOUNTS_VIEW_ROUTE } from '~/brave/ui/app/helpers/constants/routes' +import { CONTACT_MY_ACCOUNTS_VIEW_ROUTE } from '../../../../helpers/constants/routes' export default class ViewContact extends PureComponent { diff --git a/ui/app/pages/settings/contact-list-tab/view-contact/view-contact.container.js b/ui/app/pages/settings/contact-list-tab/view-contact/view-contact.container.js index d0cc18bbf..b1196d936 100644 --- a/ui/app/pages/settings/contact-list-tab/view-contact/view-contact.container.js +++ b/ui/app/pages/settings/contact-list-tab/view-contact/view-contact.container.js @@ -3,13 +3,13 @@ import { compose } from 'recompose' import { connect } from 'react-redux' import { withRouter } from 'react-router-dom' import { getAddressBookEntry } from '../../../../selectors/selectors' -import { removeFromAddressBook } from '~/brave/ui/app/store/actions' +import { removeFromAddressBook } from '../../../../store/actions' import { checksumAddress } from '../../../../helpers/utils/util' import { CONTACT_EDIT_ROUTE, CONTACT_MY_ACCOUNTS_EDIT_ROUTE, CONTACT_MY_ACCOUNTS_VIEW_ROUTE, -} from '~/brave/ui/app/helpers/constants/routes' +} from '../../../../helpers/constants/routes' const mapStateToProps = (state, ownProps) => { const { location } = ownProps diff --git a/ui/app/pages/settings/networks-tab/networks-tab.component.js b/ui/app/pages/settings/networks-tab/networks-tab.component.js index 2b138ae04..4ee871a58 100644 --- a/ui/app/pages/settings/networks-tab/networks-tab.component.js +++ b/ui/app/pages/settings/networks-tab/networks-tab.component.js @@ -1,6 +1,6 @@ import React, { PureComponent } from 'react' import PropTypes from 'prop-types' -import { SETTINGS_ROUTE } from '~/brave/ui/app/helpers/constants/routes' +import { SETTINGS_ROUTE } from '../../../helpers/constants/routes' import { ENVIRONMENT_TYPE_POPUP } from '../../../../../app/scripts/lib/enums' import { getEnvironmentType } from '../../../../../app/scripts/lib/util' import classnames from 'classnames' diff --git a/ui/app/pages/settings/networks-tab/networks-tab.container.js b/ui/app/pages/settings/networks-tab/networks-tab.container.js index e1aeb6219..8cc18a4bd 100644 --- a/ui/app/pages/settings/networks-tab/networks-tab.container.js +++ b/ui/app/pages/settings/networks-tab/networks-tab.container.js @@ -9,8 +9,8 @@ import { setNetworksTabAddMode, editRpc, showModal, -} from '~/brave/ui/app/store/actions' -import { defaultNetworksData } from '~/brave/ui/app/pages/settings/networks-tab/networks-tab.constants' +} from '../../../store/actions' +import { defaultNetworksData } from './networks-tab.constants' const defaultNetworks = defaultNetworksData.map(network => ({ ...network, viewOnly: true })) const mapStateToProps = state => { diff --git a/ui/app/pages/settings/security-tab/security-tab.component.js b/ui/app/pages/settings/security-tab/security-tab.component.js index 0e197e220..117010d0f 100644 --- a/ui/app/pages/settings/security-tab/security-tab.component.js +++ b/ui/app/pages/settings/security-tab/security-tab.component.js @@ -1,7 +1,7 @@ import React, { PureComponent } from 'react' import PropTypes from 'prop-types' import ToggleButton from '../../../components/ui/toggle-button' -import { REVEAL_SEED_ROUTE } from '~/brave/ui/app/helpers/constants/routes' +import { REVEAL_SEED_ROUTE } from '../../../helpers/constants/routes' import Button from '../../../components/ui/button' export default class SecurityTab extends PureComponent { diff --git a/ui/app/pages/settings/security-tab/security-tab.container.js b/ui/app/pages/settings/security-tab/security-tab.container.js index f27dcf30c..35375ebf5 100644 --- a/ui/app/pages/settings/security-tab/security-tab.container.js +++ b/ui/app/pages/settings/security-tab/security-tab.container.js @@ -1,4 +1,4 @@ -import SecurityTab from '~/brave/ui/app/pages/settings/security-tab/security-tab.component' +import SecurityTab from './security-tab.component' import { compose } from 'recompose' import { connect } from 'react-redux' import { withRouter } from 'react-router-dom' @@ -7,7 +7,7 @@ import { revealSeedConfirmation, setFeatureFlag, setParticipateInMetaMetrics, -} from '~/brave/ui/app/store/actions' +} from '../../../store/actions' const mapStateToProps = state => { const { appState: { warning }, metamask } = state diff --git a/ui/app/pages/settings/settings-tab/settings-tab.container.js b/ui/app/pages/settings/settings-tab/settings-tab.container.js index 28a2fcec7..d3d8457f0 100644 --- a/ui/app/pages/settings/settings-tab/settings-tab.container.js +++ b/ui/app/pages/settings/settings-tab/settings-tab.container.js @@ -9,7 +9,7 @@ import { updateCurrentLocale, setUseNativeCurrencyAsPrimaryCurrencyPreference, setParticipateInMetaMetrics, -} from '~/brave/ui/app/store/actions' +} from '../../../store/actions' import { preferencesSelector } from '../../../selectors/selectors' const mapStateToProps = state => { diff --git a/ui/app/pages/settings/settings.component.js b/ui/app/pages/settings/settings.component.js index 3a046f6e0..975ab4e35 100644 --- a/ui/app/pages/settings/settings.component.js +++ b/ui/app/pages/settings/settings.component.js @@ -26,7 +26,7 @@ import { CONTACT_MY_ACCOUNTS_ROUTE, CONTACT_MY_ACCOUNTS_VIEW_ROUTE, CONTACT_MY_ACCOUNTS_EDIT_ROUTE, -} from '~/brave/ui/app/helpers/constants/routes' +} from '../../helpers/constants/routes' class SettingsPage extends PureComponent { static propTypes = { diff --git a/ui/app/pages/settings/settings.container.js b/ui/app/pages/settings/settings.container.js index 7f84cbb70..8fe6614df 100644 --- a/ui/app/pages/settings/settings.container.js +++ b/ui/app/pages/settings/settings.container.js @@ -21,7 +21,7 @@ import { CONTACT_MY_ACCOUNTS_ROUTE, CONTACT_MY_ACCOUNTS_EDIT_ROUTE, CONTACT_MY_ACCOUNTS_VIEW_ROUTE, -} from '~/brave/ui/app/helpers/constants/routes' +} from '../../helpers/constants/routes' const ROUTES_TO_I18N_KEYS = { [GENERAL_ROUTE]: 'general', diff --git a/ui/app/pages/unlock-page/unlock-page.component.js b/ui/app/pages/unlock-page/unlock-page.component.js index ccd38398e..3aeb2a59b 100644 --- a/ui/app/pages/unlock-page/unlock-page.component.js +++ b/ui/app/pages/unlock-page/unlock-page.component.js @@ -4,8 +4,8 @@ import Button from '@material-ui/core/Button' import TextField from '../../components/ui/text-field' import getCaretCoordinates from 'textarea-caret' import { EventEmitter } from 'events' -import Mascot from '~/brave/ui/app/components/ui/mascot' -import { DEFAULT_ROUTE } from '~/brave/ui/app/helpers/constants/routes' +import Mascot from '../../components/ui/mascot' +import { DEFAULT_ROUTE } from '../../helpers/constants/routes' export default class UnlockPage extends Component { static contextTypes = { diff --git a/ui/app/pages/unlock-page/unlock-page.container.js b/ui/app/pages/unlock-page/unlock-page.container.js index 22eb00e4e..b89392ab5 100644 --- a/ui/app/pages/unlock-page/unlock-page.container.js +++ b/ui/app/pages/unlock-page/unlock-page.container.js @@ -3,14 +3,14 @@ import { withRouter } from 'react-router-dom' import { compose } from 'recompose' import { getEnvironmentType } from '../../../../app/scripts/lib/util' import { ENVIRONMENT_TYPE_POPUP } from '../../../../app/scripts/lib/enums' -import { DEFAULT_ROUTE, RESTORE_VAULT_ROUTE } from '~/brave/ui/app/helpers/constants/routes' +import { DEFAULT_ROUTE, RESTORE_VAULT_ROUTE } from '../../helpers/constants/routes' import { tryUnlockMetamask, forgotPassword, markPasswordForgotten, forceUpdateMetamaskState, showModal, -} from '~/brave/ui/app/store/actions' +} from '../../store/actions' import UnlockPage from './unlock-page.component' const mapStateToProps = state => { diff --git a/ui/app/store/actions.js b/ui/app/store/actions.js index c294bacda..26be7b7d8 100644 --- a/ui/app/store/actions.js +++ b/ui/app/store/actions.js @@ -2480,7 +2480,7 @@ function setUseIn3 (value) { background.setUseIn3Network(value, (result, error) => { if (!error) { dispatch({ - type: actions.SET_USE_IN3, + type: actionConstants.SET_USE_IN3, value: result, }) } else { From 315a8753e60487d15b4d7cd56ec367c307862c86 Mon Sep 17 00:00:00 2001 From: chirag-parmar Date: Mon, 16 Mar 2020 18:50:27 +0100 Subject: [PATCH 09/16] Hide unsupported networks in dropdown --- .../controllers/network/createIn3Client.js | 2 +- app/scripts/controllers/network/enums.js | 6 ++++ app/scripts/controllers/network/network.js | 28 ++++++++----------- app/scripts/controllers/preferences.js | 7 +++++ app/scripts/metamask-controller.js | 16 +++++++++-- test/unit/ui/app/reducers/metamask.spec.js | 2 +- .../app/dropdowns/network-dropdown.js | 12 +++++--- ui/app/ducks/metamask/metamask.js | 2 -- ui/app/store/actions.js | 12 +++++--- 9 files changed, 56 insertions(+), 31 deletions(-) diff --git a/app/scripts/controllers/network/createIn3Client.js b/app/scripts/controllers/network/createIn3Client.js index 8795b30e3..b275ecad8 100644 --- a/app/scripts/controllers/network/createIn3Client.js +++ b/app/scripts/controllers/network/createIn3Client.js @@ -6,7 +6,7 @@ const createBlockCacheMiddleware = require('eth-json-rpc-middleware/block-cache' const createInflightMiddleware = require('eth-json-rpc-middleware/inflight-cache') const createBlockTrackerInspectorMiddleware = require('eth-json-rpc-middleware/block-tracker-inspector') const providerFromMiddleware = require('eth-json-rpc-middleware/providerFromMiddleware') -const createIn3Middleware = require('eth-json-rpc-in3') +const createIn3Middleware = require('eth-json-rpc-in3').default const BlockTracker = require('eth-block-tracker') module.exports = createIn3Client diff --git a/app/scripts/controllers/network/enums.js b/app/scripts/controllers/network/enums.js index 613665071..e0a084d84 100644 --- a/app/scripts/controllers/network/enums.js +++ b/app/scripts/controllers/network/enums.js @@ -19,6 +19,9 @@ const GOERLI_DISPLAY_NAME = 'Goerli' const INFURA = 'infura' const IN3 = 'in3' +const INFURA_PROVIDER_TYPES = [ROPSTEN, RINKEBY, KOVAN, MAINNET, GOERLI] +const IN3_PROVIDER_TYPES = [KOVAN, MAINNET, GOERLI] +const RPC_PROVIDER_TYPES = [INFURA, IN3] module.exports = { ROPSTEN, @@ -39,4 +42,7 @@ module.exports = { GOERLI_DISPLAY_NAME, INFURA, IN3, + INFURA_PROVIDER_TYPES, + IN3_PROVIDER_TYPES, + RPC_PROVIDER_TYPES } diff --git a/app/scripts/controllers/network/network.js b/app/scripts/controllers/network/network.js index 943088b5b..14d6a5a76 100644 --- a/app/scripts/controllers/network/network.js +++ b/app/scripts/controllers/network/network.js @@ -16,19 +16,15 @@ const extend = require('extend') const networks = { networkList: {} } const { - ROPSTEN, - RINKEBY, - KOVAN, - MAINNET, - LOCALHOST, - GOERLI, + IN3, INFURA, - IN3 + IN3_PROVIDER_TYPES, + INFURA_PROVIDER_TYPES, + LOCALHOST, + MAINNET, + RINKEBY, + RPC_PROVIDER_TYPES } = require('./enums') -const INFURA_PROVIDER_TYPES = [ROPSTEN, RINKEBY, KOVAN, MAINNET, GOERLI] -const IN3_PROVIDER_TYPES = [KOVAN, MAINNET, GOERLI] - -const RPC_PROVIDER_TYPES = [INFURA, IN3] const env = process.env.METAMASK_ENV const METAMASK_DEBUG = process.env.METAMASK_DEBUG @@ -187,12 +183,10 @@ module.exports = class NetworkController extends EventEmitter { const isInfura = INFURA_PROVIDER_TYPES.includes(type) const isIn3 = IN3_PROVIDER_TYPES.includes(type) - if (isInfura && !(isIn3 && rpcType === IN3)) { - this._configureInfuraProvider(opts) - // in3 - } else if (isIn3 && rpcType === IN3) { - console.log("In3") - this._configureIn3Provider(opts) + if (rpcType === IN3 && IN3_PROVIDER_TYPES.includes(type)) { + this._configureIn3Provider({ type, rpcTarget, chainId, ticker, nickname, rpcPrefs, IN3 }) + } else if (INFURA_PROVIDER_TYPES.includes(type)) { + this._configureInfuraProvider({ type, rpcTarget, chainId, ticker, nickname, rpcPrefs, INFURA }) } else if (type === LOCALHOST) { this._configureLocalhostProvider() // url-based rpc endpoints diff --git a/app/scripts/controllers/preferences.js b/app/scripts/controllers/preferences.js index b445d37ed..95c4ad86d 100644 --- a/app/scripts/controllers/preferences.js +++ b/app/scripts/controllers/preferences.js @@ -94,6 +94,13 @@ class PreferencesController { this.store.updateState({ useBlockie: val }) } + /** + * Getter for the `useIn3` property + */ + getUseIn3 () { + return this.store.getState().useIn3 + } + /** * Setter for the `useIn3` property * diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 6132feb42..548fb6d2f 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -437,7 +437,6 @@ module.exports = class MetamaskController extends EventEmitter { const keyringController = this.keyringController const preferencesController = this.preferencesController const txController = this.txController - const networkController = this.networkController const providerApprovalController = this.providerApprovalController const onboardingController = this.onboardingController const threeBoxController = this.threeBoxController @@ -483,7 +482,8 @@ module.exports = class MetamaskController extends EventEmitter { submitPassword: nodeify(this.submitPassword, this), // network management - setProviderType: nodeify(networkController.setProviderType, networkController), + // setProviderType: nodeify(networkController.setProviderType, networkController), + setProviderType: this.setProvider.bind(this), setCustomRpc: nodeify(this.setCustomRpc, this), updateAndSetCustomRpc: nodeify(this.updateAndSetCustomRpc, this), delCustomRpc: nodeify(this.delCustomRpc, this), @@ -1749,6 +1749,18 @@ module.exports = class MetamaskController extends EventEmitter { await this.threeBoxController.init() } + /** + * Wrapper for networkController.setProviderType that enforces rpcType, respecting preferences selection + */ + setProvider (type, rpcTarget = '', ticker = 'ETH', nickname = '', rpcPrefs = {}, rpcType = '') { + const useIn3 = rpcType === 'in3' ? true : this.preferencesController.getUseIn3() + if (useIn3) { + this.networkController.setProviderType(type, rpcTarget, ticker, nickname, rpcPrefs, IN3) + } else { + this.networkController.setProviderType(type, rpcTarget, ticker, nickname, rpcPrefs, INFURA) + } + } + /** * Sets whether or not to use IN3 NEtwork provider instead of infura * @param {boolean} useIn3 - True for IN3, false for Infura. diff --git a/test/unit/ui/app/reducers/metamask.spec.js b/test/unit/ui/app/reducers/metamask.spec.js index 2ca7b4fdf..7ecf7ff7b 100644 --- a/test/unit/ui/app/reducers/metamask.spec.js +++ b/test/unit/ui/app/reducers/metamask.spec.js @@ -425,7 +425,7 @@ describe('MetaMask Reducers', () => { assert.equal(state.useBlockie, true) }) - it('sets use In3', () => { + it('sets use In3', () => { const state = reduceMetamask({}, { type: actions.SET_USE_IN3, value: true, diff --git a/ui/app/components/app/dropdowns/network-dropdown.js b/ui/app/components/app/dropdowns/network-dropdown.js index e6a24ef11..bfb3e2afd 100644 --- a/ui/app/components/app/dropdowns/network-dropdown.js +++ b/ui/app/components/app/dropdowns/network-dropdown.js @@ -69,7 +69,7 @@ module.exports = compose( // TODO: specify default props and proptypes NetworkDropdown.prototype.render = function () { const props = this.props - const { provider: { type: providerType, rpcTarget: activeNetwork }, setNetworksTabAddMode } = props + const { provider: { type: providerType, rpcTarget: activeNetwork, rpcType: rpcType }, setNetworksTabAddMode } = this.props const rpcListDetail = props.frequentRpcListDetail const isOpen = this.props.networkDropdownOpen const dropdownMenuItemStyle = { @@ -78,6 +78,10 @@ NetworkDropdown.prototype.render = function () { padding: '12px 0', } + const hidden = { + display: 'none', + } + return h(Dropdown, { isOpen, onClickOutside: (event) => { @@ -106,7 +110,7 @@ NetworkDropdown.prototype.render = function () { h('div.network-dropdown-title', {}, this.context.t('networks')), h('div.network-dropdown-divider'), - + h('div.network-dropdown-content', {style: { textAlign: 'center', fontSize: '16px' }}, h("Provider: " + rpcType)), h('div.network-dropdown-content', {}, this.context.t('defaultNetwork') @@ -141,7 +145,7 @@ NetworkDropdown.prototype.render = function () { key: 'ropsten', closeMenu: () => this.props.hideNetworkDropdown(), onClick: () => this.handleClick('ropsten'), - style: dropdownMenuItemStyle, + style: rpcType === 'in3' ? hidden : dropdownMenuItemStyle, }, [ providerType === 'ropsten' ? h('i.fa.fa-check') : h('.network-check__transparent', '✓'), @@ -185,7 +189,7 @@ NetworkDropdown.prototype.render = function () { key: 'rinkeby', closeMenu: () => this.props.hideNetworkDropdown(), onClick: () => this.handleClick('rinkeby'), - style: dropdownMenuItemStyle, + style: rpcType === 'in3' ? hidden : dropdownMenuItemStyle, }, [ providerType === 'rinkeby' ? h('i.fa.fa-check') : h('.network-check__transparent', '✓'), diff --git a/ui/app/ducks/metamask/metamask.js b/ui/app/ducks/metamask/metamask.js index 5eb590231..bc93ea51c 100644 --- a/ui/app/ducks/metamask/metamask.js +++ b/ui/app/ducks/metamask/metamask.js @@ -369,8 +369,6 @@ function reduceMetamask (state, action) { }) case actions.SET_USE_IN3: - console.log('metamask.js') - console.log(!metamaskState.useIn3) return { ...metamaskState, useIn3: !metamaskState.useIn3, diff --git a/ui/app/store/actions.js b/ui/app/store/actions.js index 26be7b7d8..03b640a7a 100644 --- a/ui/app/store/actions.js +++ b/ui/app/store/actions.js @@ -29,7 +29,7 @@ var actions = { hideModal: hideModal, // notification state CLOSE_NOTIFICATION_WINDOW: 'CLOSE_NOTIFICATION_WINDOW', - closeNotifacationWindow: closeNotifacationWindow, + closeNotificationWindow: closeNotificationWindow, // sidebar state SIDEBAR_OPEN: 'UI_SIDEBAR_OPEN', SIDEBAR_CLOSE: 'UI_SIDEBAR_CLOSE', @@ -2066,12 +2066,12 @@ function closeCurrentNotificationWindow () { !hasUnconfirmedTransactions(getState())) { global.platform.closeCurrentWindow() - dispatch(closeNotifacationWindow()) + dispatch(closeNotificationWindow()) } } } -function closeNotifacationWindow () { +function closeNotificationWindow () { return { type: actions.CLOSE_NOTIFICATION_WINDOW, } @@ -2478,12 +2478,16 @@ function setUseIn3 (value) { return 'error' } background.setUseIn3Network(value, (result, error) => { - if (!error) { + if (result !== undefined && result !== null) { dispatch({ type: actionConstants.SET_USE_IN3, value: result, }) } else { + dispatch({ + type: actionConstants.SET_USE_IN3, + value: false, + }) dispatch(displayWarning(error.message)) } dispatch(hideLoadingIndication()) From 462358e49afe9e10686e940f2860f35c55c2192d Mon Sep 17 00:00:00 2001 From: chirag-parmar Date: Mon, 16 Mar 2020 19:17:57 +0100 Subject: [PATCH 10/16] remove console.log --- app/scripts/controllers/network/network.js | 1 - app/scripts/controllers/preferences.js | 2 -- app/scripts/metamask-controller.js | 3 --- ui/app/pages/settings/advanced-tab/advanced-tab.container.js | 2 -- 4 files changed, 8 deletions(-) diff --git a/app/scripts/controllers/network/network.js b/app/scripts/controllers/network/network.js index 14d6a5a76..921c38965 100644 --- a/app/scripts/controllers/network/network.js +++ b/app/scripts/controllers/network/network.js @@ -178,7 +178,6 @@ module.exports = class NetworkController extends EventEmitter { _configureProvider (opts) { const { type, rpcTarget, chainId, ticker, nickname, rpcPrefs, rpcType } = opts - console.log(opts) // infura type-based endpoints const isInfura = INFURA_PROVIDER_TYPES.includes(type) const isIn3 = IN3_PROVIDER_TYPES.includes(type) diff --git a/app/scripts/controllers/preferences.js b/app/scripts/controllers/preferences.js index 95c4ad86d..cae7c4a84 100644 --- a/app/scripts/controllers/preferences.js +++ b/app/scripts/controllers/preferences.js @@ -109,8 +109,6 @@ class PreferencesController { */ setUseIn3 (val) { this.store.updateState({ useIn3: val }) - console.log('preferences.js') - console.log(this.store.getState()) } diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 548fb6d2f..c7daf496e 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -1775,9 +1775,6 @@ module.exports = class MetamaskController extends EventEmitter { } else { this.networkController.setProviderType(cfg.type, cfg.rpcTarget, cfg.ticker, cfg.nickname, cfg.rpcPrefs, INFURA) } - console.log('metamask-controller.js') - console.log(this.preferencesController.store.getState()) - console.log(this.networkController.store.getState()) cb(useIn3, null) } catch (err) { cb(null, err) diff --git a/ui/app/pages/settings/advanced-tab/advanced-tab.container.js b/ui/app/pages/settings/advanced-tab/advanced-tab.container.js index 4f41cb536..f3bf11a7d 100644 --- a/ui/app/pages/settings/advanced-tab/advanced-tab.container.js +++ b/ui/app/pages/settings/advanced-tab/advanced-tab.container.js @@ -28,8 +28,6 @@ export const mapStateToProps = state => { useIn3, useNonceField, } = metamask - console.log('adanved-tab.container.js') - console.log(metamask) const { showFiatInTestnets, autoLogoutTimeLimit } = preferencesSelector(state) return { From 93fd652fdbcf3fb5fbc7e95d4cdaee75dca1f71c Mon Sep 17 00:00:00 2001 From: chirag-parmar Date: Mon, 16 Mar 2020 19:18:12 +0100 Subject: [PATCH 11/16] fix actionConstants error --- ui/app/store/actions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/app/store/actions.js b/ui/app/store/actions.js index 03b640a7a..ddd674448 100644 --- a/ui/app/store/actions.js +++ b/ui/app/store/actions.js @@ -2480,12 +2480,12 @@ function setUseIn3 (value) { background.setUseIn3Network(value, (result, error) => { if (result !== undefined && result !== null) { dispatch({ - type: actionConstants.SET_USE_IN3, + type: actions.SET_USE_IN3, value: result, }) } else { dispatch({ - type: actionConstants.SET_USE_IN3, + type: actions.SET_USE_IN3, value: false, }) dispatch(displayWarning(error.message)) From 5b8d6ab4730be1d2964afc87531ac644103c75ff Mon Sep 17 00:00:00 2001 From: chirag-parmar Date: Tue, 17 Mar 2020 06:59:14 +0100 Subject: [PATCH 12/16] fix UI tests --- app/scripts/metamask-controller.js | 10 ++-- test/unit/ui/app/actions.spec.js | 14 ++--- .../tests/advanced-tab-container.test.js | 2 + ui/app/store/actions.js | 53 ++++++++++++------- 4 files changed, 46 insertions(+), 33 deletions(-) diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index c7daf496e..204a32df9 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -1763,21 +1763,21 @@ module.exports = class MetamaskController extends EventEmitter { /** * Sets whether or not to use IN3 NEtwork provider instead of infura - * @param {boolean} useIn3 - True for IN3, false for Infura. + * @param {boolean} val - True for IN3, false for Infura. * @param {Function} cb - A callback function called when complete. */ - setUseIn3Network (useIn3, cb) { + setUseIn3Network (val, cb) { try { - this.preferencesController.setUseIn3(useIn3) + this.preferencesController.setUseIn3(val) const cfg = this.networkController.getProviderConfig() if (useIn3) { this.networkController.setProviderType(cfg.type, cfg.rpcTarget, cfg.ticker, cfg.nickname, cfg.rpcPrefs, IN3) } else { this.networkController.setProviderType(cfg.type, cfg.rpcTarget, cfg.ticker, cfg.nickname, cfg.rpcPrefs, INFURA) } - cb(useIn3, null) + cb(null) } catch (err) { - cb(null, err) + cb(err) } } diff --git a/test/unit/ui/app/actions.spec.js b/test/unit/ui/app/actions.spec.js index 8a3cdae16..817891784 100644 --- a/test/unit/ui/app/actions.spec.js +++ b/test/unit/ui/app/actions.spec.js @@ -1519,11 +1519,12 @@ describe('Actions', () => { it('errors when setUseIn3 in background throws', () => { const store = mockStore() + const expectedActions = [ { type: 'SHOW_LOADING_INDICATION', value: undefined }, - { type: 'SET_USE_IN3', value: 'Error: error' }, - { type: 'DISPLAY_WARNING', value: undefined }, - { type: 'HIDE_LOADING_INDICATION', value: 'Error: error' }, + { type: 'HIDE_LOADING_INDICATION' }, + { type: 'DISPLAY_WARNING', value: 'error' }, + { type: 'SET_USE_IN3', value: undefined }, ] setUseIn3Spy.callsFake((_, callback) => { @@ -1531,12 +1532,7 @@ describe('Actions', () => { }) store.dispatch(actions.setUseIn3()) - - const rola = store.getActions() - for (let i = 0; i < expectedActions.length; ++i) { - assert.strictEqual(JSON.stringify(rola[i]), JSON.stringify(expectedActions[i])) - } - // assert.deepEqual(store.getActions(), expectedActions) + assert.deepEqual(store.getActions(), expectedActions) }) }) diff --git a/ui/app/pages/settings/advanced-tab/tests/advanced-tab-container.test.js b/ui/app/pages/settings/advanced-tab/tests/advanced-tab-container.test.js index 7f5223315..3c595fd09 100644 --- a/ui/app/pages/settings/advanced-tab/tests/advanced-tab-container.test.js +++ b/ui/app/pages/settings/advanced-tab/tests/advanced-tab-container.test.js @@ -17,6 +17,7 @@ const defaultState = { }, threeBoxSyncingAllowed: false, threeBoxDisabled: false, + useIn3: false, useNonceField: false, }, } @@ -29,6 +30,7 @@ describe('AdvancedTab Container', () => { sendHexData: false, advancedInlineGas: false, showFiatInTestnets: false, + useIn3:false, autoLogoutTimeLimit: 0, threeBoxSyncingAllowed: false, threeBoxDisabled: false, diff --git a/ui/app/store/actions.js b/ui/app/store/actions.js index ddd674448..47cd25a82 100644 --- a/ui/app/store/actions.js +++ b/ui/app/store/actions.js @@ -2470,27 +2470,42 @@ function setShowFiatConversionOnTestnetsPreference (value) { } function setUseIn3 (value) { - log.debug(`background.setUseIn3Network: ${value}`) + // log.debug(`background.setUseIn3Network: ${value}`) + // return (dispatch) => { + // dispatch(showLoadingIndication()) + // if (typeof value !== 'boolean') { + // dispatch(displayWarning('useIn3 must be boolean')) + // return 'error' + // } + // background.setUseIn3Network(value, (result, error) => { + // if (result !== undefined && result !== null) { + // dispatch({ + // type: actions.SET_USE_IN3, + // value: result, + // }) + // } else { + // dispatch({ + // type: actions.SET_USE_IN3, + // value: false, + // }) + // dispatch(displayWarning(error.message)) + // } + // dispatch(hideLoadingIndication()) + // }) + // } + return (dispatch) => { - dispatch(showLoadingIndication()) - if (typeof variable === 'boolean') { - dispatch(displayWarning('useIn3 must be boolean')) - return 'error' - } - background.setUseIn3Network(value, (result, error) => { - if (result !== undefined && result !== null) { - dispatch({ - type: actions.SET_USE_IN3, - value: result, - }) - } else { - dispatch({ - type: actions.SET_USE_IN3, - value: false, - }) - dispatch(displayWarning(error.message)) + dispatch(actions.showLoadingIndication()) + log.debug(`background.setUseIn3`) + background.setUseIn3Network(value, (err) => { + dispatch(actions.hideLoadingIndication()) + if (err) { + return dispatch(actions.displayWarning(err.message)) } - dispatch(hideLoadingIndication()) + }) + dispatch({ + type: actions.SET_USE_IN3, + value: value, }) } } From ede133ed9671de9c3742a520c56e30e13059a69e Mon Sep 17 00:00:00 2001 From: chirag-parmar Date: Tue, 17 Mar 2020 07:01:18 +0100 Subject: [PATCH 13/16] update in3 middleware package --- package.json | 2 +- yarn.lock | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 00df00d54..d090954d9 100644 --- a/package.json +++ b/package.json @@ -110,7 +110,7 @@ "eth-hd-keyring": "github:brave/eth-hd-keyring#d811474329e1a725180d393b67d03c0f3d96106b", "eth-json-rpc-errors": "^1.1.0", "eth-json-rpc-filters": "^4.1.1", - "eth-json-rpc-in3": "^0.1.3", + "eth-json-rpc-in3": "0.1.9", "eth-json-rpc-infura": "github:brave/eth-json-rpc-infura#e935ea77179447d2da15082cdac913ea6bf1133d", "eth-json-rpc-middleware": "^4.4.0", "eth-keyring-controller": "github:brave/KeyringController#9d4408c935948fb7797dd267560b4393a44c7379", diff --git a/yarn.lock b/yarn.lock index 8d48853ac..20a4b235a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10104,13 +10104,14 @@ eth-json-rpc-filters@^4.1.1: lodash.flatmap "^4.5.0" safe-event-emitter "^1.0.1" -eth-json-rpc-in3@^0.1.3: - version "0.1.3" - resolved "https://npm.slock.it/eth-json-rpc-in3/-/eth-json-rpc-in3-0.1.3.tgz#8fb8f14e2d4f77e41927fdb1eb911cc1caf71760" - integrity sha512-7wcaU+MzsOvMIe8+dsHurfkgZ9cvMoh0vZgzGa7XGuFIZ26rb6fdFHV5GOOy38FVu4Q2bMuPo4v9g8CvNx4b2w== +eth-json-rpc-in3@0.1.9: + version "0.1.9" + resolved "https://npm.slock.it/eth-json-rpc-in3/-/eth-json-rpc-in3-0.1.9.tgz#85fa7c3afbcfce40092df15fa04729644b0d066f" + integrity sha512-KFvaqy8+T8m1kNM7FoClrlahu63KD6IolRwhqRCokc9YyYE/hHIAQo+cwtT4Z2R7+juC/UE93JJhvUnIIUOApw== dependencies: "@babel/runtime" "^7.5.5" eth-json-rpc-errors "^2.0.0" + eth-json-rpc-middleware "^4.4.0" in3-asmjs "2.1.0" json-rpc-engine "^5.1.6" From 43e236ec366a80c742bcb867f74735d9896c9f06 Mon Sep 17 00:00:00 2001 From: chirag-parmar Date: Tue, 17 Mar 2020 08:23:01 +0100 Subject: [PATCH 14/16] fix dropdown text hyperscript --- ui/app/components/app/dropdowns/network-dropdown.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/app/components/app/dropdowns/network-dropdown.js b/ui/app/components/app/dropdowns/network-dropdown.js index bfb3e2afd..82ce52cd5 100644 --- a/ui/app/components/app/dropdowns/network-dropdown.js +++ b/ui/app/components/app/dropdowns/network-dropdown.js @@ -110,7 +110,7 @@ NetworkDropdown.prototype.render = function () { h('div.network-dropdown-title', {}, this.context.t('networks')), h('div.network-dropdown-divider'), - h('div.network-dropdown-content', {style: { textAlign: 'center', fontSize: '16px' }}, h("Provider: " + rpcType)), + h('div.network-dropdown-content', {style: { textAlign: 'center', fontSize: '16px' }}, "Provider: " + rpcType), h('div.network-dropdown-content', {}, this.context.t('defaultNetwork') From 9aec2bb4263339a67b4168bc827d087298f1c03b Mon Sep 17 00:00:00 2001 From: chirag-parmar Date: Tue, 17 Mar 2020 08:56:13 +0100 Subject: [PATCH 15/16] remove Provider content in network dropdown --- ui/app/components/app/dropdowns/network-dropdown.js | 1 - 1 file changed, 1 deletion(-) diff --git a/ui/app/components/app/dropdowns/network-dropdown.js b/ui/app/components/app/dropdowns/network-dropdown.js index 82ce52cd5..20d8fa571 100644 --- a/ui/app/components/app/dropdowns/network-dropdown.js +++ b/ui/app/components/app/dropdowns/network-dropdown.js @@ -110,7 +110,6 @@ NetworkDropdown.prototype.render = function () { h('div.network-dropdown-title', {}, this.context.t('networks')), h('div.network-dropdown-divider'), - h('div.network-dropdown-content', {style: { textAlign: 'center', fontSize: '16px' }}, "Provider: " + rpcType), h('div.network-dropdown-content', {}, this.context.t('defaultNetwork') From e735182863b18713ba11b3c61db336b361535966 Mon Sep 17 00:00:00 2001 From: chirag-parmar Date: Tue, 17 Mar 2020 11:03:44 +0100 Subject: [PATCH 16/16] re-add package using global registry --- package.json | 2 +- yarn.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index d090954d9..57673ef58 100644 --- a/package.json +++ b/package.json @@ -110,7 +110,7 @@ "eth-hd-keyring": "github:brave/eth-hd-keyring#d811474329e1a725180d393b67d03c0f3d96106b", "eth-json-rpc-errors": "^1.1.0", "eth-json-rpc-filters": "^4.1.1", - "eth-json-rpc-in3": "0.1.9", + "eth-json-rpc-in3": "^0.1.9", "eth-json-rpc-infura": "github:brave/eth-json-rpc-infura#e935ea77179447d2da15082cdac913ea6bf1133d", "eth-json-rpc-middleware": "^4.4.0", "eth-keyring-controller": "github:brave/KeyringController#9d4408c935948fb7797dd267560b4393a44c7379", diff --git a/yarn.lock b/yarn.lock index 20a4b235a..4d17d5f39 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10104,9 +10104,9 @@ eth-json-rpc-filters@^4.1.1: lodash.flatmap "^4.5.0" safe-event-emitter "^1.0.1" -eth-json-rpc-in3@0.1.9: +eth-json-rpc-in3@^0.1.9: version "0.1.9" - resolved "https://npm.slock.it/eth-json-rpc-in3/-/eth-json-rpc-in3-0.1.9.tgz#85fa7c3afbcfce40092df15fa04729644b0d066f" + resolved "https://registry.npmjs.org/eth-json-rpc-in3/-/eth-json-rpc-in3-0.1.9.tgz#85fa7c3afbcfce40092df15fa04729644b0d066f" integrity sha512-KFvaqy8+T8m1kNM7FoClrlahu63KD6IolRwhqRCokc9YyYE/hHIAQo+cwtT4Z2R7+juC/UE93JJhvUnIIUOApw== dependencies: "@babel/runtime" "^7.5.5" @@ -14075,7 +14075,7 @@ in-publish@^2.0.0: in3-asmjs@2.1.0: version "2.1.0" - resolved "https://npm.slock.it/in3-asmjs/-/in3-asmjs-2.1.0.tgz#9cd04df81043998934274ef9d6414cc952a45697" + resolved "https://registry.npmjs.org/in3-asmjs/-/in3-asmjs-2.1.0.tgz#9cd04df81043998934274ef9d6414cc952a45697" integrity sha512-/f86fnQQNvLufp4fdNpVmbxnVQgrDM016LaFIgdBsFKorY+C5QIgRLzJVGbNkJCR4yJ2c9kWtvYczyaKt4f2rg== indefinite-observable@^1.0.1: