mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
chrone: sperate client and server to different repos.
This commit is contained in:
21
src/containers/Settings/withSettings.js
Normal file
21
src/containers/Settings/withSettings.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
export default (mapState) => {
|
||||
const mapStateToProps = (state, props) => {
|
||||
const mapped = {
|
||||
organizationSettings: state.settings.data.organization,
|
||||
manualJournalsSettings: state.settings.data.manualJournals,
|
||||
billPaymentSettings: state.settings.data.billPayments,
|
||||
paymentReceiveSettings: state.settings.data.paymentReceives,
|
||||
estimatesSettings: state.settings.data.salesEstimates,
|
||||
receiptSettings: state.settings.data.salesReceipts,
|
||||
invoiceSettings: state.settings.data.salesInvoices,
|
||||
itemsSettings: state.settings.data.items,
|
||||
expenseSettings: state.settings.data.expenses,
|
||||
accountsSettings: state.settings.data.accounts,
|
||||
};
|
||||
return mapState ? mapState(mapped, state, props) : mapped;
|
||||
};
|
||||
|
||||
return connect(mapStateToProps);
|
||||
};
|
||||
12
src/containers/Settings/withSettingsActions.js
Normal file
12
src/containers/Settings/withSettingsActions.js
Normal file
@@ -0,0 +1,12 @@
|
||||
import { connect } from 'react-redux';
|
||||
import {
|
||||
FetchOptions,
|
||||
submitOptions,
|
||||
} from 'store/settings/settings.actions';
|
||||
|
||||
export const mapDispatchToProps = (dispatch) => ({
|
||||
requestSubmitOptions: (form) => dispatch(submitOptions({ form })),
|
||||
requestFetchOptions: () => dispatch(FetchOptions({})),
|
||||
});
|
||||
|
||||
export default connect(null, mapDispatchToProps);
|
||||
Reference in New Issue
Block a user