Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary withRouter and compose calls #7890

Merged
merged 1 commit into from
Jan 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { connect } from 'react-redux'
import { compose } from 'recompose'
import PropTypes from 'prop-types'
import { hideSidebar, showModal } from '../../../store/actions'
import AccountDetails from './account-details.component'
Expand All @@ -13,9 +12,7 @@ function mapDispatchToProps (dispatch) {
}
}

const AccountDetailsContainer = compose(
connect(null, mapDispatchToProps)
)(AccountDetails)
const AccountDetailsContainer = connect(null, mapDispatchToProps)(AccountDetails)

AccountDetailsContainer.propTypes = {
label: PropTypes.string.isRequired,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { connect } from 'react-redux'
import { compose } from 'recompose'

import ConnectedSitesList from './connected-sites-list.component'
import {
Expand Down Expand Up @@ -52,6 +51,4 @@ const mapDispatchToProps = dispatch => {
}
}

export default compose(
connect(mapStateToProps, mapDispatchToProps)
)(ConnectedSitesList)
export default connect(mapStateToProps, mapDispatchToProps)(ConnectedSitesList)
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { connect } from 'react-redux'
import { compose } from 'recompose'
import { withRouter } from 'react-router-dom'
import PermissionPageContainer from './permission-page-container.component'
import {
getPermissionsDescriptions,
Expand All @@ -22,7 +20,4 @@ const mapStateToProps = (state, ownProps) => {
}
}

export default compose(
withRouter,
connect(mapStateToProps)
)(PermissionPageContainer)
export default connect(mapStateToProps)(PermissionPageContainer)
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { connect } from 'react-redux'
import { withRouter } from 'react-router-dom'
import { compose } from 'recompose'
import SignatureRequest from './signature-request.component'
import { goHome } from '../../../store/actions'
import { clearConfirmTransaction } from '../../../ducks/confirm-transaction/confirm-transaction.duck'
Expand Down Expand Up @@ -66,7 +64,4 @@ function mergeProps (stateProps, dispatchProps, ownProps) {
}
}

export default compose(
withRouter,
connect(mapStateToProps, mapDispatchToProps, mergeProps)
)(SignatureRequest)
export default connect(mapStateToProps, mapDispatchToProps, mergeProps)(SignatureRequest)
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { connect } from 'react-redux'
import { withRouter } from 'react-router-dom'
import { compose } from 'recompose'
import TransactionList from './transaction-list.component'
import {
nonceSortedCompletedTransactionsSelector,
Expand Down Expand Up @@ -45,7 +43,4 @@ const mergeProps = (stateProps, dispatchProps, ownProps) => {
}
}

export default compose(
withRouter,
connect(mapStateToProps, mapDispatchToProps, mergeProps)
)(TransactionList)
export default connect(mapStateToProps, mapDispatchToProps, mergeProps)(TransactionList)
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { connect } from 'react-redux'
import { withRouter } from 'react-router-dom'
import { compose } from 'recompose'
import TransactionTimeRemaining from './transaction-time-remaining.component'
import {
getTxParams,
Expand Down Expand Up @@ -31,10 +29,7 @@ const mapStateToProps = (state, ownProps) => {
}
}

export default compose(
withRouter,
connect(mapStateToProps)
)(TransactionTimeRemaining)
export default connect(mapStateToProps)(TransactionTimeRemaining)

function calcCustomGasPrice (customGasPriceInHex) {
return Number(hexWEIToDecGWEI(customGasPriceInHex))
Expand Down
8 changes: 1 addition & 7 deletions ui/app/helpers/higher-order-components/i18n-provider.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { Component } from 'react'
import { connect } from 'react-redux'
import PropTypes from 'prop-types'
import { withRouter } from 'react-router-dom'
import { compose } from 'recompose'
import { getMessage } from '../utils/i18n-helper'

class I18nProvider extends Component {
Expand Down Expand Up @@ -59,8 +57,4 @@ const mapStateToProps = state => {
}
}

export default compose(
withRouter,
connect(mapStateToProps)
)(I18nProvider)

export default connect(mapStateToProps)(I18nProvider)
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { connect } from 'react-redux'
import { compose } from 'recompose'
import PropTypes from 'prop-types'
import PermissionApproval from './permissions-connect.component'
import {
Expand Down Expand Up @@ -63,9 +62,7 @@ const mapDispatchToProps = dispatch => {
}
}

const PermissionApprovalContainer = compose(
connect(mapStateToProps, mapDispatchToProps)
)(PermissionApproval)
const PermissionApprovalContainer = connect(mapStateToProps, mapDispatchToProps)(PermissionApproval)

PermissionApprovalContainer.propTypes = {
history: PropTypes.object.isRequired,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import SettingsTab from './settings-tab.component'
import { compose } from 'recompose'
import { connect } from 'react-redux'
import {
setCurrentCurrency,
Expand Down Expand Up @@ -44,6 +43,4 @@ const mapDispatchToProps = dispatch => {
}
}

export default compose(
connect(mapStateToProps, mapDispatchToProps)
)(SettingsTab)
export default connect(mapStateToProps, mapDispatchToProps)(SettingsTab)
4 changes: 2 additions & 2 deletions ui/app/pages/settings/settings.component.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
import { Switch, Route, matchPath, withRouter } from 'react-router-dom'
import { Switch, Route, matchPath } from 'react-router-dom'
import TabBar from '../../components/app/tab-bar'
import c from 'classnames'
import SettingsTab from './settings-tab'
Expand Down Expand Up @@ -244,4 +244,4 @@ class SettingsPage extends PureComponent {
}
}

export default withRouter(SettingsPage)
export default SettingsPage