feat: lots updates

This commit is contained in:
zerosoul
2022-02-24 14:50:26 +08:00
parent b1ba2aa523
commit 0394c99292
46 changed files with 1101 additions and 397 deletions
+20 -1
View File
@@ -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;