aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/select-app.js
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2017-11-15 00:04:55 +0800
committerDan <danjm.com@gmail.com>2017-12-05 10:38:23 +0800
commit7f795240706c013dc4a9ece0e9c9e33897c7fc71 (patch)
tree631ca16db8ea6d5efd2e57f4c25699e3482512ca /ui/app/select-app.js
parent6561e75aa2fb03c77544da3c090ad6ea2883d29a (diff)
downloadtangerine-wallet-browser-7f795240706c013dc4a9ece0e9c9e33897c7fc71.tar
tangerine-wallet-browser-7f795240706c013dc4a9ece0e9c9e33897c7fc71.tar.gz
tangerine-wallet-browser-7f795240706c013dc4a9ece0e9c9e33897c7fc71.tar.bz2
tangerine-wallet-browser-7f795240706c013dc4a9ece0e9c9e33897c7fc71.tar.lz
tangerine-wallet-browser-7f795240706c013dc4a9ece0e9c9e33897c7fc71.tar.xz
tangerine-wallet-browser-7f795240706c013dc4a9ece0e9c9e33897c7fc71.tar.zst
tangerine-wallet-browser-7f795240706c013dc4a9ece0e9c9e33897c7fc71.zip
Add UI selection
Diffstat (limited to 'ui/app/select-app.js')
-rw-r--r--ui/app/select-app.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/ui/app/select-app.js b/ui/app/select-app.js
new file mode 100644
index 000000000..3cba44052
--- /dev/null
+++ b/ui/app/select-app.js
@@ -0,0 +1,21 @@
+const inherits = require('util').inherits
+const Component = require('react').Component
+const connect = require('react-redux').connect
+const h = require('react-hyperscript')
+const App = require('./app')
+const OldApp = require('../../old-ui/app/app')
+
+function mapStateToProps (state) {
+ return { betaUI: state.metamask.featureFlags.betaUI }
+}
+
+module.exports = connect(mapStateToProps)(SelectedApp)
+
+inherits(SelectedApp, Component)
+function SelectedApp () { Component.call(this) }
+
+SelectedApp.prototype.render = function () {
+ const { betaUI } = this.props
+ const Selected = betaUI ? App : OldApp
+ return h(Selected)
+}