BlazorStart/Start/Client/Store/Features/Sidebar/SidebarReducers.cs
Neil Brommer f63798e897 Turn the top nav bar into a sidebar
Add an edit mode
2021-12-07 17:12:20 -08:00

28 lines
633 B
C#

using Fluxor;
using Start.Client.Store.State;
namespace Start.Client.Store.Features.Sidebar {
public static class SidebarReducers {
[ReducerMethod(typeof(ShowSidebarAction))]
public static RootState ShowSidebar(RootState state) {
return state with {
ShowSidebar = true
};
}
[ReducerMethod(typeof(HideSidebarAction))]
public static RootState HideSidebar(RootState state) {
return state with {
ShowSidebar = false
};
}
[ReducerMethod(typeof(ToggleEditModeAction))]
public static RootState ToggleEditMode(RootState state) {
return state with {
EditMode = !state.EditMode
};
}
}
}