@page "/" @inherits Fluxor.Blazor.Web.Components.FluxorComponent @using System.Linq @using Start.Client.Components @using Start.Client.Store.State @using Start.Client.Store.Features.CurrentContainer @using Start.Client.Store.Features.CreateContainer @using Start.Client.Store.Features.DeleteContainer @using Start.Client.Store.Features.Sidebar @using Fluxor @* Distinguish from Refit.Authorize *@ @attribute [Microsoft.AspNetCore.Authorization.Authorize] @inject Blazored.LocalStorage.ILocalStorageService localStorage @inject IState state @inject IDispatcher dispatch @if (this.state.Value.ContainerListState.ErrorMessage != null) { Error @this.state.Value.ContainerListState.ErrorMessage } @if (this.state.Value.ContainerListState.IsLoadingContainersList) {

Loading Containers

} else {
    @foreach (BookmarkContainerDto container in this.state.Value.ContainerListState.Containers) { string itemClasses = "tab-item"; if (container.BookmarkContainerId == this.state.Value.CurrentContainerState.Container?.BookmarkContainerId) itemClasses += " active";
  • @container.Title @if (this.state.Value.EditMode) { }
  • } @if (this.state.Value.EditMode) {
  • }
} @code { protected void ShowSidebar() { dispatch.Dispatch(new ShowSidebarAction()); } protected void OnContainerSelected(int bookmarkContainerId) { dispatch.Dispatch(new LoadCurrentContainerAction(bookmarkContainerId)); } protected void OnDeleteContainerClicked(int bookmarkContainerId) { BookmarkContainerDto? bookmarkContainerToDelete = this.state.Value.ContainerListState .Containers ?.FirstOrDefault(bc => bc.BookmarkContainerId == bookmarkContainerId); if (bookmarkContainerToDelete == null) return; this.dispatch.Dispatch(new ShowDeleteContainerFormAction( bookmarkContainerToDelete.BookmarkContainerId, bookmarkContainerToDelete.Title)); } protected void OnCreateContainerClicked() { dispatch.Dispatch(new ShowCreateContainerFormAction()); } }