aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app
diff options
context:
space:
mode:
authorWhymarrh Whitby <whymarrh.whitby@gmail.com>2018-11-22 02:51:04 +0800
committerGitHub <noreply@github.com>2018-11-22 02:51:04 +0800
commit66e0de73c5511b49e24b93667d49d0b4accd89e3 (patch)
tree425d3e92f4219d2aa96d47cb407d866ec39316f4 /ui/app
parent80d09d019265ec5cf1c34ecf84cc07746e6bc04d (diff)
parente68008edf483cdf67a1a97a048fbbe610097d050 (diff)
downloadtangerine-wallet-browser-66e0de73c5511b49e24b93667d49d0b4accd89e3.tar
tangerine-wallet-browser-66e0de73c5511b49e24b93667d49d0b4accd89e3.tar.gz
tangerine-wallet-browser-66e0de73c5511b49e24b93667d49d0b4accd89e3.tar.bz2
tangerine-wallet-browser-66e0de73c5511b49e24b93667d49d0b4accd89e3.tar.lz
tangerine-wallet-browser-66e0de73c5511b49e24b93667d49d0b4accd89e3.tar.xz
tangerine-wallet-browser-66e0de73c5511b49e24b93667d49d0b4accd89e3.tar.zst
tangerine-wallet-browser-66e0de73c5511b49e24b93667d49d0b4accd89e3.zip
Merge pull request #5334 from whymarrh/ui-switch
Default to the new UI for first time users
Diffstat (limited to 'ui/app')
-rw-r--r--ui/app/components/app-header/app-header.component.js2
-rw-r--r--ui/app/select-app.js29
-rw-r--r--ui/app/selectors.js8
-rw-r--r--ui/app/welcome-screen.js2
4 files changed, 21 insertions, 20 deletions
diff --git a/ui/app/components/app-header/app-header.component.js b/ui/app/components/app-header/app-header.component.js
index c82dc1de9..83ec4809d 100644
--- a/ui/app/components/app-header/app-header.component.js
+++ b/ui/app/components/app-header/app-header.component.js
@@ -108,7 +108,7 @@ export default class AppHeader extends PureComponent {
>
<img
className="app-header__metafox-logo app-header__metafox-logo--horizontal"
- src="/images/logo/metamask-logo-horizontal-beta.svg"
+ src="/images/logo/metamask-logo-horizontal.svg"
height={30}
/>
<img
diff --git a/ui/app/select-app.js b/ui/app/select-app.js
index f2e8e8d10..f5f9e33ab 100644
--- a/ui/app/select-app.js
+++ b/ui/app/select-app.js
@@ -5,17 +5,14 @@ const h = require('react-hyperscript')
const { HashRouter } = require('react-router-dom')
const App = require('./app')
const OldApp = require('../../old-ui/app/app')
-const { autoAddToBetaUI } = require('./selectors')
+const { getShouldUseNewUi } = require('./selectors')
const { setFeatureFlag } = require('./actions')
const I18nProvider = require('./i18n-provider')
function mapStateToProps (state) {
return {
- betaUI: state.metamask.featureFlags.betaUI,
- autoAdd: autoAddToBetaUI(state),
- isUnlocked: state.metamask.isUnlocked,
isMascara: state.metamask.isMascara,
- firstTime: Object.keys(state.metamask.identities).length === 0,
+ shouldUseNewUi: getShouldUseNewUi(state),
}
}
@@ -56,17 +53,13 @@ SelectedApp.prototype.componentWillReceiveProps = function (nextProps) {
}
SelectedApp.prototype.render = function () {
- // Code commented out until we begin auto adding users to NewUI
- // const { betaUI, isMascara, firstTime } = this.props
- // const Selected = betaUI || isMascara || firstTime ? App : OldApp
-
- const { betaUI, isMascara } = this.props
-
- return betaUI || isMascara
- ? h(HashRouter, {
- hashType: 'noslash',
- }, [
- h(I18nProvider, [ h(App) ]),
- ])
- : h(OldApp)
+ const { shouldUseNewUi } = this.props
+ const newUi = h(HashRouter, {
+ hashType: 'noslash',
+ }, [
+ h(I18nProvider, [
+ h(App),
+ ]),
+ ])
+ return shouldUseNewUi ? newUi : h(OldApp)
}
diff --git a/ui/app/selectors.js b/ui/app/selectors.js
index 7209f19d1..b518527c9 100644
--- a/ui/app/selectors.js
+++ b/ui/app/selectors.js
@@ -31,6 +31,7 @@ const selectors = {
getSelectedTokenToFiatRate,
getSelectedTokenContract,
autoAddToBetaUI,
+ getShouldUseNewUi,
getSendMaxModeState,
getCurrentViewContext,
getTotalUnapprovedCount,
@@ -185,6 +186,13 @@ function autoAddToBetaUI (state) {
return userIsNotInBeta && userPassesThreshold
}
+function getShouldUseNewUi (state) {
+ const isAlreadyUsingBetaUi = state.metamask.featureFlags.betaUI
+ const isMascara = state.metamask.isMascara
+ const isFreshInstall = Object.keys(state.metamask.identities).length === 0
+ return isAlreadyUsingBetaUi || isMascara || isFreshInstall
+}
+
function getCurrentViewContext (state) {
const { currentView = {} } = state.appState
return currentView.context
diff --git a/ui/app/welcome-screen.js b/ui/app/welcome-screen.js
index 63512cd50..146661eb3 100644
--- a/ui/app/welcome-screen.js
+++ b/ui/app/welcome-screen.js
@@ -50,7 +50,7 @@ class WelcomeScreen extends Component {
height: '225',
}),
- h('div.welcome-screen__info__header', this.context.t('welcomeBeta')),
+ h('div.welcome-screen__info__header', this.context.t('welcome')),
h('div.welcome-screen__info__copy', this.context.t('metamaskDescription')),