mirror of
https://github.com/usebruno/bruno.git
synced 2026-07-08 14:35:03 +00:00
refactor: redux migration - toggle menubar
This commit is contained in:
21
renderer/providers/ReduxStore/slices/app.js
Normal file
21
renderer/providers/ReduxStore/slices/app.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import { createSlice } from '@reduxjs/toolkit'
|
||||
|
||||
const initialState = {
|
||||
leftMenuBarOpen: true,
|
||||
leftSidebarWidth: 270
|
||||
};
|
||||
|
||||
export const appSlice = createSlice({
|
||||
name: 'app',
|
||||
initialState,
|
||||
reducers: {
|
||||
toggleLeftMenuBar: (state) => {
|
||||
state.leftMenuBarOpen = !state.leftMenuBarOpen;
|
||||
state.leftSidebarWidth = state.leftMenuBarOpen ? 270 : 222;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
export const { toggleLeftMenuBar } = appSlice.actions;
|
||||
|
||||
export default appSlice.reducer;
|
||||
Reference in New Issue
Block a user