mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Multiple loading style improvements
- When seeking network, show a full screen loading indication + message. - Network menu is still accessible "over" this indication. - Top Menu-Droppo components now slide *under* the menu bar like they should. - Loading indication opacity increased to increase message legibility.
This commit is contained in:
parent
68389d5d49
commit
1ed5804e4d
@ -21,7 +21,7 @@ const generateLostAccountsNotice = require('../lib/lost-accounts-notice')
|
|||||||
const ConfigScreen = require('./config')
|
const ConfigScreen = require('./config')
|
||||||
const Import = require('./accounts/import')
|
const Import = require('./accounts/import')
|
||||||
const InfoScreen = require('./info')
|
const InfoScreen = require('./info')
|
||||||
const LoadingIndicator = require('./components/loading')
|
const Loading = require('./components/loading')
|
||||||
const SandwichExpando = require('sandwich-expando')
|
const SandwichExpando = require('sandwich-expando')
|
||||||
const MenuDroppo = require('menu-droppo')
|
const MenuDroppo = require('menu-droppo')
|
||||||
const DropMenuItem = require('./components/drop-menu-item')
|
const DropMenuItem = require('./components/drop-menu-item')
|
||||||
@ -64,7 +64,9 @@ function mapStateToProps (state) {
|
|||||||
|
|
||||||
App.prototype.render = function () {
|
App.prototype.render = function () {
|
||||||
var props = this.props
|
var props = this.props
|
||||||
const { isLoading, loadingMessage, transForward } = props
|
const { isLoading, loadingMessage, transForward, network } = props
|
||||||
|
const isLoadingNetwork = network === 'loading'
|
||||||
|
|
||||||
log.debug('Main ui render function')
|
log.debug('Main ui render function')
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -77,13 +79,16 @@ App.prototype.render = function () {
|
|||||||
},
|
},
|
||||||
}, [
|
}, [
|
||||||
|
|
||||||
h(LoadingIndicator, { isLoading, loadingMessage }),
|
|
||||||
|
|
||||||
// app bar
|
// app bar
|
||||||
this.renderAppBar(),
|
this.renderAppBar(),
|
||||||
this.renderNetworkDropdown(),
|
this.renderNetworkDropdown(),
|
||||||
this.renderDropdown(),
|
this.renderDropdown(),
|
||||||
|
|
||||||
|
h(Loading, {
|
||||||
|
isLoading: isLoading || isLoadingNetwork,
|
||||||
|
loadingMessage: loadingMessage || 'Searching for Network',
|
||||||
|
}),
|
||||||
|
|
||||||
// panel content
|
// panel content
|
||||||
h('.app-primary.flex-grow' + (transForward ? '.from-right' : '.from-left'), {
|
h('.app-primary.flex-grow' + (transForward ? '.from-right' : '.from-left'), {
|
||||||
style: {
|
style: {
|
||||||
@ -124,7 +129,7 @@ App.prototype.renderAppBar = function () {
|
|||||||
background: props.isUnlocked ? 'white' : 'none',
|
background: props.isUnlocked ? 'white' : 'none',
|
||||||
height: '36px',
|
height: '36px',
|
||||||
position: 'relative',
|
position: 'relative',
|
||||||
zIndex: 10,
|
zIndex: 12,
|
||||||
},
|
},
|
||||||
}, [
|
}, [
|
||||||
|
|
||||||
@ -221,7 +226,7 @@ App.prototype.renderNetworkDropdown = function () {
|
|||||||
onClickOutside: (event) => {
|
onClickOutside: (event) => {
|
||||||
this.setState({ isNetworkMenuOpen: !isOpen })
|
this.setState({ isNetworkMenuOpen: !isOpen })
|
||||||
},
|
},
|
||||||
zIndex: 1,
|
zIndex: 11,
|
||||||
style: {
|
style: {
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
left: 0,
|
left: 0,
|
||||||
@ -300,7 +305,7 @@ App.prototype.renderDropdown = function () {
|
|||||||
|
|
||||||
return h(MenuDroppo, {
|
return h(MenuDroppo, {
|
||||||
isOpen: isOpen,
|
isOpen: isOpen,
|
||||||
zIndex: 1,
|
zIndex: 11,
|
||||||
onClickOutside: (event) => {
|
onClickOutside: (event) => {
|
||||||
this.setState({ isMainMenuOpen: !isOpen })
|
this.setState({ isMainMenuOpen: !isOpen })
|
||||||
},
|
},
|
||||||
|
@ -26,18 +26,21 @@ LoadingIndicator.prototype.render = function () {
|
|||||||
style: {
|
style: {
|
||||||
zIndex: 10,
|
zIndex: 10,
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
|
flexDirection: 'column',
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
height: '100%',
|
height: '100%',
|
||||||
width: '100%',
|
width: '100%',
|
||||||
background: 'rgba(255, 255, 255, 0.5)',
|
background: 'rgba(255, 255, 255, 0.8)',
|
||||||
},
|
},
|
||||||
}, [
|
}, [
|
||||||
h('img', {
|
h('img', {
|
||||||
src: 'images/loading.svg',
|
src: 'images/loading.svg',
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
h('br'),
|
||||||
|
|
||||||
showMessageIfAny(loadingMessage),
|
showMessageIfAny(loadingMessage),
|
||||||
]) : null,
|
]) : null,
|
||||||
])
|
])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user