aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/metamask-connect.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/app/metamask-connect.js')
-rw-r--r--ui/app/metamask-connect.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/ui/app/metamask-connect.js b/ui/app/metamask-connect.js
new file mode 100644
index 000000000..d13f8e87e
--- /dev/null
+++ b/ui/app/metamask-connect.js
@@ -0,0 +1,20 @@
+const connect = require('react-redux').connect
+
+const metamaskConnect = (mapStateToProps, mapDispatchToProps) => {
+ return connect(
+ _higherOrderMapStateToProps(mapStateToProps),
+ mapDispatchToProps
+ )
+}
+
+const _higherOrderMapStateToProps = (mapStateToProps) => {
+ return (state, ownProps = {}) => {
+ const stateProps = mapStateToProps
+ ? mapStateToProps(state, ownProps)
+ : ownProps
+ stateProps.localeMessages = state.localeMessages || {}
+ return stateProps
+ }
+}
+
+module.exports = metamaskConnect \ No newline at end of file