From 4115c25d8f2e186a575de7904a91b3717da5e800 Mon Sep 17 00:00:00 2001 From: kumavis Date: Tue, 1 Aug 2017 13:21:02 -0700 Subject: lint fix --- ui/app/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ui/app/app.js') diff --git a/ui/app/app.js b/ui/app/app.js index 8fad0f7d6..297a2f621 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -203,7 +203,7 @@ App.prototype.renderNetworkDropdown = function () { classList.contains('menu-icon'), classList.contains('network-name'), classList.contains('network-indicator'), - ].filter(bool => bool).length === 0; + ].filter(bool => bool).length === 0 // classes from three constituent nodes of the toggle element if (isNotToggleElement) { -- cgit From 77908e1181a8fd043c1e9bdc3807b9dd8a0d3ab7 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Thu, 3 Aug 2017 16:30:57 -0700 Subject: Fix wonky widths for notices. --- ui/app/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ui/app/app.js') diff --git a/ui/app/app.js b/ui/app/app.js index 297a2f621..e23caa72b 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -92,7 +92,7 @@ App.prototype.render = function () { // panel content h('.app-primary' + (transForward ? '.from-right' : '.from-left'), { style: { - maxWidth: '850px', + width: '100%', }, }, [ this.renderPrimary(), -- cgit From 850e9b63d297c9da2403bb3796445df3cd500600 Mon Sep 17 00:00:00 2001 From: sdtsui Date: Thu, 3 Aug 2017 17:17:00 -0700 Subject: Move accountselector menu-droppo up to app-header --- ui/app/app.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'ui/app/app.js') diff --git a/ui/app/app.js b/ui/app/app.js index e23caa72b..bafc13d32 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -30,6 +30,8 @@ const QrView = require('./components/qr-code') const HDCreateVaultComplete = require('./keychains/hd/create-vault-complete') const HDRestoreVaultScreen = require('./keychains/hd/restore-vault') const RevealSeedConfirmation = require('./keychains/hd/recover-seed/confirmation') +const AccountDropdowns = require('./components/account-dropdowns').AccountDropdowns +const ethUtil = require('ethereumjs-util') module.exports = connect(mapStateToProps)(App) @@ -37,6 +39,14 @@ inherits(App, Component) function App () { Component.call(this) } function mapStateToProps (state) { + const { + identities, + accounts, + address, + } = state.metamask + let selected = address || Object.keys(accounts)[0] + // let checksumAddress = selected && ethUtil.toChecksumAddress(selected) + return { // state from plugin isLoading: state.appState.isLoading, @@ -57,6 +67,10 @@ function mapStateToProps (state) { lastUnreadNotice: state.metamask.lastUnreadNotice, lostAccounts: state.metamask.lostAccounts, frequentRpcList: state.metamask.frequentRpcList || [], + + // state needed to get account dropdown temporarily rendering from app bar + identities, + selected, } } @@ -169,6 +183,14 @@ App.prototype.renderAppBar = function () { }, }, [ + props.isUnlocked && h(AccountDropdowns, { + style: {}, + enableAccountsSelector: true, + identities: this.props.identities, + selected: this.props.selected, + network: this.props.network, + }, []), + // hamburger props.isUnlocked && h(SandwichExpando, { width: 16, -- cgit From 10d3a519c881763d4b79876bb1fde6c8243c3427 Mon Sep 17 00:00:00 2001 From: sdtsui Date: Thu, 3 Aug 2017 18:35:10 -0700 Subject: De-dupe click handler for sandwich-expando --- ui/app/app.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'ui/app/app.js') diff --git a/ui/app/app.js b/ui/app/app.js index bafc13d32..fda48f41d 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -193,15 +193,17 @@ App.prototype.renderAppBar = function () { // hamburger props.isUnlocked && h(SandwichExpando, { + className: 'sandwich-expando', width: 16, barHeight: 2, padding: 0, isOpen: state.isMainMenuOpen, color: 'rgb(247,146,30)', - onClick: (event) => { - event.preventDefault() + onClick: () => { event.stopPropagation() - this.setState({ isMainMenuOpen: !state.isMainMenuOpen }) + this.setState({ + isMainMenuOpen: !state.isMainMenuOpen, + }) }, }), ]), @@ -340,9 +342,13 @@ App.prototype.renderDropdown = function () { isOpen: isOpen, zIndex: 11, onClickOutside: (event) => { - const { classList } = event.target - const isNotToggleElement = !classList.contains('sandwich-expando') - if (isNotToggleElement) { + const classList = event.target.classList + const parentClassList = event.target.parentElement.classList + + const isToggleElement = classList.contains('sandwich-expando') || + parentClassList.contains('sandwich-expando') + + if (isOpen && !isToggleElement) { this.setState({ isMainMenuOpen: false }) } }, -- cgit From 086441e41c3a06cb062a475b59b542aa4ea6f185 Mon Sep 17 00:00:00 2001 From: sdtsui Date: Thu, 3 Aug 2017 18:50:29 -0700 Subject: Increase size of network dropdown --- ui/app/app.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'ui/app/app.js') diff --git a/ui/app/app.js b/ui/app/app.js index fda48f41d..2566a7515 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -251,6 +251,9 @@ App.prototype.renderNetworkDropdown = function () { key: 'main', closeMenu: () => this.setState({ isNetworkMenuOpen: !isOpen }), onClick: () => props.dispatch(actions.setProviderType('mainnet')), + style: { + fontSize: '18px' + }, }, [ h('.menu-icon.diamond'), @@ -265,6 +268,9 @@ App.prototype.renderNetworkDropdown = function () { key: 'ropsten', closeMenu: () => this.setState({ isNetworkMenuOpen: !isOpen }), onClick: () => props.dispatch(actions.setProviderType('ropsten')), + style: { + fontSize: '18px' + }, }, [ h('.menu-icon.red-dot'), @@ -279,6 +285,9 @@ App.prototype.renderNetworkDropdown = function () { key: 'kovan', closeMenu: () => this.setState({ isNetworkMenuOpen: !isOpen }), onClick: () => props.dispatch(actions.setProviderType('kovan')), + style: { + fontSize: '18px' + }, }, [ h('.menu-icon.hollow-diamond'), @@ -293,6 +302,9 @@ App.prototype.renderNetworkDropdown = function () { key: 'rinkeby', closeMenu: () => this.setState({ isNetworkMenuOpen: !isOpen }), onClick: () => props.dispatch(actions.setProviderType('rinkeby')), + style: { + fontSize: '18px' + }, }, [ h('.menu-icon.golden-square'), @@ -307,6 +319,9 @@ App.prototype.renderNetworkDropdown = function () { key: 'default', closeMenu: () => this.setState({ isNetworkMenuOpen: !isOpen }), onClick: () => props.dispatch(actions.setDefaultRpcTarget()), + style: { + fontSize: '18px' + }, }, [ h('i.fa.fa-question-circle.fa-lg.menu-icon'), @@ -323,6 +338,9 @@ App.prototype.renderNetworkDropdown = function () { { closeMenu: () => this.setState({ isNetworkMenuOpen: !isOpen }), onClick: () => this.props.dispatch(actions.showConfigPage()), + style: { + fontSize: '18px' + }, }, [ h('i.fa.fa-question-circle.fa-lg.menu-icon'), -- cgit From baee076348a913529834f7d57239e2ded460aa0a Mon Sep 17 00:00:00 2001 From: sdtsui Date: Thu, 3 Aug 2017 19:17:46 -0700 Subject: Lint ui/app --- ui/app/app.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'ui/app/app.js') diff --git a/ui/app/app.js b/ui/app/app.js index 2566a7515..0592496fc 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -31,7 +31,6 @@ const HDCreateVaultComplete = require('./keychains/hd/create-vault-complete') const HDRestoreVaultScreen = require('./keychains/hd/restore-vault') const RevealSeedConfirmation = require('./keychains/hd/recover-seed/confirmation') const AccountDropdowns = require('./components/account-dropdowns').AccountDropdowns -const ethUtil = require('ethereumjs-util') module.exports = connect(mapStateToProps)(App) @@ -44,8 +43,7 @@ function mapStateToProps (state) { accounts, address, } = state.metamask - let selected = address || Object.keys(accounts)[0] - // let checksumAddress = selected && ethUtil.toChecksumAddress(selected) + const selected = address || Object.keys(accounts)[0] return { // state from plugin @@ -252,7 +250,7 @@ App.prototype.renderNetworkDropdown = function () { closeMenu: () => this.setState({ isNetworkMenuOpen: !isOpen }), onClick: () => props.dispatch(actions.setProviderType('mainnet')), style: { - fontSize: '18px' + fontSize: '18px', }, }, [ @@ -269,7 +267,7 @@ App.prototype.renderNetworkDropdown = function () { closeMenu: () => this.setState({ isNetworkMenuOpen: !isOpen }), onClick: () => props.dispatch(actions.setProviderType('ropsten')), style: { - fontSize: '18px' + fontSize: '18px', }, }, [ @@ -286,7 +284,7 @@ App.prototype.renderNetworkDropdown = function () { closeMenu: () => this.setState({ isNetworkMenuOpen: !isOpen }), onClick: () => props.dispatch(actions.setProviderType('kovan')), style: { - fontSize: '18px' + fontSize: '18px', }, }, [ @@ -303,7 +301,7 @@ App.prototype.renderNetworkDropdown = function () { closeMenu: () => this.setState({ isNetworkMenuOpen: !isOpen }), onClick: () => props.dispatch(actions.setProviderType('rinkeby')), style: { - fontSize: '18px' + fontSize: '18px', }, }, [ @@ -320,7 +318,7 @@ App.prototype.renderNetworkDropdown = function () { closeMenu: () => this.setState({ isNetworkMenuOpen: !isOpen }), onClick: () => props.dispatch(actions.setDefaultRpcTarget()), style: { - fontSize: '18px' + fontSize: '18px', }, }, [ @@ -339,7 +337,7 @@ App.prototype.renderNetworkDropdown = function () { closeMenu: () => this.setState({ isNetworkMenuOpen: !isOpen }), onClick: () => this.props.dispatch(actions.showConfigPage()), style: { - fontSize: '18px' + fontSize: '18px', }, }, [ @@ -625,7 +623,6 @@ App.prototype.renderCommonRpc = function (rpcList, provider) { if ((rpc === 'http://localhost:8545') || (rpc === rpcTarget)) { return null } else { - return h( DropdownMenuItem, { -- cgit From 781ac00eac5d947b2c88159d38267386992a05f2 Mon Sep 17 00:00:00 2001 From: sdtsui Date: Fri, 4 Aug 2017 11:31:07 -0700 Subject: Re-enable css transitions for dropdowns in header, needs menu-droppo library update --- ui/app/app.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ui/app/app.js') diff --git a/ui/app/app.js b/ui/app/app.js index 0592496fc..620b4617a 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -218,6 +218,7 @@ App.prototype.renderNetworkDropdown = function () { const isOpen = state.isNetworkMenuOpen return h(Dropdown, { + useCssTransition: true, isOpen, onClickOutside: (event) => { const { classList } = event.target @@ -355,6 +356,7 @@ App.prototype.renderDropdown = function () { const isOpen = state.isMainMenuOpen return h(Dropdown, { + useCssTransition: true, isOpen: isOpen, zIndex: 11, onClickOutside: (event) => { -- cgit From b5251d22a6da21b918a0bfd98e6e572bc80a58f5 Mon Sep 17 00:00:00 2001 From: sdtsui Date: Fri, 4 Aug 2017 23:34:26 -0700 Subject: Fix integration test failures: unnecessary sandwich-expando event stopPropagation --- ui/app/app.js | 1 - 1 file changed, 1 deletion(-) (limited to 'ui/app/app.js') diff --git a/ui/app/app.js b/ui/app/app.js index 620b4617a..4565bdd37 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -198,7 +198,6 @@ App.prototype.renderAppBar = function () { isOpen: state.isMainMenuOpen, color: 'rgb(247,146,30)', onClick: () => { - event.stopPropagation() this.setState({ isMainMenuOpen: !state.isMainMenuOpen, }) -- cgit