mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 21:30:31 +00:00
WIP / Features / Sate
This commit is contained in:
24
client/src/containers/Sales/Estimate/withEstimates.js
Normal file
24
client/src/containers/Sales/Estimate/withEstimates.js
Normal file
@@ -0,0 +1,24 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { getResourceViews } from 'store/customViews/customViews.selectors';
|
||||
import {
|
||||
getEstimateCurrentPage,
|
||||
getEstimatesTableQuery,
|
||||
getEstimatesPaginationMetaFactory,
|
||||
} from 'store/Estimate/estimates.selectors';
|
||||
|
||||
function withEstimates(mapSate) {
|
||||
const mapStateToProps = (state, props) => {
|
||||
const query = getEstimatesTableQuery(state, props);
|
||||
const mapped = {
|
||||
estimateViews: getResourceViews(state, props, 'estimates'),
|
||||
estimateItems: state.estiamte.items,
|
||||
estimateTableQuery: query,
|
||||
estimatesLoading: state.estiamte.loading,
|
||||
};
|
||||
return mapSate ? mapSate(mapped, state, props) : mapped;
|
||||
};
|
||||
|
||||
return connect(mapStateToProps);
|
||||
}
|
||||
|
||||
export default withEstimates;
|
||||
Reference in New Issue
Block a user