diff options
author | Alexander Tseung <alextsg@gmail.com> | 2017-12-04 14:24:30 +0800 |
---|---|---|
committer | Alexander Tseung <alextsg@gmail.com> | 2017-12-15 06:11:23 +0800 |
commit | dde39e82b5723ba8056b73f0f823d40c3e702a99 (patch) | |
tree | 4143756e6660ac16b896a58dffef612f99770fd5 /ui/app/components/pages/metamask-route.js | |
parent | e226b10a89d87af07c7c35ff1251a8264f3bb1b8 (diff) | |
download | tangerine-wallet-browser-dde39e82b5723ba8056b73f0f823d40c3e702a99.tar tangerine-wallet-browser-dde39e82b5723ba8056b73f0f823d40c3e702a99.tar.gz tangerine-wallet-browser-dde39e82b5723ba8056b73f0f823d40c3e702a99.tar.bz2 tangerine-wallet-browser-dde39e82b5723ba8056b73f0f823d40c3e702a99.tar.lz tangerine-wallet-browser-dde39e82b5723ba8056b73f0f823d40c3e702a99.tar.xz tangerine-wallet-browser-dde39e82b5723ba8056b73f0f823d40c3e702a99.tar.zst tangerine-wallet-browser-dde39e82b5723ba8056b73f0f823d40c3e702a99.zip |
Add routes for mascara
Diffstat (limited to 'ui/app/components/pages/metamask-route.js')
-rw-r--r-- | ui/app/components/pages/metamask-route.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/ui/app/components/pages/metamask-route.js b/ui/app/components/pages/metamask-route.js new file mode 100644 index 000000000..23c5b5199 --- /dev/null +++ b/ui/app/components/pages/metamask-route.js @@ -0,0 +1,28 @@ +const { connect } = require('react-redux') +const PropTypes = require('prop-types') +const { Route } = require('react-router-dom') +const h = require('react-hyperscript') + +const MetamaskRoute = ({ component, mascaraComponent, isMascara, ...props }) => { + return ( + h(Route, { + ...props, + component: isMascara && mascaraComponent ? mascaraComponent : component, + }) + ) +} + +MetamaskRoute.propTypes = { + component: PropTypes.func, + mascaraComponent: PropTypes.func, + isMascara: PropTypes.bool, +} + +const mapStateToProps = state => { + const { metamask: { isMascara } } = state + return { + isMascara, + } +} + +module.exports = connect(mapStateToProps)(MetamaskRoute) |