Turn the top nav bar into a sidebar

Add an edit mode
This commit is contained in:
Neil Brommer 2021-12-07 17:12:20 -08:00
parent 91a660ef43
commit f63798e897
11 changed files with 266 additions and 49 deletions

View file

@ -0,0 +1,5 @@
namespace Start.Client.Store.Features.Sidebar {
public class ShowSidebarAction { }
public class HideSidebarAction { }
public class ToggleEditModeAction { }
}

View file

@ -0,0 +1,27 @@
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
};
}
}
}

View file

@ -8,6 +8,9 @@ namespace Start.Client.Store.State {
public ContainerListState ContainerListState { get; init; }
public CurrentContainerState CurrentContainerState { get; init; }
public bool ShowSidebar { get; init; }
public bool EditMode { get; init; }
public RootState() {
this.ContainerListState = new ContainerListState();
this.CurrentContainerState = new CurrentContainerState();