Skip to content

Commit

Permalink
Merge pull request #214 from DennisvHest/211-show-message-in-playlist…
Browse files Browse the repository at this point in the history
…-list-of-there-are-no-playlists-or-no-results-from-filtering

Showing message in playlist list when no playlists are found
  • Loading branch information
DennisvHest authored Aug 24, 2024
2 parents e345faa + d8ffb08 commit 1dfc2ae
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions MapMaven/Components/Playlists/PlaylistList.razor
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@
@if (string.IsNullOrEmpty(PlaylistSearchText))
{
<MudTreeView T="Playlist" @ref="PlaylistTreeView" SelectedValue="SelectedPlaylist" SelectedValueChanged="OnPlaylistSelect" Color="Color.Primary" ExpandOnClick="true" AutoExpand="true">
<PlaylistTreeViewFolder Folder="PlaylistTree.RootPlaylistFolder" />
<PlaylistTreeViewFolder Folder="PlaylistTree.RootPlaylistFolder" Loading="LoadingPlaylists" />
</MudTreeView>
}
else
{
<MudTreeView T="Playlist" SelectedValue="SelectedPlaylist" SelectedValueChanged="OnPlaylistSelect" Color="Color.Primary" ExpandOnClick="true">
<PlaylistTreeViewFolder Folder="PlaylistTree.RootPlaylistFolder" Expanded="true" />
<PlaylistTreeViewFolder Folder="PlaylistTree.RootPlaylistFolder" Loading="LoadingPlaylists" Expanded="true" />
</MudTreeView>
}
</div>
Expand Down
7 changes: 7 additions & 0 deletions MapMaven/Components/Playlists/PlaylistTreeViewFolder.razor
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@
}
}

@if (!Loading && !Folder.ChildItems.Any())
{
<div class="d-flex align-center justify-center full-width pa-2">
<MudIcon Icon="@Icons.Material.Filled.PlaylistRemove" Class="mr-2" /> <soan>No playlists found</soan>
</div>
}

<MudDialog @bind-Visible="DeletePlaylistDialogVisible" Options="new() { BackdropClick = false }">
<DialogContent>
<MudText Typo="Typo.body1" Class="mb-3">Are you sure you want to delete the "@PlaylistToDelete.Title" playlist?</MudText>
Expand Down
3 changes: 3 additions & 0 deletions MapMaven/Components/Playlists/PlaylistTreeViewFolder.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ public partial class PlaylistTreeViewFolder
[Parameter]
public bool Expanded { get; set; }

[Parameter]
public bool Loading { get; set; }

Playlist? PlaylistToDelete = null;
bool DeletePlaylistDialogVisible = false;
bool DeletingPlaylist = false;
Expand Down

0 comments on commit 1dfc2ae

Please sign in to comment.