Eugen Rochko 9101067154 [Glitch] Change navigation layout on small screens in web UI
Port a13b33d85131e3e65cfc71894672cb2b15c89c51 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2025-06-12 09:48:07 +02:00

29 lines
574 B
TypeScript

import { createReducer } from '@reduxjs/toolkit';
import {
openNavigation,
closeNavigation,
toggleNavigation,
} from 'flavours/glitch/actions/navigation';
interface State {
open: boolean;
}
const initialState: State = {
open: false,
};
export const navigationReducer = createReducer(initialState, (builder) => {
builder
.addCase(openNavigation, (state) => {
state.open = true;
})
.addCase(closeNavigation, (state) => {
state.open = false;
})
.addCase(toggleNavigation, (state) => {
state.open = !state.open;
});
});