Feat/update login flow reload page (#467)
* update spacing event modal * update spacing create calendar modal * fix evenchip description color * using variant instead of sx * update login flow * fix: add useEffect import back to Calendar.tsx
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
|
||||
|
||||
interface LoadingState {
|
||||
isLoading: boolean;
|
||||
message?: string;
|
||||
}
|
||||
|
||||
const initialState: LoadingState = {
|
||||
isLoading: false,
|
||||
message: undefined,
|
||||
};
|
||||
|
||||
const loadingSlice = createSlice({
|
||||
name: "loading",
|
||||
initialState,
|
||||
reducers: {
|
||||
setAppLoading: (state, action: PayloadAction<boolean>) => {
|
||||
state.isLoading = action.payload;
|
||||
if (!action.payload) {
|
||||
state.message = undefined;
|
||||
}
|
||||
},
|
||||
setLoadingMessage: (state, action: PayloadAction<string | undefined>) => {
|
||||
state.message = action.payload;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export const { setAppLoading, setLoadingMessage } = loadingSlice.actions;
|
||||
export default loadingSlice.reducer;
|
||||
@@ -3,6 +3,7 @@ import searchResultReducer from "@/features/Search/SearchSlice";
|
||||
import settingsReducer from "@/features/Settings/SettingsSlice";
|
||||
import userReducer from "@/features/User/userSlice";
|
||||
import { combineReducers, configureStore } from "@reduxjs/toolkit";
|
||||
import loadingReducer from "./loadingSlice";
|
||||
import { createBrowserHistory } from "history";
|
||||
import { createReduxHistoryContext } from "redux-first-history";
|
||||
|
||||
@@ -15,6 +16,7 @@ const rootReducer = combineReducers({
|
||||
calendars: eventsCalendar,
|
||||
settings: settingsReducer,
|
||||
searchResult: searchResultReducer,
|
||||
loading: loadingReducer,
|
||||
});
|
||||
|
||||
export const setupStore = (preloadedState?: Partial<RootState>) => {
|
||||
|
||||
Reference in New Issue
Block a user