WIP
This commit is contained in:
@@ -1,11 +1,15 @@
|
||||
import { createSlice } from '@reduxjs/toolkit';
|
||||
|
||||
import type { RootState } from '../store';
|
||||
|
||||
interface AppState {
|
||||
sidebarOpen: boolean;
|
||||
darkMode: boolean;
|
||||
}
|
||||
|
||||
const initialState: AppState = {
|
||||
sidebarOpen: true,
|
||||
darkMode: false,
|
||||
};
|
||||
|
||||
export const appSlice = createSlice({
|
||||
@@ -25,5 +29,6 @@ export const appSlice = createSlice({
|
||||
});
|
||||
|
||||
export const { openSidebar, closeSidebar, toggleSidebar } = appSlice.actions;
|
||||
|
||||
export const selectOpenState = (state: RootState): boolean =>
|
||||
state.app.sidebarOpen;
|
||||
export default appSlice.reducer;
|
||||
|
||||
Reference in New Issue
Block a user