@@ -534,7 +504,6 @@ export default class SettingsTab extends PureComponent {
{ this.renderNewRpcUrl() }
{ this.renderStateLogs() }
{ this.renderSeedWords() }
- { !isMascara && this.renderOldUI() }
{ this.renderResetAccount() }
{ this.renderClearApproval() }
{ this.renderPrivacyOptIn() }
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 d5fd8416a..92f645438 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
@@ -27,14 +27,12 @@ const mapStateToProps = state => {
privacyMode,
} = {},
provider = {},
- isMascara,
currentLocale,
} = metamask
const { useNativeCurrencyAsPrimaryCurrency } = preferencesSelector(state)
return {
warning,
- isMascara,
currentLocale,
currentCurrency,
conversionDate,
@@ -55,9 +53,6 @@ const mapDispatchToProps = dispatch => {
revealSeedConfirmation: () => dispatch(revealSeedConfirmation()),
setUseBlockie: value => dispatch(setUseBlockie(value)),
updateCurrentLocale: key => dispatch(updateCurrentLocale(key)),
- setFeatureFlagToBeta: () => {
- return dispatch(setFeatureFlag('betaUI', false, 'OLD_UI_NOTIFICATION_MODAL'))
- },
setHexDataFeatureFlag: shouldShow => dispatch(setFeatureFlag('sendHexData', shouldShow)),
setPrivacyMode: enabled => dispatch(setFeatureFlag('privacyMode', enabled)),
showResetAccountConfirmationModal: () => dispatch(showModal({ name: 'CONFIRM_RESET_ACCOUNT' })),
diff --git a/ui/app/components/send/send.selectors.js b/ui/app/components/send/send.selectors.js
index 140da2ce9..47a49500f 100644
--- a/ui/app/components/send/send.selectors.js
+++ b/ui/app/components/send/send.selectors.js
@@ -16,7 +16,6 @@ import {
const selectors = {
accountsWithSendEtherInfoSelector,
- // autoAddToBetaUI,
getAddressBook,
getAmountConversionRate,
getBlockGasLimit,
@@ -72,23 +71,6 @@ function accountsWithSendEtherInfoSelector (state) {
return accountsWithSendEtherInfo
}
-// function autoAddToBetaUI (state) {
-// const autoAddTransactionThreshold = 12
-// const autoAddAccountsThreshold = 2
-// const autoAddTokensThreshold = 1
-
-// const numberOfTransactions = state.metamask.selectedAddressTxList.length
-// const numberOfAccounts = Object.keys(getMetaMaskAccounts(state)).length
-// const numberOfTokensAdded = state.metamask.tokens.length
-
-// const userPassesThreshold = (numberOfTransactions > autoAddTransactionThreshold) &&
-// (numberOfAccounts > autoAddAccountsThreshold) &&
-// (numberOfTokensAdded > autoAddTokensThreshold)
-// const userIsNotInBeta = !state.metamask.featureFlags.betaUI
-
-// return userIsNotInBeta && userPassesThreshold
-// }
-
function getAddressBook (state) {
return state.metamask.addressBook
}
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 66c0da229..d43d7c650 100644
--- a/ui/app/components/send/tests/send-selectors-test-data.js
+++ b/ui/app/components/send/tests/send-selectors-test-data.js
@@ -2,7 +2,7 @@ module.exports = {
'metamask': {
'isInitialized': true,
'isUnlocked': true,
- 'featureFlags': {'betaUI': true, 'sendHexData': true},
+ 'featureFlags': {'sendHexData': true},
'rpcTarget': 'https://rawtestrpc.metamask.io/',
'identities': {
'0xfdea65c8e26263f6d9a1b5de9555d2931a33b825': {
diff --git a/ui/app/components/ui-migration-annoucement/index.js b/ui/app/components/ui-migration-annoucement/index.js
new file mode 100644
index 000000000..c6c8cc619
--- /dev/null
+++ b/ui/app/components/ui-migration-annoucement/index.js
@@ -0,0 +1 @@
+export {default} from './ui-migration-announcement.container'
diff --git a/ui/app/components/ui-migration-annoucement/index.scss b/ui/app/components/ui-migration-annoucement/index.scss
new file mode 100644
index 000000000..6138a3079
--- /dev/null
+++ b/ui/app/components/ui-migration-annoucement/index.scss
@@ -0,0 +1,22 @@
+.ui-migration-announcement {
+ position: absolute;
+ z-index: 9999;
+ width: 100vw;
+ height: 100vh;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ background: $white;
+
+ p {
+ box-sizing: border-box;
+ padding: 1em;
+ font-size: 12pt;
+ }
+
+ p:last-of-type {
+ cursor: pointer;
+ text-decoration: underline;
+ font-weight: bold;
+ }
+}
diff --git a/ui/app/components/ui-migration-annoucement/ui-migration-annoucement.component.js b/ui/app/components/ui-migration-annoucement/ui-migration-annoucement.component.js
new file mode 100644
index 000000000..7a4124972
--- /dev/null
+++ b/ui/app/components/ui-migration-annoucement/ui-migration-annoucement.component.js
@@ -0,0 +1,33 @@
+import PropTypes from 'prop-types'
+import React, {PureComponent} from 'react'
+
+export default class UiMigrationAnnouncement extends PureComponent {
+ static contextTypes = {
+ t: PropTypes.func.isRequired,
+ }
+
+ static defaultProps = {
+ shouldShowAnnouncement: true,
+ };
+
+ static propTypes = {
+ onClose: PropTypes.func.isRequired,
+ shouldShowAnnouncement: PropTypes.bool,
+ }
+
+ render () {
+ const { t } = this.context
+ const { onClose, shouldShowAnnouncement } = this.props
+
+ if (!shouldShowAnnouncement) {
+ return null
+ }
+
+ return (
+
+
{t('uiMigrationAnnouncement')}
+
{t('close')}
+
+ )
+ }
+}
diff --git a/ui/app/components/ui-migration-annoucement/ui-migration-announcement.container.js b/ui/app/components/ui-migration-annoucement/ui-migration-announcement.container.js
new file mode 100644
index 000000000..6dc993b87
--- /dev/null
+++ b/ui/app/components/ui-migration-annoucement/ui-migration-announcement.container.js
@@ -0,0 +1,21 @@
+import { connect } from 'react-redux'
+import UiMigrationAnnouncement from './ui-migration-annoucement.component'
+import { setCompletedUiMigration } from '../../actions'
+
+const mapStateToProps = (state) => {
+ const shouldShowAnnouncement = !state.metamask.completedUiMigration
+
+ return {
+ shouldShowAnnouncement,
+ }
+}
+
+const mapDispatchToProps = dispatch => {
+ return {
+ onClose () {
+ dispatch(setCompletedUiMigration())
+ },
+ }
+}
+
+export default connect(mapStateToProps, mapDispatchToProps)(UiMigrationAnnouncement)
diff --git a/ui/app/reducers/metamask.js b/ui/app/reducers/metamask.js
index 632ec18f8..5a08f2d09 100644
--- a/ui/app/reducers/metamask.js
+++ b/ui/app/reducers/metamask.js
@@ -385,6 +385,12 @@ function reduceMetamask (state, action) {
})
}
+ case actions.COMPLETE_UI_MIGRATION: {
+ return extend(metamaskState, {
+ completedUiMigration: true,
+ })
+ }
+
default:
return metamaskState
diff --git a/ui/app/root.js b/ui/app/root.js
index 09deae1b1..f9e3709a0 100644
--- a/ui/app/root.js
+++ b/ui/app/root.js
@@ -2,7 +2,9 @@ const { Component } = require('react')
const PropTypes = require('prop-types')
const { Provider } = require('react-redux')
const h = require('react-hyperscript')
-const SelectedApp = require('./select-app')
+const { HashRouter } = require('react-router-dom')
+const App = require('./app')
+const I18nProvider = require('./i18n-provider')
class Root extends Component {
render () {
@@ -10,7 +12,13 @@ class Root extends Component {
return (
h(Provider, { store }, [
- h(SelectedApp),
+ h(HashRouter, {
+ hashType: 'noslash',
+ }, [
+ h(I18nProvider, [
+ h(App),
+ ]),
+ ]),
])
)
}
diff --git a/ui/app/select-app.js b/ui/app/select-app.js
deleted file mode 100644
index f5f9e33ab..000000000
--- a/ui/app/select-app.js
+++ /dev/null
@@ -1,65 +0,0 @@
-const inherits = require('util').inherits
-const Component = require('react').Component
-const connect = require('react-redux').connect
-const h = require('react-hyperscript')
-const { HashRouter } = require('react-router-dom')
-const App = require('./app')
-const OldApp = require('../../old-ui/app/app')
-const { getShouldUseNewUi } = require('./selectors')
-const { setFeatureFlag } = require('./actions')
-const I18nProvider = require('./i18n-provider')
-
-function mapStateToProps (state) {
- return {
- isMascara: state.metamask.isMascara,
- shouldUseNewUi: getShouldUseNewUi(state),
- }
-}
-
-function mapDispatchToProps (dispatch) {
- return {
- setFeatureFlagWithModal: () => {
- return dispatch(setFeatureFlag('betaUI', true, 'BETA_UI_NOTIFICATION_MODAL'))
- },
- setFeatureFlagWithoutModal: () => {
- return dispatch(setFeatureFlag('betaUI', true))
- },
- }
-}
-module.exports = connect(mapStateToProps, mapDispatchToProps)(SelectedApp)
-
-inherits(SelectedApp, Component)
-function SelectedApp () {
- Component.call(this)
-}
-
-SelectedApp.prototype.componentWillReceiveProps = function (nextProps) {
- // Code commented out until we begin auto adding users to NewUI
- const {
- // isUnlocked,
- // setFeatureFlagWithModal,
- setFeatureFlagWithoutModal,
- isMascara,
- // firstTime,
- } = this.props
-
- // if (isMascara || firstTime) {
- if (isMascara) {
- setFeatureFlagWithoutModal()
- }
- // } else if (!isUnlocked && nextProps.isUnlocked && (nextProps.autoAdd)) {
- // setFeatureFlagWithModal()
- // }
-}
-
-SelectedApp.prototype.render = function () {
- 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 c60b27ab4..6e9bf6470 100644
--- a/ui/app/selectors.js
+++ b/ui/app/selectors.js
@@ -28,8 +28,6 @@ const selectors = {
getSendAmount,
getSelectedTokenToFiatRate,
getSelectedTokenContract,
- autoAddToBetaUI,
- getShouldUseNewUi,
getSendMaxModeState,
getCurrentViewContext,
getTotalUnapprovedCount,
@@ -212,30 +210,6 @@ function getSelectedTokenContract (state) {
: null
}
-function autoAddToBetaUI (state) {
- const autoAddTransactionThreshold = 12
- const autoAddAccountsThreshold = 2
- const autoAddTokensThreshold = 1
-
- const numberOfTransactions = state.metamask.selectedAddressTxList.length
- const numberOfAccounts = Object.keys(getMetaMaskAccounts(state)).length
- const numberOfTokensAdded = state.metamask.tokens.length
-
- const userPassesThreshold = (numberOfTransactions > autoAddTransactionThreshold) &&
- (numberOfAccounts > autoAddAccountsThreshold) &&
- (numberOfTokensAdded > autoAddTokensThreshold)
- const userIsNotInBeta = !state.metamask.featureFlags.betaUI
-
- 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