2021-12-17 06:06:41 +00:00
|
|
|
@using Start.Client.Components.Shared
|
|
|
|
@using Start.Client.Store.State
|
2021-12-05 23:50:48 +00:00
|
|
|
@using Start.Client.Store.Features.CreateGroup
|
|
|
|
@using Fluxor
|
|
|
|
|
|
|
|
@inherits Fluxor.Blazor.Web.Components.FluxorComponent
|
|
|
|
|
|
|
|
@inject IDispatcher dispatch
|
|
|
|
@inject IState<RootState> state
|
|
|
|
|
2021-12-17 05:26:53 +00:00
|
|
|
<div class="activeBookmarkContainer" role="tabpanel">
|
2021-12-05 23:50:48 +00:00
|
|
|
@if (this.state.Value.CurrentContainerState.ErrorMessage != null)
|
|
|
|
{
|
|
|
|
<Alert Type="Alert.AlertType.Error">
|
|
|
|
@this.state.Value.CurrentContainerState.ErrorMessage
|
|
|
|
</Alert>
|
|
|
|
}
|
|
|
|
|
|
|
|
@if (this.state.Value.CurrentContainerState.IsLoadingCurrentContainer)
|
2021-11-30 06:26:38 +00:00
|
|
|
{
|
|
|
|
<div class="empty">
|
|
|
|
<div class="empty-icon">
|
|
|
|
<div class="loading loading-icon"></div>
|
|
|
|
</div>
|
|
|
|
<p class="empty-title h5">Loading Bookmarks</p>
|
|
|
|
</div>
|
|
|
|
}
|
2021-12-05 23:50:48 +00:00
|
|
|
else if (this.state.Value.CurrentContainerState.Container == null)
|
|
|
|
{
|
|
|
|
<div class="empty">
|
|
|
|
<div class="empty-icon">
|
|
|
|
<i class="icon icon-3x icon-bookmark"></i>
|
|
|
|
</div>
|
|
|
|
<p class="empty-title h5">Failed To Load Container</p>
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
else if (this.state.Value.CurrentContainerState.Container.BookmarkGroups == null
|
|
|
|
|| (!(this.state.Value.CurrentContainerState.Container.BookmarkGroups?.Any()) ?? true))
|
2021-11-30 06:26:38 +00:00
|
|
|
{
|
|
|
|
<div class="empty">
|
|
|
|
<div class="empty-icon">
|
|
|
|
<i class="icon icon-3x icon-bookmark"></i>
|
|
|
|
</div>
|
|
|
|
<p class="empty-title h5">No Bookmark Groups</p>
|
2021-12-05 23:50:48 +00:00
|
|
|
<div class="empty-action">
|
|
|
|
<button class="btn btn-primary" @onclick="this.ShowCreateGroupForm">
|
|
|
|
<i class="icon icon-plus"></i> Create Group
|
|
|
|
</button>
|
|
|
|
</div>
|
2021-11-30 06:26:38 +00:00
|
|
|
</div>
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-12-05 23:50:48 +00:00
|
|
|
<div id="bookmarkGroups">
|
|
|
|
@* The compiler doesn't pick up that null has already been checked for,
|
|
|
|
so the ! is needed *@
|
|
|
|
@foreach (BookmarkGroupDto group in this.state.Value.CurrentContainerState.Container.BookmarkGroups!)
|
|
|
|
{
|
|
|
|
<BookmarkGroup Group="group" />
|
|
|
|
}
|
|
|
|
|
2021-12-08 01:12:20 +00:00
|
|
|
@if (this.state.Value.EditMode)
|
|
|
|
{
|
|
|
|
<div class="addBookmarkGroupButton text-center">
|
|
|
|
<button type="button" class="btn tooltip tooltip-bottom"
|
|
|
|
@onclick="this.ShowCreateGroupForm"
|
|
|
|
aria-label="Create Group" data-tooltip="Create Group">
|
|
|
|
<i class="icon icon-plus"></i>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
}
|
2021-12-05 23:50:48 +00:00
|
|
|
</div>
|
2021-11-30 06:26:38 +00:00
|
|
|
}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
@code {
|
2021-12-05 23:50:48 +00:00
|
|
|
public void ShowCreateGroupForm()
|
|
|
|
{
|
|
|
|
if (this.state.Value.CurrentContainerState.Container == null)
|
|
|
|
return;
|
|
|
|
|
|
|
|
dispatch.Dispatch(new ShowCreateGroupFormAction(
|
|
|
|
this.state.Value.CurrentContainerState.Container.BookmarkContainerId,
|
|
|
|
this.state.Value.CurrentContainerState.Container.Title));
|
|
|
|
}
|
2021-11-30 06:26:38 +00:00
|
|
|
}
|