Add account and articles updater
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { createSlice, createAsyncThunk, PayloadAction } from '@reduxjs/toolkit';
|
||||
import { createSlice, createAsyncThunk } from '@reduxjs/toolkit';
|
||||
import axios from '../../axios';
|
||||
|
||||
// 🔹 Декодирование JWT
|
||||
|
||||
@@ -4,6 +4,7 @@ import { createSlice, PayloadAction } from '@reduxjs/toolkit';
|
||||
interface StorState {
|
||||
menu: {
|
||||
activePage: string;
|
||||
activeProfilePage: string;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -11,6 +12,7 @@ interface StorState {
|
||||
const initialState: StorState = {
|
||||
menu: {
|
||||
activePage: '',
|
||||
activeProfilePage: '',
|
||||
},
|
||||
};
|
||||
|
||||
@@ -22,8 +24,15 @@ const storeSlice = createSlice({
|
||||
setMenuActivePage: (state, activePage: PayloadAction<string>) => {
|
||||
state.menu.activePage = activePage.payload;
|
||||
},
|
||||
setMenuActiveProfilePage: (
|
||||
state,
|
||||
activeProfilePage: PayloadAction<string>,
|
||||
) => {
|
||||
state.menu.activeProfilePage = activeProfilePage.payload;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export const { setMenuActivePage } = storeSlice.actions;
|
||||
export const { setMenuActivePage, setMenuActiveProfilePage } =
|
||||
storeSlice.actions;
|
||||
export const storeReducer = storeSlice.reducer;
|
||||
|
||||
Reference in New Issue
Block a user