Skip to content

Commit

Permalink
Revert "Use createMatchSelector selector in CreateAccount component (#…
Browse files Browse the repository at this point in the history
…1966)"

This reverts commit b1b4d02.
  • Loading branch information
marcinbodnar committed Oct 20, 2021
1 parent c376ff7 commit 06df183
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions packages/frontend/src/components/accounts/CreateAccount.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createMatchSelector, getSearch } from 'connected-react-router';
import { getSearch } from 'connected-react-router';
import React, { Component } from 'react';
import { Translate } from 'react-localize-redux';
import { connect } from 'react-redux';
Expand Down Expand Up @@ -304,20 +304,16 @@ const mapDispatchToProps = {
redirectTo
};

const mapStateToProps = (state) => {
const matchSelector = createMatchSelector('/create/:fundingContract?/:fundingKey?');

return {
...selectAccountSlice(state),
localAlert: selectStatusLocalAlert(state),
mainLoader: selectStatusMainLoader(state),
fundingContract: matchSelector(state)?.params.fundingContract,
fundingKey: matchSelector(state)?.params.fundingKey,
fundingAccountId: matchSelector(state)?.params.fundingAccountId,
nearTokenFiatValueUSD: selectNearTokenFiatValueUSD(state),
locationSearch: getSearch(state)
};
};
const mapStateToProps = (state, { match }) => ({
...selectAccountSlice(state),
localAlert: selectStatusLocalAlert(state),
mainLoader: selectStatusMainLoader(state),
fundingContract: match.params.fundingContract,
fundingKey: match.params.fundingKey,
fundingAccountId: match.params.fundingAccountId,
nearTokenFiatValueUSD: selectNearTokenFiatValueUSD(state),
locationSearch: getSearch(state)
});

export const CreateAccountWithRouter = connect(
mapStateToProps,
Expand Down

0 comments on commit 06df183

Please sign in to comment.