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:
parent
94489b544a
commit
9bfcb9c505
@ -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')
|
||||
|
@ -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
|
Loading…
Reference in New Issue
Block a user