mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 06:10:31 +00:00
WIP/ Feature : Estimate & Receipt & Bill & Invoice
This commit is contained in:
27
client/src/containers/Vendors/withVendors.js
Normal file
27
client/src/containers/Vendors/withVendors.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { getResourceViews } from 'store/customViews/customViews.selectors';
|
||||
|
||||
import {
|
||||
getVendorCurrentPageFactory,
|
||||
getVendorsTableQuery,
|
||||
getVendorsPaginationMetaFactory,
|
||||
} from 'store/vendors/vendors.selectors';
|
||||
|
||||
export default (mapState) => {
|
||||
const getVendorsItems = getVendorCurrentPageFactory();
|
||||
const getVendorsPaginationMeta = getVendorsPaginationMetaFactory();
|
||||
const mapStateToProps = (state, props) => {
|
||||
const query = getVendorsTableQuery(state, props);
|
||||
|
||||
const mapped = {
|
||||
vendorsCurrentPage: getVendorsItems(state, props, query),
|
||||
vendorViews: getResourceViews(state, props, 'vendors'),
|
||||
vendorItems: state.vendors.items,
|
||||
vendorTableQuery: query,
|
||||
vendorsPageination: getVendorsPaginationMeta(state, props, query),
|
||||
vendorsLoading: state.vendors.loading,
|
||||
};
|
||||
return mapState ? mapState(mapped, state, props) : mapped;
|
||||
};
|
||||
return connect(mapStateToProps);
|
||||
};
|
||||
Reference in New Issue
Block a user