aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/pages/metamask-route.js
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-04-10 17:49:01 +0800
committerDan <danjm.com@gmail.com>2018-04-10 17:49:01 +0800
commitf4d8da927734b2dcd597d1cc833f9fe6ac59cc77 (patch)
tree24984f09e1a0a86b8187ffee5197e3857a2b10cc /ui/app/components/pages/metamask-route.js
parent284dd85a99f538b77fd477f4952117d1792f64a5 (diff)
parent29dab1e9e00c1c1e6ad834026df51b2839d3171d (diff)
downloadtangerine-wallet-browser-f4d8da927734b2dcd597d1cc833f9fe6ac59cc77.tar
tangerine-wallet-browser-f4d8da927734b2dcd597d1cc833f9fe6ac59cc77.tar.gz
tangerine-wallet-browser-f4d8da927734b2dcd597d1cc833f9fe6ac59cc77.tar.bz2
tangerine-wallet-browser-f4d8da927734b2dcd597d1cc833f9fe6ac59cc77.tar.lz
tangerine-wallet-browser-f4d8da927734b2dcd597d1cc833f9fe6ac59cc77.tar.xz
tangerine-wallet-browser-f4d8da927734b2dcd597d1cc833f9fe6ac59cc77.tar.zst
tangerine-wallet-browser-f4d8da927734b2dcd597d1cc833f9fe6ac59cc77.zip
Merge branch 'master' into i3725-refactor-send-component
Diffstat (limited to 'ui/app/components/pages/metamask-route.js')
-rw-r--r--ui/app/components/pages/metamask-route.js28
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)