From bdcee058dc278c46c828f376476f121417481385 Mon Sep 17 00:00:00 2001 From: Alexander Tseung Date: Tue, 9 Jan 2018 16:45:39 -0800 Subject: [PATCH] Fix styling in initialization --- app/scripts/popup.js | 9 +++++++-- ui/app/app.js | 6 +++++- ui/app/css/itcss/components/header.scss | 13 +++++++++---- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/app/scripts/popup.js b/app/scripts/popup.js index d0952af6a..97a29fb1a 100644 --- a/app/scripts/popup.js +++ b/app/scripts/popup.js @@ -26,8 +26,13 @@ const container = document.getElementById('app-content') startPopup({ container, connectionStream }, (err, store) => { if (err) return displayCriticalError(err) - let betaUIState = store.getState().metamask.featureFlags.betaUI - let css = betaUIState ? NewMetaMaskUiCss() : OldMetaMaskUiCss() + const { isMascara, identities = {}, featureFlags = {} } = store.getState().metamask + const firstTime = Object.keys(identities).length === 0 + let betaUIState = featureFlags.betaUI + + const useBetaCss = isMascara || firstTime || betaUIState + + let css = useBetaCss ? NewMetaMaskUiCss() : OldMetaMaskUiCss() let deleteInjectedCss = injectCss(css) let newBetaUIState diff --git a/ui/app/app.js b/ui/app/app.js index c6fce0e47..3fca8ccc1 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -3,6 +3,8 @@ const Component = require('react').Component const connect = require('react-redux').connect const h = require('react-hyperscript') const actions = require('./actions') +const classnames = require('classnames') + // mascara const MascaraFirstTime = require('../../mascara/src/app/first-time').default const MascaraBuyEtherScreen = require('../../mascara/src/app/first-time/buy-ether-screen').default @@ -243,7 +245,9 @@ App.prototype.renderAppBar = function () { }, [ h('.app-header.flex-row.flex-space-between', { - style: {}, + className: classnames({ + 'app-header--initialized': !isOnboarding, + }), }, [ h('div.app-header-contents', {}, [ h('div.left-menu-wrapper', { diff --git a/ui/app/css/itcss/components/header.scss b/ui/app/css/itcss/components/header.scss index a6332f819..e27444084 100644 --- a/ui/app/css/itcss/components/header.scss +++ b/ui/app/css/itcss/components/header.scss @@ -17,7 +17,16 @@ @media screen and (min-width: 576px) { height: 75px; justify-content: center; + } + + .metafox-icon { + cursor: pointer; + } +} +.app-header--initialized { + + @media screen and (min-width: 576px) { &::after { content: ''; position: absolute; @@ -27,10 +36,6 @@ bottom: -32px; } } - - .metafox-icon { - cursor: pointer; - } } .app-header-contents {