diff options
Diffstat (limited to 'ui/app/components')
68 files changed, 176 insertions, 171 deletions
diff --git a/ui/app/components/account-menu/index.js b/ui/app/components/account-menu/index.js index e8838909..b9a1c51c 100644 --- a/ui/app/components/account-menu/index.js +++ b/ui/app/components/account-menu/index.js @@ -38,10 +38,10 @@ function AccountMenu () { Component.call(this) } function mapStateToProps (state) { return { - selectedAddress: state.metamask.selectedAddress, - isAccountMenuOpen: state.metamask.isAccountMenuOpen, - keyrings: state.metamask.keyrings, - identities: state.metamask.identities, + selectedAddress: state.dekusan.selectedAddress, + isAccountMenuOpen: state.dekusan.isAccountMenuOpen, + keyrings: state.dekusan.keyrings, + identities: state.dekusan.identities, accounts: getMetaMaskAccounts(state), } } diff --git a/ui/app/components/app-header/app-header.container.js b/ui/app/components/app-header/app-header.container.js index 8b719bdf..3a6ab70e 100644 --- a/ui/app/components/app-header/app-header.container.js +++ b/ui/app/components/app-header/app-header.container.js @@ -6,7 +6,7 @@ import AppHeader from './app-header.component' const actions = require('../../actions') const mapStateToProps = state => { - const { appState, metamask } = state + const { appState, dekusan } = state const { networkDropdownOpen } = appState const { network, @@ -14,7 +14,7 @@ const mapStateToProps = state => { providerRequests, selectedAddress, isUnlocked, - } = metamask + } = dekusan return { networkDropdownOpen, diff --git a/ui/app/components/balance-component.js b/ui/app/components/balance-component.js index 78b51449..50121aa0 100644 --- a/ui/app/components/balance-component.js +++ b/ui/app/components/balance-component.js @@ -14,8 +14,8 @@ module.exports = connect(mapStateToProps)(BalanceComponent) function mapStateToProps (state) { const accounts = getMetaMaskAccounts(state) - const network = state.metamask.network - const selectedAddress = state.metamask.selectedAddress || Object.keys(accounts)[0] + const network = state.dekusan.network + const selectedAddress = state.dekusan.selectedAddress || Object.keys(accounts)[0] const account = accounts[selectedAddress] return { diff --git a/ui/app/components/currency-display/currency-display.container.js b/ui/app/components/currency-display/currency-display.container.js index e581f8a5..61529692 100644 --- a/ui/app/components/currency-display/currency-display.container.js +++ b/ui/app/components/currency-display/currency-display.container.js @@ -3,7 +3,7 @@ import CurrencyDisplay from './currency-display.component' import { getValueFromWeiHex, formatCurrency } from '../../helpers/confirm-transaction/util' const mapStateToProps = state => { - const { metamask: { nativeCurrency, currentCurrency, conversionRate } } = state + const { dekusan: { nativeCurrency, currentCurrency, conversionRate } } = state return { currentCurrency, diff --git a/ui/app/components/currency-display/tests/currency-display.container.test.js b/ui/app/components/currency-display/tests/currency-display.container.test.js index 7973bf60..59cb8e72 100644 --- a/ui/app/components/currency-display/tests/currency-display.container.test.js +++ b/ui/app/components/currency-display/tests/currency-display.container.test.js @@ -17,7 +17,7 @@ describe('CurrencyDisplay container', () => { describe('mapStateToProps()', () => { it('should return the correct props', () => { const mockState = { - metamask: { + dekusan: { conversionRate: 280.45, currentCurrency: 'usd', nativeCurrency: 'ETH', diff --git a/ui/app/components/currency-input/currency-input.container.js b/ui/app/components/currency-input/currency-input.container.js index 941e9380..a5d40730 100644 --- a/ui/app/components/currency-input/currency-input.container.js +++ b/ui/app/components/currency-input/currency-input.container.js @@ -3,7 +3,7 @@ import CurrencyInput from './currency-input.component' import { DEX } from '../../constants/common' const mapStateToProps = state => { - const { metamask: { nativeCurrency, currentCurrency, conversionRate } } = state + const { dekusan: { nativeCurrency, currentCurrency, conversionRate } } = state return { nativeCurrency, diff --git a/ui/app/components/currency-input/tests/currency-input.component.test.js b/ui/app/components/currency-input/tests/currency-input.component.test.js index a33889f9..b5a0e282 100644 --- a/ui/app/components/currency-input/tests/currency-input.component.test.js +++ b/ui/app/components/currency-input/tests/currency-input.component.test.js @@ -21,7 +21,7 @@ describe('CurrencyInput Component', () => { it('should render properly with a suffix', () => { const mockStore = { - metamask: { + dekusan: { nativeCurrency: 'ETH', currentCurrency: 'usd', conversionRate: 231.06, @@ -46,7 +46,7 @@ describe('CurrencyInput Component', () => { it('should render properly with an ETH value', () => { const mockStore = { - metamask: { + dekusan: { nativeCurrency: 'ETH', currentCurrency: 'usd', conversionRate: 231.06, @@ -78,7 +78,7 @@ describe('CurrencyInput Component', () => { it('should render properly with a fiat value', () => { const mockStore = { - metamask: { + dekusan: { nativeCurrency: 'ETH', currentCurrency: 'usd', conversionRate: 231.06, @@ -121,7 +121,7 @@ describe('CurrencyInput Component', () => { it('should call onChange and onBlur on input changes with the hex value for ETH', () => { const mockStore = { - metamask: { + dekusan: { nativeCurrency: 'ETH', currentCurrency: 'usd', conversionRate: 231.06, @@ -167,7 +167,7 @@ describe('CurrencyInput Component', () => { it('should call onChange and onBlur on input changes with the hex value for fiat', () => { const mockStore = { - metamask: { + dekusan: { nativeCurrency: 'ETH', currentCurrency: 'usd', conversionRate: 231.06, @@ -214,7 +214,7 @@ describe('CurrencyInput Component', () => { it('should change the state and pass in a new decimalValue when props.value changes', () => { const mockStore = { - metamask: { + dekusan: { nativeCurrency: 'ETH', currentCurrency: 'usd', conversionRate: 231.06, diff --git a/ui/app/components/currency-input/tests/currency-input.container.test.js b/ui/app/components/currency-input/tests/currency-input.container.test.js index 27965ec0..ce66f386 100644 --- a/ui/app/components/currency-input/tests/currency-input.container.test.js +++ b/ui/app/components/currency-input/tests/currency-input.container.test.js @@ -17,7 +17,7 @@ describe('CurrencyInput container', () => { describe('mapStateToProps()', () => { it('should return the correct props', () => { const mockState = { - metamask: { + dekusan: { conversionRate: 280.45, currentCurrency: 'usd', nativeCurrency: 'ETH', diff --git a/ui/app/components/dropdowns/account-details-dropdown.js b/ui/app/components/dropdowns/account-details-dropdown.js index c4eed8a2..248e88cd 100644 --- a/ui/app/components/dropdowns/account-details-dropdown.js +++ b/ui/app/components/dropdowns/account-details-dropdown.js @@ -17,8 +17,8 @@ module.exports = connect(mapStateToProps, mapDispatchToProps)(AccountDetailsDrop function mapStateToProps (state) { return { selectedIdentity: getSelectedIdentity(state), - network: state.metamask.network, - keyrings: state.metamask.keyrings, + network: state.dekusan.network, + keyrings: state.dekusan.keyrings, } } @@ -63,7 +63,7 @@ AccountDetailsDropdown.prototype.render = function () { return kr.accounts.includes(address) }) - const isRemovable = keyring.type !== 'HD Key Tree' + const isRemovable = keyring && keyring.type !== 'HD Key Tree' return h(Menu, { className: 'account-details-dropdown', isShowing: true }, [ h(CloseArea, { diff --git a/ui/app/components/dropdowns/components/account-dropdowns.js b/ui/app/components/dropdowns/components/account-dropdowns.js index 8febe985..0146c8d0 100644 --- a/ui/app/components/dropdowns/components/account-dropdowns.js +++ b/ui/app/components/dropdowns/components/account-dropdowns.js @@ -459,8 +459,8 @@ const mapDispatchToProps = (dispatch) => { function mapStateToProps (state) { return { - ticker: state.metamask.ticker, - keyrings: state.metamask.keyrings, + ticker: state.dekusan.ticker, + keyrings: state.dekusan.keyrings, sidebarOpen: state.appState.sidebar.isOpen, } } diff --git a/ui/app/components/dropdowns/network-dropdown.js b/ui/app/components/dropdowns/network-dropdown.js index 61ea59fa..d8298963 100644 --- a/ui/app/components/dropdowns/network-dropdown.js +++ b/ui/app/components/dropdowns/network-dropdown.js @@ -23,8 +23,8 @@ const notToggleElementClassnames = [ function mapStateToProps (state) { return { - provider: state.metamask.provider, - frequentRpcListDetail: state.metamask.frequentRpcListDetail || [], + provider: state.dekusan.provider, + frequentRpcListDetail: state.dekusan.frequentRpcListDetail || [], networkDropdownOpen: state.appState.networkDropdownOpen, network: state.metamask.network, } diff --git a/ui/app/components/dropdowns/tests/network-dropdown.test.js b/ui/app/components/dropdowns/tests/network-dropdown.test.js index 4cf47e2d..a956f753 100644 --- a/ui/app/components/dropdowns/tests/network-dropdown.test.js +++ b/ui/app/components/dropdowns/tests/network-dropdown.test.js @@ -11,7 +11,7 @@ describe('Network Dropdown', () => { describe('NetworkDropdown in appState in false', () => { const mockState = { - metamask: { + dekusan: { provider: { type: 'test', }, @@ -41,7 +41,7 @@ describe('Network Dropdown', () => { describe('NetworkDropdown in appState is true', () => { const mockState = { - metamask: { + dekusan: { provider: { 'type': 'test', }, diff --git a/ui/app/components/dropdowns/token-menu-dropdown.js b/ui/app/components/dropdowns/token-menu-dropdown.js index e1db4776..3e4c8e26 100644 --- a/ui/app/components/dropdowns/token-menu-dropdown.js +++ b/ui/app/components/dropdowns/token-menu-dropdown.js @@ -15,7 +15,7 @@ module.exports = connect(mapStateToProps, mapDispatchToProps)(TokenMenuDropdown) function mapStateToProps (state) { return { - network: state.metamask.network, + network: state.dekusan.network, } } diff --git a/ui/app/components/identicon.js b/ui/app/components/identicon.js index 334d1ebd..24175209 100644 --- a/ui/app/components/identicon.js +++ b/ui/app/components/identicon.js @@ -20,7 +20,7 @@ function IdenticonComponent () { function mapStateToProps (state) { return { - useBlockie: state.metamask.useBlockie, + useBlockie: state.dekusan.useBlockie, } } diff --git a/ui/app/components/identicon/tests/identicon.component.test.js b/ui/app/components/identicon/tests/identicon.component.test.js index 2944818f..93e1f9a2 100644 --- a/ui/app/components/identicon/tests/identicon.component.test.js +++ b/ui/app/components/identicon/tests/identicon.component.test.js @@ -7,7 +7,7 @@ import Identicon from '../identicon.component' describe('Identicon', () => { const state = { - metamask: { + dekusan: { useBlockie: false, }, } diff --git a/ui/app/components/modals/account-details-modal.js b/ui/app/components/modals/account-details-modal.js index 2e75c169..2329ec95 100644 --- a/ui/app/components/modals/account-details-modal.js +++ b/ui/app/components/modals/account-details-modal.js @@ -14,9 +14,9 @@ import Button from '../button' function mapStateToProps (state) { return { - network: state.metamask.network, + network: state.dekusan.network, selectedIdentity: getSelectedIdentity(state), - keyrings: state.metamask.keyrings, + keyrings: state.dekusan.keyrings, } } diff --git a/ui/app/components/modals/buy-options-modal.js b/ui/app/components/modals/buy-options-modal.js index c70510b5..77fa50c4 100644 --- a/ui/app/components/modals/buy-options-modal.js +++ b/ui/app/components/modals/buy-options-modal.js @@ -8,8 +8,8 @@ const { getNetworkDisplayName } = require('../../../../app/scripts/controllers/n function mapStateToProps (state) { return { - network: state.metamask.network, - address: state.metamask.selectedAddress, + network: state.dekusan.network, + address: state.dekusan.selectedAddress, } } diff --git a/ui/app/components/modals/cancel-transaction/cancel-transaction.container.js b/ui/app/components/modals/cancel-transaction/cancel-transaction.container.js index 10931a00..85516e28 100644 --- a/ui/app/components/modals/cancel-transaction/cancel-transaction.container.js +++ b/ui/app/components/modals/cancel-transaction/cancel-transaction.container.js @@ -8,9 +8,9 @@ import { showModal, createCancelTransaction } from '../../../actions' import { getHexGasTotal } from '../../../helpers/confirm-transaction/util' const mapStateToProps = (state, ownProps) => { - const { metamask } = state + const { dekusan } = state const { transactionId, originalGasPrice } = ownProps - const { selectedAddressTxList } = metamask + const { selectedAddressTxList } = dekusan const transaction = selectedAddressTxList.find(({ id }) => id === transactionId) const transactionStatus = transaction ? transaction.status : '' diff --git a/ui/app/components/modals/confirm-remove-account/confirm-remove-account.container.js b/ui/app/components/modals/confirm-remove-account/confirm-remove-account.container.js index 45c6654a..1df2376f 100644 --- a/ui/app/components/modals/confirm-remove-account/confirm-remove-account.container.js +++ b/ui/app/components/modals/confirm-remove-account/confirm-remove-account.container.js @@ -6,7 +6,7 @@ import { removeAccount } from '../../../actions' const mapStateToProps = state => { return { - network: state.metamask.network, + network: state.dekusan.network, } } diff --git a/ui/app/components/modals/deposit-ether-modal.js b/ui/app/components/modals/deposit-ether-modal.js index ba5cbedb..5610440c 100644 --- a/ui/app/components/modals/deposit-ether-modal.js +++ b/ui/app/components/modals/deposit-ether-modal.js @@ -14,8 +14,8 @@ let FAUCET_ROW_TITLE function mapStateToProps (state) { return { - network: state.metamask.network, - address: state.metamask.selectedAddress, + network: state.dekusan.network, + address: state.dekusan.selectedAddress, } } diff --git a/ui/app/components/modals/export-private-key-modal.js b/ui/app/components/modals/export-private-key-modal.js index d3e3c9a5..d0bd5230 100644 --- a/ui/app/components/modals/export-private-key-modal.js +++ b/ui/app/components/modals/export-private-key-modal.js @@ -24,7 +24,7 @@ function mapStateToPropsFactory () { return { warning: state.appState.warning, privateKey: state.appState.accountDetail.privateKey, - network: state.metamask.network, + network: state.dekusan.network, selectedIdentity, previousModalState: state.appState.modal.previousModalState.name, } diff --git a/ui/app/components/modals/hide-token-confirmation-modal.js b/ui/app/components/modals/hide-token-confirmation-modal.js index 43f3009a..184dece0 100644 --- a/ui/app/components/modals/hide-token-confirmation-modal.js +++ b/ui/app/components/modals/hide-token-confirmation-modal.js @@ -8,9 +8,9 @@ import Identicon from '../identicon' function mapStateToProps (state) { return { - network: state.metamask.network, + network: state.dekusan.network, token: state.appState.modal.modalState.props.token, - assetImages: state.metamask.assetImages, + assetImages: state.dekusan.assetImages, } } diff --git a/ui/app/components/modals/new-account-modal.js b/ui/app/components/modals/new-account-modal.js index a66a3ed4..fea6aaac 100644 --- a/ui/app/components/modals/new-account-modal.js +++ b/ui/app/components/modals/new-account-modal.js @@ -73,7 +73,7 @@ NewAccountModal.propTypes = { } const mapStateToProps = state => { - const { metamask: { network, selectedAddress, identities = {} } } = state + const { dekusan: { network, selectedAddress, identities = {} } } = state const numberOfExistingAccounts = Object.keys(identities).length return { diff --git a/ui/app/components/network-display/network-display.container.js b/ui/app/components/network-display/network-display.container.js index 99a14fff..c57010f0 100644 --- a/ui/app/components/network-display/network-display.container.js +++ b/ui/app/components/network-display/network-display.container.js @@ -1,7 +1,7 @@ import { connect } from 'react-redux' import NetworkDisplay from './network-display.component' -const mapStateToProps = ({ metamask: { network, provider } }) => { +const mapStateToProps = ({ dekusan: { network, provider } }) => { return { network, provider, diff --git a/ui/app/components/pages/add-token/add-token.component.js b/ui/app/components/pages/add-token/add-token.component.js index 82299bf8..bd0a48f3 100644 --- a/ui/app/components/pages/add-token/add-token.component.js +++ b/ui/app/components/pages/add-token/add-token.component.js @@ -288,9 +288,9 @@ class AddToken extends Component { renderTabs () { return ( <Tabs> - <Tab name={this.context.t('search')}> + {/* <Tab name={this.context.t('search')}> { this.renderSearchToken() } - </Tab> + </Tab> */} <Tab name={this.context.t('customToken')}> { this.renderCustomTokenForm() } </Tab> diff --git a/ui/app/components/pages/add-token/add-token.container.js b/ui/app/components/pages/add-token/add-token.container.js index 87671b15..87ba33f5 100644 --- a/ui/app/components/pages/add-token/add-token.container.js +++ b/ui/app/components/pages/add-token/add-token.container.js @@ -3,8 +3,8 @@ import AddToken from './add-token.component' const { setPendingTokens, clearPendingTokens } = require('../../../actions') -const mapStateToProps = ({ metamask }) => { - const { identities, tokens, pendingTokens } = metamask +const mapStateToProps = ({ dekusan }) => { + const { identities, tokens, pendingTokens } = dekusan return { identities, tokens, diff --git a/ui/app/components/pages/add-token/token-list/token-list.container.js b/ui/app/components/pages/add-token/token-list/token-list.container.js index cd7b07a3..597e7265 100644 --- a/ui/app/components/pages/add-token/token-list/token-list.container.js +++ b/ui/app/components/pages/add-token/token-list/token-list.container.js @@ -1,8 +1,8 @@ import { connect } from 'react-redux' import TokenList from './token-list.component' -const mapStateToProps = ({ metamask }) => { - const { tokens } = metamask +const mapStateToProps = ({ dekusan }) => { + const { tokens } = dekusan return { tokens, } diff --git a/ui/app/components/pages/authenticated.js b/ui/app/components/pages/authenticated.js index 1f6b0be4..e9c12086 100644 --- a/ui/app/components/pages/authenticated.js +++ b/ui/app/components/pages/authenticated.js @@ -24,7 +24,7 @@ Authenticated.propTypes = { } const mapStateToProps = state => { - const { metamask: { isUnlocked, isInitialized } } = state + const { dekusan: { isUnlocked, isInitialized } } = state return { isUnlocked, isInitialized, diff --git a/ui/app/components/pages/confirm-add-suggested-token/confirm-add-suggested-token.container.js b/ui/app/components/pages/confirm-add-suggested-token/confirm-add-suggested-token.container.js index 1f2737e5..80dd9508 100644 --- a/ui/app/components/pages/confirm-add-suggested-token/confirm-add-suggested-token.container.js +++ b/ui/app/components/pages/confirm-add-suggested-token/confirm-add-suggested-token.container.js @@ -7,8 +7,8 @@ const extend = require('xtend') const { addToken, removeSuggestedTokens } = require('../../../actions') -const mapStateToProps = ({ metamask }) => { - const { pendingTokens, suggestedTokens } = metamask +const mapStateToProps = ({ dekusan }) => { + const { pendingTokens, suggestedTokens } = dekusan const params = extend(pendingTokens, suggestedTokens) return { diff --git a/ui/app/components/pages/confirm-add-token/confirm-add-token.container.js b/ui/app/components/pages/confirm-add-token/confirm-add-token.container.js index 0190024d..1b52615e 100644 --- a/ui/app/components/pages/confirm-add-token/confirm-add-token.container.js +++ b/ui/app/components/pages/confirm-add-token/confirm-add-token.container.js @@ -3,8 +3,8 @@ import ConfirmAddToken from './confirm-add-token.component' const { addTokens, clearPendingTokens } = require('../../../actions') -const mapStateToProps = ({ metamask }) => { - const { pendingTokens } = metamask +const mapStateToProps = ({ dekusan }) => { + const { pendingTokens } = dekusan return { pendingTokens, } diff --git a/ui/app/components/pages/confirm-token-transaction-base/confirm-token-transaction-base.container.js b/ui/app/components/pages/confirm-token-transaction-base/confirm-token-transaction-base.container.js index be38acdb..ef09b401 100644 --- a/ui/app/components/pages/confirm-token-transaction-base/confirm-token-transaction-base.container.js +++ b/ui/app/components/pages/confirm-token-transaction-base/confirm-token-transaction-base.container.js @@ -7,7 +7,7 @@ import { const mapStateToProps = (state, ownProps) => { const { tokenAmount: ownTokenAmount } = ownProps - const { confirmTransaction, metamask: { currentCurrency, conversionRate } } = state + const { confirmTransaction, dekusan: { currentCurrency, conversionRate } } = state const { txData: { txParams: { to: tokenAddress } = {} } = {}, tokenProps: { tokenSymbol } = {}, diff --git a/ui/app/components/pages/confirm-transaction-base/confirm-transaction-base.container.js b/ui/app/components/pages/confirm-transaction-base/confirm-transaction-base.container.js index 1e227043..417ffd94 100644 --- a/ui/app/components/pages/confirm-transaction-base/confirm-transaction-base.container.js +++ b/ui/app/components/pages/confirm-transaction-base/confirm-transaction-base.container.js @@ -29,7 +29,7 @@ const casedContractMap = Object.keys(contractMap).reduce((acc, base) => { const mapStateToProps = (state, props) => { const { toAddress: propsToAddress } = props - const { confirmTransaction, metamask, gas } = state + const { confirmTransaction, dekusan, gas } = state const { ethTransactionAmount, ethTransactionFee, @@ -58,7 +58,7 @@ const mapStateToProps = (state, props) => { assetImages, network, unapprovedTxs, - } = metamask + } = dekusan const assetImage = assetImages[txParamsToAddress] const { @@ -79,7 +79,7 @@ const mapStateToProps = (state, props) => { const transactionStatus = transaction ? transaction.status : '' const currentNetworkUnapprovedTxs = R.filter( - ({ metamaskNetworkId }) => metamaskNetworkId === network, + ({ dekusanNetworkId }) => dekusanNetworkId === network, unapprovedTxs, ) const unapprovedTxCount = valuesFor(currentNetworkUnapprovedTxs).length diff --git a/ui/app/components/pages/confirm-transaction/confirm-transaction.container.js b/ui/app/components/pages/confirm-transaction/confirm-transaction.container.js index 46342dc7..9b952f42 100644 --- a/ui/app/components/pages/confirm-transaction/confirm-transaction.container.js +++ b/ui/app/components/pages/confirm-transaction/confirm-transaction.container.js @@ -13,7 +13,7 @@ import { getTotalUnapprovedCount } from '../../../selectors' import { unconfirmedTransactionsListSelector } from '../../../selectors/confirm-transaction' const mapStateToProps = state => { - const { metamask: { send }, confirmTransaction } = state + const { dekusan: { send }, confirmTransaction } = state return { totalUnapprovedCount: getTotalUnapprovedCount(state), diff --git a/ui/app/components/pages/create-account/connect-hardware/connect-screen.js b/ui/app/components/pages/create-account/connect-hardware/connect-screen.js index 026b6620..9ba85c8b 100644 --- a/ui/app/components/pages/create-account/connect-hardware/connect-screen.js +++ b/ui/app/components/pages/create-account/connect-hardware/connect-screen.js @@ -85,8 +85,8 @@ class ConnectScreen extends Component { getAffiliateLinks () { const links = { - trezor: `<a class='hw-connect__get-hw__link' href='https://shop.trezor.io/?a=metamask' target='_blank'>Trezor</a>`, - ledger: `<a class='hw-connect__get-hw__link' href='https://www.ledger.com/products/ledger-nano-s?r=17c4991a03fa&tracker=MY_TRACKER' target='_blank'>Ledger</a>`, + trezor: `<a class='hw-connect__get-hw__link' href='https://shop.trezor.io' target='_blank'>Trezor</a>`, + ledger: `<a class='hw-connect__get-hw__link' href='https://www.ledger.com/products/ledger-nano-s' target='_blank'>Ledger</a>`, } const text = this.context.t('orderOneHere') @@ -155,7 +155,7 @@ class ConnectScreen extends Component { h('p.hw-connect__footer__msg', {}, [ this.context.t(`havingTroubleConnecting`), h('a.hw-connect__footer__link', { - href: 'https://support.metamask.io/', + href: 'https://github.com/dexon-foundation/dekusan/issues', target: '_blank', }, this.context.t('getHelp')), ]), diff --git a/ui/app/components/pages/create-account/connect-hardware/index.js b/ui/app/components/pages/create-account/connect-hardware/index.js index bd877fd4..38fbd2f4 100644 --- a/ui/app/components/pages/create-account/connect-hardware/index.js +++ b/ui/app/components/pages/create-account/connect-hardware/index.js @@ -225,7 +225,7 @@ ConnectHardwareForm.propTypes = { const mapStateToProps = state => { const { - metamask: { network, selectedAddress, identities = {} }, + dekusan: { network, selectedAddress, identities = {} }, } = state const accounts = getMetaMaskAccounts(state) const numberOfExistingAccounts = Object.keys(identities).length diff --git a/ui/app/components/pages/create-account/import-account/index.js b/ui/app/components/pages/create-account/import-account/index.js index 48d8f883..1eb9d060 100644 --- a/ui/app/components/pages/create-account/import-account/index.js +++ b/ui/app/components/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://github.com/dexon-foundation/wiki/wiki', }) }, }, this.context.t('here')), diff --git a/ui/app/components/pages/create-account/import-account/json.js b/ui/app/components/pages/create-account/import-account/json.js index 8ca167e2..05bd3110 100644 --- a/ui/app/components/pages/create-account/import-account/json.js +++ b/ui/app/components/pages/create-account/import-account/json.js @@ -8,7 +8,6 @@ const actions = require('../../../../actions') const FileInput = require('react-simple-file-input').default const { DEFAULT_ROUTE } = require('../../../../routes') const { getMetaMaskAccounts } = require('../../../../selectors') -const HELP_LINK = 'https://support.metamask.io/kb/article/7-importing-accounts' import Button from '../../../button' class JsonImportSubview extends Component { diff --git a/ui/app/components/pages/create-account/new-account.js b/ui/app/components/pages/create-account/new-account.js index 94a5fa48..59399a7d 100644 --- a/ui/app/components/pages/create-account/new-account.js +++ b/ui/app/components/pages/create-account/new-account.js @@ -73,7 +73,7 @@ NewAccountCreateForm.propTypes = { } const mapStateToProps = state => { - const { metamask: { network, selectedAddress, identities = {} } } = state + const { dekusan: { network, selectedAddress, identities = {} } } = state const numberOfExistingAccounts = Object.keys(identities).length return { diff --git a/ui/app/components/pages/home/home.component.js b/ui/app/components/pages/home/home.component.js index b9ec3c25..9b02881c 100644 --- a/ui/app/components/pages/home/home.component.js +++ b/ui/app/components/pages/home/home.component.js @@ -8,9 +8,9 @@ import ProviderApproval from '../provider-approval' import { INITIALIZE_BACKUP_PHRASE_ROUTE, + INITIALIZE_NOTICE_ROUTE, RESTORE_VAULT_ROUTE, CONFIRM_TRANSACTION_ROUTE, - NOTICE_ROUTE, CONFIRM_ADD_SUGGESTED_TOKEN_ROUTE, } from '../../../routes' @@ -54,7 +54,7 @@ export default class Home extends PureComponent { // notices if (!noActiveNotices || (lostAccounts && lostAccounts.length > 0)) { - return <Redirect to={{ pathname: NOTICE_ROUTE }} /> + return <Redirect to={{ pathname: INITIALIZE_NOTICE_ROUTE }} /> } // seed words diff --git a/ui/app/components/pages/home/home.container.js b/ui/app/components/pages/home/home.container.js index bb8cf5e8..e12e5516 100644 --- a/ui/app/components/pages/home/home.container.js +++ b/ui/app/components/pages/home/home.container.js @@ -5,14 +5,14 @@ import { withRouter } from 'react-router-dom' import { unconfirmedTransactionsCountSelector } from '../../../selectors/confirm-transaction' const mapStateToProps = state => { - const { metamask, appState } = state + const { dekusan, appState } = state const { noActiveNotices, lostAccounts, seedWords, suggestedTokens, providerRequests, - } = metamask + } = dekusan const { forgottenPassword } = appState return { diff --git a/ui/app/components/pages/initialized.js b/ui/app/components/pages/initialized.js index 3adf67b2..503d801b 100644 --- a/ui/app/components/pages/initialized.js +++ b/ui/app/components/pages/initialized.js @@ -16,7 +16,7 @@ Initialized.propTypes = { } const mapStateToProps = state => { - const { metamask: { isInitialized } } = state + const { dekusan: { isInitialized } } = state return { isInitialized, } diff --git a/ui/app/components/pages/metamask-route.js b/ui/app/components/pages/metamask-route.js index 23c5b519..d97490ee 100644 --- a/ui/app/components/pages/metamask-route.js +++ b/ui/app/components/pages/metamask-route.js @@ -19,7 +19,7 @@ MetamaskRoute.propTypes = { } const mapStateToProps = state => { - const { metamask: { isMascara } } = state + const { dekusan: { isMascara } } = state return { isMascara, } diff --git a/ui/app/components/pages/notice.js b/ui/app/components/pages/notice.js index a9077b98..4a415287 100644 --- a/ui/app/components/pages/notice.js +++ b/ui/app/components/pages/notice.js @@ -153,8 +153,8 @@ class Notice extends Component { } const mapStateToProps = state => { - const { metamask } = state - const { noActiveNotices, nextUnreadNotice, lostAccounts } = metamask + const { dekusan } = state + const { noActiveNotices, nextUnreadNotice, lostAccounts } = dekusan return { noActiveNotices, diff --git a/ui/app/components/pages/settings/info-tab/info-tab.component.js b/ui/app/components/pages/settings/info-tab/info-tab.component.js index b57b4cc3..6e9b6650 100644 --- a/ui/app/components/pages/settings/info-tab/info-tab.component.js +++ b/ui/app/components/pages/settings/info-tab/info-tab.component.js @@ -8,7 +8,7 @@ export default class InfoTab extends PureComponent { static propTypes = { tab: PropTypes.string, - metamask: PropTypes.object, + dekusan: PropTypes.object, setCurrentCurrency: PropTypes.func, setRpcTarget: PropTypes.func, displayWarning: PropTypes.func, @@ -32,7 +32,7 @@ export default class InfoTab extends PureComponent { </div> <div className="info-tab__link-item"> <a - href="https://dexon.org/dekusan/privacy.html" + href="https://github.com/dexon-foundation/dekusan/blob/develop/docs/privacy.md" target="_blank" rel="noopener noreferrer" > @@ -43,7 +43,7 @@ export default class InfoTab extends PureComponent { </div> <div className="info-tab__link-item"> <a - href="https://dexon.org/dekusan/terms.html" + href="https://github.com/dexon-foundation/dekusan/blob/develop/docs/terms-of-use.md" target="_blank" rel="noopener noreferrer" > @@ -52,7 +52,7 @@ export default class InfoTab extends PureComponent { </span> </a> </div> - <div className="info-tab__link-item"> + {/* <div className="info-tab__link-item"> <a href="https://metamask.io/attributions.html" target="_blank" @@ -62,9 +62,9 @@ export default class InfoTab extends PureComponent { { t('attributions') } </span> </a> - </div> + </div> */} <hr className="info-tab__separator" /> - <div className="info-tab__link-item"> + {/* <div className="info-tab__link-item"> <a href="https://dexon.org" target="_blank" @@ -74,7 +74,7 @@ export default class InfoTab extends PureComponent { { t('supportCenter') } </span> </a> - </div> + </div> */} <div className="info-tab__link-item"> <a href="https://dexon.org/" diff --git a/ui/app/components/pages/settings/settings-tab/settings-tab.component.js b/ui/app/components/pages/settings/settings-tab/settings-tab.component.js index 761c32a8..f6af62bc 100644 --- a/ui/app/components/pages/settings/settings-tab/settings-tab.component.js +++ b/ui/app/components/pages/settings/settings-tab/settings-tab.component.js @@ -36,7 +36,7 @@ export default class SettingsTab extends PureComponent { } static propTypes = { - metamask: PropTypes.object, + dekusan: PropTypes.object, setUseBlockie: PropTypes.func, setHexDataFeatureFlag: PropTypes.func, setPrivacyMode: PropTypes.func, diff --git a/ui/app/components/pages/settings/settings-tab/settings-tab.container.js b/ui/app/components/pages/settings/settings-tab/settings-tab.container.js index 04d79295..6a033a4d 100644 --- a/ui/app/components/pages/settings/settings-tab/settings-tab.container.js +++ b/ui/app/components/pages/settings/settings-tab/settings-tab.container.js @@ -16,7 +16,7 @@ import { import { preferencesSelector } from '../../../../selectors' const mapStateToProps = state => { - const { appState: { warning }, metamask } = state + const { appState: { warning }, dekusan } = state const { currentCurrency, conversionDate, @@ -29,7 +29,7 @@ const mapStateToProps = state => { provider = {}, isMascara, currentLocale, - } = metamask + } = dekusan const { useNativeCurrencyAsPrimaryCurrency } = preferencesSelector(state) return { diff --git a/ui/app/components/pages/unlock-page/unlock-page.container.js b/ui/app/components/pages/unlock-page/unlock-page.container.js index 18fed9b2..874545eb 100644 --- a/ui/app/components/pages/unlock-page/unlock-page.container.js +++ b/ui/app/components/pages/unlock-page/unlock-page.container.js @@ -11,7 +11,7 @@ const { import UnlockPage from './unlock-page.component' const mapStateToProps = state => { - const { metamask: { isUnlocked } } = state + const { dekusan: { isUnlocked } } = state return { isUnlocked, } diff --git a/ui/app/components/send/send-content/send-amount-row/amount-max-button/amount-max-button.selectors.js b/ui/app/components/send/send-content/send-amount-row/amount-max-button/amount-max-button.selectors.js index 69fec199..d250e23e 100644 --- a/ui/app/components/send/send-content/send-amount-row/amount-max-button/amount-max-button.selectors.js +++ b/ui/app/components/send/send-content/send-amount-row/amount-max-button/amount-max-button.selectors.js @@ -5,5 +5,5 @@ const selectors = { module.exports = selectors function getMaxModeOn (state) { - return state.metamask.send.maxModeOn + return state.dekusan.send.maxModeOn } diff --git a/ui/app/components/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-selectors.test.js b/ui/app/components/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-selectors.test.js index 655fe196..c4923a70 100644 --- a/ui/app/components/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-selectors.test.js +++ b/ui/app/components/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-selectors.test.js @@ -8,7 +8,7 @@ describe('amount-max-button selectors', () => { describe('getMaxModeOn()', () => { it('should', () => { const state = { - metamask: { + dekusan: { send: { maxModeOn: null, }, diff --git a/ui/app/components/send/send-content/send-hex-data-row/send-hex-data-row.container.js b/ui/app/components/send/send-content/send-hex-data-row/send-hex-data-row.container.js index df554ca5..c2c9cff7 100644 --- a/ui/app/components/send/send-content/send-hex-data-row/send-hex-data-row.container.js +++ b/ui/app/components/send/send-content/send-hex-data-row/send-hex-data-row.container.js @@ -8,7 +8,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(SendHexDataRow) function mapStateToProps (state) { return { - data: state.metamask.send.data, + data: state.dekusan.send.data, } } diff --git a/ui/app/components/send/send.selectors.js b/ui/app/components/send/send.selectors.js index 443c82af..175ada9b 100644 --- a/ui/app/components/send/send.selectors.js +++ b/ui/app/components/send/send.selectors.js @@ -62,7 +62,7 @@ module.exports = selectors function accountsWithSendEtherInfoSelector (state) { const accounts = getMetaMaskAccounts(state) - const { identities } = state.metamask + const { identities } = state.dekusan const accountsWithSendEtherInfo = Object.entries(accounts).map(([key, account]) => { return Object.assign({}, account, identities[key]) @@ -83,13 +83,13 @@ function accountsWithSendEtherInfoSelector (state) { // const userPassesThreshold = (numberOfTransactions > autoAddTransactionThreshold) && // (numberOfAccounts > autoAddAccountsThreshold) && // (numberOfTokensAdded > autoAddTokensThreshold) -// const userIsNotInBeta = !state.metamask.featureFlags.betaUI +// const userIsNotInBeta = !state.dekusan.featureFlags.betaUI // return userIsNotInBeta && userPassesThreshold // } function getAddressBook (state) { - return state.metamask.addressBook + return state.dekusan.addressBook } function getAmountConversionRate (state) { @@ -99,11 +99,11 @@ function getAmountConversionRate (state) { } function getBlockGasLimit (state) { - return state.metamask.currentBlockGasLimit + return state.dekusan.currentBlockGasLimit } function getConversionRate (state) { - return state.metamask.conversionRate + return state.dekusan.conversionRate } function getCurrentAccountWithSendEtherInfo (state) { @@ -114,7 +114,7 @@ function getCurrentAccountWithSendEtherInfo (state) { } function getCurrentCurrency (state) { - return state.metamask.currentCurrency + return state.dekusan.currentCurrency } function getNativeCurrency (state) { @@ -122,7 +122,7 @@ function getNativeCurrency (state) { } function getCurrentNetwork (state) { - return state.metamask.network + return state.dekusan.network } function getCurrentViewContext (state) { @@ -131,19 +131,19 @@ function getCurrentViewContext (state) { } function getForceGasMin (state) { - return state.metamask.send.forceGasMin + return state.dekusan.send.forceGasMin } function getGasLimit (state) { - return state.metamask.send.gasLimit || '0' + return state.dekusan.send.gasLimit || '0' } function getGasPrice (state) { - return state.metamask.send.gasPrice || getFastPriceEstimateInHexWEI(state) + return state.dekusan.send.gasPrice || getFastPriceEstimateInHexWEI(state) } function getGasPriceFromRecentBlocks (state) { - return estimateGasPriceFromRecentBlocks(state.metamask.recentBlocks) + return estimateGasPriceFromRecentBlocks(state.dekusan.recentBlocks) } function getGasTotal (state) { @@ -156,7 +156,7 @@ function getPrimaryCurrency (state) { } function getRecentBlocks (state) { - return state.metamask.recentBlocks + return state.dekusan.recentBlocks } function getSelectedAccount (state) { @@ -167,23 +167,23 @@ function getSelectedAccount (state) { } function getSelectedAddress (state) { - const selectedAddress = state.metamask.selectedAddress || Object.keys(getMetaMaskAccounts(state))[0] + const selectedAddress = state.dekusan.selectedAddress || Object.keys(getMetaMaskAccounts(state))[0] return selectedAddress } function getSelectedIdentity (state) { const selectedAddress = getSelectedAddress(state) - const identities = state.metamask.identities + const identities = state.dekusan.identities return identities[selectedAddress] } function getSelectedToken (state) { - const tokens = state.metamask.tokens || [] - const selectedTokenAddress = state.metamask.selectedTokenAddress + const tokens = state.dekusan.tokens || [] + const selectedTokenAddress = state.dekusan.selectedTokenAddress const selectedToken = tokens.filter(({ address }) => address === selectedTokenAddress)[0] - const sendToken = state.metamask.send.token + const sendToken = state.dekusan.send.token return selectedToken || sendToken || null } @@ -197,7 +197,7 @@ function getSelectedTokenContract (state) { } function getSelectedTokenExchangeRate (state) { - const tokenExchangeRates = state.metamask.tokenExchangeRates + const tokenExchangeRates = state.dekusan.tokenExchangeRates const selectedToken = getSelectedToken(state) || {} const { symbol = '' } = selectedToken const pair = `${symbol.toLowerCase()}_eth` @@ -220,19 +220,19 @@ function getSelectedTokenToFiatRate (state) { } function getSendAmount (state) { - return state.metamask.send.amount + return state.dekusan.send.amount } function getSendHexData (state) { - return state.metamask.send.data + return state.dekusan.send.data } function getSendHexDataFeatureFlagState (state) { - return state.metamask.featureFlags.sendHexData + return state.dekusan.featureFlags.sendHexData } function getSendEditingTransactionId (state) { - return state.metamask.send.editingTransactionId + return state.dekusan.send.editingTransactionId } function getSendErrors (state) { @@ -240,7 +240,7 @@ function getSendErrors (state) { } function getSendFrom (state) { - return state.metamask.send.from + return state.dekusan.send.from } function getSendFromBalance (state) { @@ -253,11 +253,11 @@ function getSendFromObject (state) { } function getSendMaxModeState (state) { - return state.metamask.send.maxModeOn + return state.dekusan.send.maxModeOn } function getSendTo (state) { - return state.metamask.send.to + return state.dekusan.send.to } function getSendToAccounts (state) { @@ -269,26 +269,26 @@ function getSendToAccounts (state) { } function getTokenBalance (state) { - return state.metamask.send.tokenBalance + return state.dekusan.send.tokenBalance } function getTokenExchangeRate (state, tokenSymbol) { const pair = `${tokenSymbol.toLowerCase()}_eth` - const tokenExchangeRates = state.metamask.tokenExchangeRates + const tokenExchangeRates = state.dekusan.tokenExchangeRates const { rate: tokenExchangeRate = 0 } = tokenExchangeRates[pair] || {} return tokenExchangeRate } function getUnapprovedTxs (state) { - return state.metamask.unapprovedTxs + return state.dekusan.unapprovedTxs } function transactionsSelector (state) { - const { network, selectedTokenAddress } = state.metamask - const unapprovedMsgs = valuesFor(state.metamask.unapprovedMsgs) - const shapeShiftTxList = (network === '1') ? state.metamask.shapeShiftTxList : undefined - const transactions = state.metamask.selectedAddressTxList || [] + const { network, selectedTokenAddress } = state.dekusan + const unapprovedMsgs = valuesFor(state.dekusan.unapprovedMsgs) + const shapeShiftTxList = (network === '1') ? state.dekusan.shapeShiftTxList : undefined + const transactions = state.dekusan.selectedAddressTxList || [] const txsToRender = !shapeShiftTxList ? transactions.concat(unapprovedMsgs) : transactions.concat(unapprovedMsgs, shapeShiftTxList) return selectedTokenAddress diff --git a/ui/app/components/send/tests/send-selectors-test-data.js b/ui/app/components/send/tests/send-selectors-test-data.js index 09cadfd0..79489bf9 100644 --- a/ui/app/components/send/tests/send-selectors-test-data.js +++ b/ui/app/components/send/tests/send-selectors-test-data.js @@ -1,9 +1,9 @@ module.exports = { - 'metamask': { + 'dekusan': { 'isInitialized': true, 'isUnlocked': true, 'featureFlags': {'betaUI': true, 'sendHexData': true}, - 'rpcTarget': 'https://rawtestrpc.metamask.io/', + 'rpcTarget': 'https://api-testnet.dexon.org/v1/network/rpc/', 'identities': { '0xfdea65c8e26263f6d9a1b5de9555d2931a33b825': { 'address': '0xfdea65c8e26263f6d9a1b5de9555d2931a33b825', @@ -182,13 +182,13 @@ module.exports = { 'time': 1487363153561, 'status': 'unapproved', 'gasMultiplier': 1, - 'metamaskNetworkId': '3', + 'dekusanNetworkId': '3', 'txParams': { 'from': '0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb', 'to': '0x18a3462427bcc9133bb46e88bcbe39cd7ef0e761', 'value': '0xde0b6b3a7640000', 'metamaskId': 4768706228115573, - 'metamaskNetworkId': '3', + 'dekusanNetworkId': '3', 'gas': '0x5209', }, 'gasLimitSpecified': false, diff --git a/ui/app/components/send/tests/send-selectors.test.js b/ui/app/components/send/tests/send-selectors.test.js index cdc86fe5..6c2104ab 100644 --- a/ui/app/components/send/tests/send-selectors.test.js +++ b/ui/app/components/send/tests/send-selectors.test.js @@ -128,7 +128,7 @@ describe('send selectors', () => { it('should return the eth conversion rate if no token is selected', () => { const editedMockState = { - metamask: Object.assign({}, mockState.metamask, { selectedTokenAddress: null }), + dekusan: Object.assign({}, mockstate.dekusan, { selectedTokenAddress: null }), } assert.equal( getAmountConversionRate(editedMockState), @@ -314,7 +314,7 @@ describe('send selectors', () => { symbol: 'JKL', } const editedMockState = { - metamask: Object.assign({}, mockState.metamask, { + dekusan: Object.assign({}, mockstate.dekusan, { selectedTokenAddress: null, send: { token: mockSendToken, @@ -337,9 +337,9 @@ describe('send selectors', () => { }) it('should return null if no token is selected', () => { - const modifiedMetamaskState = Object.assign({}, mockState.metamask, { selectedTokenAddress: false }) + const modifiedMetamaskState = Object.assign({}, mockstate.dekusan, { selectedTokenAddress: false }) assert.equal( - getSelectedTokenContract(Object.assign({}, mockState, { metamask: modifiedMetamaskState })), + getSelectedTokenContract(Object.assign({}, mockState, { dekusan: modifiedMetamaskState })), null ) }) @@ -421,7 +421,7 @@ describe('send selectors', () => { it('should get the selected account balance if the send.from does not exist', () => { const editedMockState = { - metamask: Object.assign({}, mockState.metamask, { + dekusan: Object.assign({}, mockstate.dekusan, { send: { from: null, }, @@ -447,7 +447,7 @@ describe('send selectors', () => { it('should return the current account with send ether info if send.from does not exist', () => { const editedMockState = { - metamask: Object.assign({}, mockState.metamask, { + dekusan: Object.assign({}, mockstate.dekusan, { send: { from: null, }, @@ -554,13 +554,13 @@ describe('send selectors', () => { time: 1487363153561, status: 'unapproved', gasMultiplier: 1, - metamaskNetworkId: '3', + dekusanNetworkId: '3', txParams: { from: '0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb', to: '0x18a3462427bcc9133bb46e88bcbe39cd7ef0e761', value: '0xde0b6b3a7640000', metamaskId: 4768706228115573, - metamaskNetworkId: '3', + dekusanNetworkId: '3', gas: '0x5209', }, gasLimitSpecified: false, @@ -599,8 +599,8 @@ describe('send selectors', () => { }) it('should return all transactions if no token is selected', () => { - const modifiedMetamaskState = Object.assign({}, mockState.metamask, { selectedTokenAddress: false }) - const modifiedState = Object.assign({}, mockState, { metamask: modifiedMetamaskState }) + const modifiedMetamaskState = Object.assign({}, mockstate.dekusan, { selectedTokenAddress: false }) + const modifiedState = Object.assign({}, mockState, { dekusan: modifiedMetamaskState }) assert.deepEqual( transactionsSelector(modifiedState), [ @@ -649,8 +649,8 @@ describe('send selectors', () => { }) it('should return shapeshift transactions if current network is 1', () => { - const modifiedMetamaskState = Object.assign({}, mockState.metamask, { selectedTokenAddress: false, network: '1' }) - const modifiedState = Object.assign({}, mockState, { metamask: modifiedMetamaskState }) + const modifiedMetamaskState = Object.assign({}, mockstate.dekusan, { selectedTokenAddress: false, network: '1' }) + const modifiedState = Object.assign({}, mockState, { dekusan: modifiedMetamaskState }) assert.deepEqual( transactionsSelector(modifiedState), [ diff --git a/ui/app/components/shapeshift-form.js b/ui/app/components/shapeshift-form.js index 14513959..ab04d98a 100644 --- a/ui/app/components/shapeshift-form.js +++ b/ui/app/components/shapeshift-form.js @@ -16,7 +16,7 @@ function mapStateToProps (state) { coinOptions, tokenExchangeRates, selectedAddress, - } = state.metamask + } = state.dekusan const { warning } = state.appState return { diff --git a/ui/app/components/shift-list-item.js b/ui/app/components/shift-list-item.js index c0bffb82..2c05504c 100644 --- a/ui/app/components/shift-list-item.js +++ b/ui/app/components/shift-list-item.js @@ -22,9 +22,9 @@ module.exports = connect(mapStateToProps)(ShiftListItem) function mapStateToProps (state) { return { - selectedAddress: state.metamask.selectedAddress, - conversionRate: state.metamask.conversionRate, - currentCurrency: state.metamask.currentCurrency, + selectedAddress: state.dekusan.selectedAddress, + conversionRate: state.dekusan.conversionRate, + currentCurrency: state.dekusan.currentCurrency, } } diff --git a/ui/app/components/token-cell.js b/ui/app/components/token-cell.js index aad9e471..b044d95c 100644 --- a/ui/app/components/token-cell.js +++ b/ui/app/components/token-cell.js @@ -12,12 +12,12 @@ const TokenMenuDropdown = require('./dropdowns/token-menu-dropdown.js') function mapStateToProps (state) { return { - network: state.metamask.network, - currentCurrency: state.metamask.currentCurrency, - selectedTokenAddress: state.metamask.selectedTokenAddress, + network: state.dekusan.network, + currentCurrency: state.dekusan.currentCurrency, + selectedTokenAddress: state.dekusan.selectedTokenAddress, userAddress: selectors.getSelectedAddress(state), - contractExchangeRates: state.metamask.contractExchangeRates, - conversionRate: state.metamask.conversionRate, + contractExchangeRates: state.dekusan.contractExchangeRates, + conversionRate: state.dekusan.conversionRate, sidebarOpen: state.appState.sidebar.isOpen, } } diff --git a/ui/app/components/token-input/tests/token-input.component.test.js b/ui/app/components/token-input/tests/token-input.component.test.js index 2dacb9bc..03ad5376 100644 --- a/ui/app/components/token-input/tests/token-input.component.test.js +++ b/ui/app/components/token-input/tests/token-input.component.test.js @@ -25,7 +25,7 @@ describe('TokenInput Component', () => { it('should render properly with a token', () => { const mockStore = { - metamask: { + dekusan: { currentCurrency: 'usd', conversionRate: 231.06, }, @@ -59,7 +59,7 @@ describe('TokenInput Component', () => { it('should render properly with a token and selectedTokenExchangeRate', () => { const mockStore = { - metamask: { + dekusan: { currentCurrency: 'usd', conversionRate: 231.06, }, @@ -93,7 +93,7 @@ describe('TokenInput Component', () => { it('should render properly with a token value for ETH', () => { const mockStore = { - metamask: { + dekusan: { currentCurrency: 'usd', conversionRate: 231.06, }, @@ -127,7 +127,7 @@ describe('TokenInput Component', () => { it('should render properly with a token value for fiat', () => { const mockStore = { - metamask: { + dekusan: { currentCurrency: 'usd', conversionRate: 231.06, }, @@ -172,7 +172,7 @@ describe('TokenInput Component', () => { it('should call onChange and onBlur on input changes with the hex value for ETH', () => { const mockStore = { - metamask: { + dekusan: { currentCurrency: 'usd', conversionRate: 231.06, }, @@ -220,7 +220,7 @@ describe('TokenInput Component', () => { it('should call onChange and onBlur on input changes with the hex value for fiat', () => { const mockStore = { - metamask: { + dekusan: { currentCurrency: 'usd', conversionRate: 231.06, }, @@ -269,7 +269,7 @@ describe('TokenInput Component', () => { it('should change the state and pass in a new decimalValue when props.value changes', () => { const mockStore = { - metamask: { + dekusan: { currentCurrency: 'usd', conversionRate: 231.06, }, diff --git a/ui/app/components/token-input/tests/token-input.container.test.js b/ui/app/components/token-input/tests/token-input.container.test.js index d73bc9a9..6621556e 100644 --- a/ui/app/components/token-input/tests/token-input.container.test.js +++ b/ui/app/components/token-input/tests/token-input.container.test.js @@ -17,7 +17,7 @@ describe('TokenInput container', () => { describe('mapStateToProps()', () => { it('should return the correct props when send is empty', () => { const mockState = { - metamask: { + dekusan: { currentCurrency: 'usd', tokens: [ { @@ -45,7 +45,7 @@ describe('TokenInput container', () => { it('should return the correct props when selectedTokenAddress is not found and send is populated', () => { const mockState = { - metamask: { + dekusan: { currentCurrency: 'usd', tokens: [ { @@ -73,7 +73,7 @@ describe('TokenInput container', () => { it('should return the correct props when contractExchangeRates is populated', () => { const mockState = { - metamask: { + dekusan: { currentCurrency: 'usd', tokens: [ { diff --git a/ui/app/components/token-input/token-input.container.js b/ui/app/components/token-input/token-input.container.js index ec233b1b..91ba1c5f 100644 --- a/ui/app/components/token-input/token-input.container.js +++ b/ui/app/components/token-input/token-input.container.js @@ -3,7 +3,7 @@ import TokenInput from './token-input.component' import { getSelectedToken, getSelectedTokenExchangeRate } from '../../selectors' const mapStateToProps = state => { - const { metamask: { currentCurrency } } = state + const { dekusan: { currentCurrency } } = state return { currentCurrency, diff --git a/ui/app/components/token-list.js b/ui/app/components/token-list.js index 6a88f30b..87cb698e 100644 --- a/ui/app/components/token-list.js +++ b/ui/app/components/token-list.js @@ -10,10 +10,10 @@ const log = require('loglevel') function mapStateToProps (state) { return { - network: state.metamask.network, - tokens: state.metamask.tokens, + network: state.dekusan.network, + tokens: state.dekusan.tokens, userAddress: selectors.getSelectedAddress(state), - assetImages: state.metamask.assetImages, + assetImages: state.dekusan.assetImages, } } diff --git a/ui/app/components/transaction-activity-log/tests/transaction-activity-log.container.test.js b/ui/app/components/transaction-activity-log/tests/transaction-activity-log.container.test.js index a7c35f51..0d6bb4fa 100644 --- a/ui/app/components/transaction-activity-log/tests/transaction-activity-log.container.test.js +++ b/ui/app/components/transaction-activity-log/tests/transaction-activity-log.container.test.js @@ -16,7 +16,7 @@ describe('TransactionActivityLog container', () => { describe('mapStateToProps()', () => { it('should return the correct props', () => { const mockState = { - metamask: { + dekusan: { conversionRate: 280.45, nativeCurrency: 'ETH', }, diff --git a/ui/app/components/transaction-activity-log/tests/transaction-activity-log.util.test.js b/ui/app/components/transaction-activity-log/tests/transaction-activity-log.util.test.js index aa2e2d4a..a30be0b4 100644 --- a/ui/app/components/transaction-activity-log/tests/transaction-activity-log.util.test.js +++ b/ui/app/components/transaction-activity-log/tests/transaction-activity-log.util.test.js @@ -151,7 +151,7 @@ describe('getActivities', () => { { id: 5559712943815343, loadingDefaults: true, - metamaskNetworkId: '3', + dekusanNetworkId: '3', status: 'unapproved', time: 1535507561452, txParams: { diff --git a/ui/app/components/transaction-list-item-details/transaction-list-item-details.component.js b/ui/app/components/transaction-list-item-details/transaction-list-item-details.component.js index 95a86519..69db3f9f 100644 --- a/ui/app/components/transaction-list-item-details/transaction-list-item-details.component.js +++ b/ui/app/components/transaction-list-item-details/transaction-list-item-details.component.js @@ -23,9 +23,9 @@ export default class TransactionListItemDetails extends PureComponent { handleEtherscanClick = () => { const { transactionGroup: { primaryTransaction } } = this.props - const { hash, metamaskNetworkId } = primaryTransaction + const { hash, dekusanNetworkId } = primaryTransaction - const prefix = prefixForNetwork(metamaskNetworkId) + const prefix = prefixForNetwork(dekusanNetworkId) const etherscanUrl = `https://${prefix}dexscan.org/transaction/${hash}` global.platform.openWindow({ url: etherscanUrl }) } diff --git a/ui/app/components/transaction-view-balance/transaction-view-balance.container.js b/ui/app/components/transaction-view-balance/transaction-view-balance.container.js index f9f05b0a..da5d51b5 100644 --- a/ui/app/components/transaction-view-balance/transaction-view-balance.container.js +++ b/ui/app/components/transaction-view-balance/transaction-view-balance.container.js @@ -13,7 +13,7 @@ import { showModal } from '../../actions' const mapStateToProps = state => { const selectedAddress = getSelectedAddress(state) - const { metamask: { network } } = state + const { dekusan: { network } } = state const accounts = getMetaMaskAccounts(state) const account = accounts[selectedAddress] const { balance } = account diff --git a/ui/app/components/user-preferenced-currency-display/tests/user-preferenced-currency-display.container.test.js b/ui/app/components/user-preferenced-currency-display/tests/user-preferenced-currency-display.container.test.js index 2232e825..deb055fe 100644 --- a/ui/app/components/user-preferenced-currency-display/tests/user-preferenced-currency-display.container.test.js +++ b/ui/app/components/user-preferenced-currency-display/tests/user-preferenced-currency-display.container.test.js @@ -17,8 +17,7 @@ describe('UserPreferencedCurrencyDisplay container', () => { describe('mapStateToProps()', () => { it('should return the correct props', () => { const mockState = { - metamask: { - nativeCurrency: 'ETH', + dekusan: { preferences: { useNativeCurrencyAsPrimaryCurrency: true, }, diff --git a/ui/app/components/user-preferenced-currency-input/tests/user-preferenced-currency-input.container.test.js b/ui/app/components/user-preferenced-currency-input/tests/user-preferenced-currency-input.container.test.js index 95972644..38a85932 100644 --- a/ui/app/components/user-preferenced-currency-input/tests/user-preferenced-currency-input.container.test.js +++ b/ui/app/components/user-preferenced-currency-input/tests/user-preferenced-currency-input.container.test.js @@ -16,7 +16,7 @@ describe('UserPreferencedCurrencyInput container', () => { describe('mapStateToProps()', () => { it('should return the correct props', () => { const mockState = { - metamask: { + dekusan: { preferences: { useNativeCurrencyAsPrimaryCurrency: true, }, diff --git a/ui/app/components/user-preferenced-token-input/tests/user-preferenced-token-input.container.test.js b/ui/app/components/user-preferenced-token-input/tests/user-preferenced-token-input.container.test.js index 2f89fba9..86309afe 100644 --- a/ui/app/components/user-preferenced-token-input/tests/user-preferenced-token-input.container.test.js +++ b/ui/app/components/user-preferenced-token-input/tests/user-preferenced-token-input.container.test.js @@ -16,7 +16,7 @@ describe('UserPreferencedTokenInput container', () => { describe('mapStateToProps()', () => { it('should return the correct props', () => { const mockState = { - metamask: { + dekusan: { preferences: { useNativeCurrencyAsPrimaryCurrency: true, }, diff --git a/ui/app/components/wallet-view.js b/ui/app/components/wallet-view.js index 8ad6637a..404d733e 100644 --- a/ui/app/components/wallet-view.js +++ b/ui/app/components/wallet-view.js @@ -35,15 +35,22 @@ WalletView.defaultProps = { function mapStateToProps (state) { return { - network: state.metamask.network, + network: state.dekusan.network, sidebarOpen: state.appState.sidebar.isOpen, +<<<<<<< HEAD identities: state.metamask.identities, accounts: selectors.getMetaMaskAccounts(state), tokens: state.metamask.tokens, keyrings: state.metamask.keyrings, +======= + identities: state.dekusan.identities, + accounts: state.dekusan.accounts, + tokens: state.dekusan.tokens, + keyrings: state.dekusan.keyrings, +>>>>>>> Fix UI bugs selectedAddress: selectors.getSelectedAddress(state), selectedAccount: selectors.getSelectedAccount(state), - selectedTokenAddress: state.metamask.selectedTokenAddress, + selectedTokenAddress: state.dekusan.selectedTokenAddress, } } |