1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Remove unneeded MetaMaskConnect connect wrapper

This commit is contained in:
Whymarrh Whitby 2018-07-09 17:51:55 -02:30
parent 94489b544a
commit 9bfcb9c505
2 changed files with 1 additions and 28 deletions

View File

@ -1,6 +1,6 @@
const { Component } = require('react')
const { connect } = require('react-redux')
const PropTypes = require('prop-types')
const connect = require('../../metamask-connect')
const { Redirect, withRouter } = require('react-router-dom')
const { compose } = require('recompose')
const h = require('react-hyperscript')

View File

@ -1,27 +0,0 @@
const connect = require('react-redux').connect
const t = require('../i18n-helper').getMessage
const metamaskConnect = (mapStateToProps, mapDispatchToProps) => {
return connect(
_higherOrderMapStateToProps(mapStateToProps),
mapDispatchToProps
)
}
const _higherOrderMapStateToProps = (mapStateToProps) => {
let _t
let currentLocale
return (state, ownProps = {}) => {
const stateProps = mapStateToProps
? mapStateToProps(state, ownProps)
: ownProps
if (currentLocale !== state.metamask.currentLocale) {
currentLocale = state.metamask.currentLocale
_t = t.bind(null, state.localeMessages)
}
stateProps.t = _t
return stateProps
}
}
module.exports = metamaskConnect