- Data table sticky header.

- Mini sidebar toggle.
- Refactor withDashboard and withDashboardActions.
This commit is contained in:
Ahmed Bouhuolia
2020-05-31 15:57:02 +02:00
parent c1659d191f
commit 2a466ce2da
49 changed files with 1045 additions and 669 deletions

View File

@@ -3,10 +3,12 @@ import thunkMiddleware from 'redux-thunk';
import monitorReducerEnhancer from 'store/enhancers/monitorReducer';
import loggerMiddleware from 'middleware/logger'
import rootReducer from 'store/reducers';
import { loadState, saveState } from 'store/localStorage';
import persistState from 'redux-localstorage'
const persistPaths = ['dashboard', 'authentication'];
const createStore = (initialState = {
...loadState(),
// ...loadState(),
}) => {
/**
|--------------------------------------------------
@@ -25,6 +27,7 @@ const createStore = (initialState = {
*/
const enhancers = [
monitorReducerEnhancer,
persistState(persistPaths, { key: 'bigcapital' }),
];
let composeEnhancers = compose;
@@ -45,12 +48,6 @@ const createStore = (initialState = {
composeEnhancers(applyMiddleware(...middleware), ...enhancers)
);
store.asyncReducers = {};
store.subscribe(() => {
saveState({
authentication: store.getState().authentication,
});
});
return store;
};
export default createStore();