fix(exchangeRate): fix pagination & add sorting.

This commit is contained in:
elforjani3
2021-03-08 16:17:13 +02:00
parent 32b378e74e
commit ca84cfc8a2
10 changed files with 115 additions and 303 deletions

View File

@@ -1,24 +1,12 @@
import { connect } from 'react-redux';
import {
getExchangeRatesList,
getExchangeRatePaginationMetaFactory,
getExchangeRatesTableQueryFactory,
} from 'store/ExchangeRate/exchange.selector';
import { getExchangeRatesTableStateFactory } from 'store/ExchangeRate/exchange.selector';
export default (mapState) => {
const getExchangeRatesPaginationMeta = getExchangeRatePaginationMetaFactory();
const getExchangeRatesTableState = getExchangeRatesTableStateFactory();
const mapStateToProps = (state, props) => {
const query = getExchangeRatesTableQueryFactory(state, props);
const mapped = {
exchangeRatesList: getExchangeRatesList(state, props),
exchangeRatesLoading: state.exchangeRates.loading,
exchangeRatesPageination: getExchangeRatesPaginationMeta(
state,
props,
query,
),
exchangeRatesTableState: getExchangeRatesTableState(state, props),
};
return mapState ? mapState(mapped, state, props) : mapped;
};