Create a component for displaying bookmark containers

This commit is contained in:
Neil Brommer 2021-11-29 22:26:38 -08:00
parent b0a4c5a957
commit 437e90039f
2 changed files with 36 additions and 28 deletions

View file

@ -0,0 +1,35 @@
@using Start.Shared
<div class="activeBookmarkContainer">
@if (this.Container == null)
{
<div class="empty">
<div class="empty-icon">
<div class="loading loading-icon"></div>
</div>
<p class="empty-title h5">Loading Bookmarks</p>
</div>
<p class="text-center">Loading Bookmarks</p>
}
else if (!this.Container.BookmarkGroups?.Any() ?? true)
{
<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>
</div>
}
else
{
foreach (BookmarkGroupDto group in this.Container.BookmarkGroups!)
{
<BookmarkGroup Group="group" />
}
}
</div>
@code {
[Parameter]
public BookmarkContainerDto? Container { get; set; }
}

View file

@ -47,34 +47,7 @@ else
</li>
</ul>
<div class="activeBookmarkContainer">
@if (this.selectedBookmarkContainer == null)
{
<div class="empty">
<div class="empty-icon">
<div class="loading loading-icon"></div>
</div>
<p class="empty-title h5">Loading Bookmarks</p>
</div>
<p class="text-center">Loading Bookmarks</p>
}
else if (!this.selectedBookmarkContainer.BookmarkGroups?.Any() ?? true)
{
<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>
</div>
}
else
{
@foreach (BookmarkGroupDto group in this.selectedBookmarkContainer.BookmarkGroups!)
{
<BookmarkGroup Group="group" />
}
}
</div>
<BookmarkContainer Container="this.selectedBookmarkContainer" />
<CreateContainer IsOpen="showCreateContainerForm" OnClose="this.OnCloseCreateContainer"
OnCreated="this.OnContainerCreated" />