diff options
Add UI selection
Diffstat (limited to 'ui/app/select-app.js')
-rw-r--r-- | ui/app/select-app.js | 21 |
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) +} |