This commit is contained in:
Виталий Лавшонок
2025-10-23 16:34:13 +03:00
parent 8df53a4ed5
commit e3ce191b44
23 changed files with 236 additions and 170 deletions

30
src/redux/slices/store.ts Normal file
View File

@@ -0,0 +1,30 @@
import { createSlice, PayloadAction} from "@reduxjs/toolkit";
// Типы данных
interface StorState {
menu: {
activePage: string;
}
}
// Инициализация состояния
const initialState: StorState = {
menu: {
activePage: "",
}
};
// Slice
const storeSlice = createSlice({
name: "store",
initialState,
reducers: {
setMenuActivePage: (state, activePage: PayloadAction<string>) => {
state.menu.activePage = activePage.payload;
},
},
});
export const { setMenuActivePage } = storeSlice.actions;
export const storeReducer = storeSlice.reducer;