feat: lots updates
This commit is contained in:
+20
-1
@@ -2,6 +2,9 @@ import { createSlice } from "@reduxjs/toolkit";
|
||||
|
||||
const initialState = {
|
||||
menuExpand: true,
|
||||
setting: false,
|
||||
profileSetting: false,
|
||||
channelSetting: null,
|
||||
};
|
||||
const uiSlice = createSlice({
|
||||
name: "ui",
|
||||
@@ -10,7 +13,23 @@ const uiSlice = createSlice({
|
||||
toggleMenuExpand(state) {
|
||||
state.menuExpand = !state.menuExpand;
|
||||
},
|
||||
toggleSetting(state) {
|
||||
state.setting = !state.setting;
|
||||
},
|
||||
toggleProfileSetting(state) {
|
||||
state.profileSetting = !state.profileSetting;
|
||||
},
|
||||
toggleChannelSetting(state, action) {
|
||||
console.log("toggle channel setting payload", action);
|
||||
const id = action.payload;
|
||||
state.channelSetting = state.channelSetting ? null : id;
|
||||
},
|
||||
},
|
||||
});
|
||||
export const { toggleMenuExpand } = uiSlice.actions;
|
||||
export const {
|
||||
toggleSetting,
|
||||
toggleMenuExpand,
|
||||
toggleProfileSetting,
|
||||
toggleChannelSetting,
|
||||
} = uiSlice.actions;
|
||||
export default uiSlice.reducer;
|
||||
|
||||
Reference in New Issue
Block a user