-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #216 from DennisvHest/210-suggestion-show-which-ma…
…ps-are-in-which-playlist-in-the-general-maps-overview-vial-small-logos 210 suggestion show which maps are in which playlist in the general maps overview vial small logos
- Loading branch information
Showing
10 changed files
with
248 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
@inherits ReactiveComponent | ||
|
||
@{ | ||
var specificPlaylistContainsMap = PlaylistsContainingMapHash.Contains(SpecificPlaylist); | ||
var showIcon = SpecificPlaylist is null && PlaylistsContainingMapHash.Any() || specificPlaylistContainsMap; | ||
|
||
if (showIcon) | ||
{ | ||
string tooltip; | ||
|
||
if (specificPlaylistContainsMap) | ||
{ | ||
tooltip = "Playlist already contains this map"; | ||
} | ||
else | ||
{ | ||
tooltip = $"In playlists: {string.Join(", ", PlaylistsContainingMapHash.Select(p => p.Title))}"; | ||
} | ||
|
||
<MudTooltip Text="@tooltip" RootClass="d-flex"> | ||
<MudIcon Icon="@Icons.Material.Filled.PlaylistAddCheckCircle" Style="opacity: 0.4" /> | ||
</MudTooltip> | ||
} | ||
} | ||
|
||
@code { | ||
[Inject] | ||
IPlaylistService PlaylistService { get; set; } | ||
|
||
[Parameter] | ||
public string MapHash { get; set; } | ||
|
||
[Parameter] | ||
public Playlist? SpecificPlaylist { get; set; } | ||
|
||
Playlist[] PlaylistsContainingMapHash = []; | ||
|
||
protected override void OnInitialized() | ||
{ | ||
SubscribeAndBind(PlaylistService.MapsInPlaylistsByHash, mapsInPlaylistsByHash => | ||
{ | ||
if (MapHash is null || !mapsInPlaylistsByHash.ContainsKey(MapHash)) | ||
{ | ||
PlaylistsContainingMapHash = Array.Empty<Playlist>(); | ||
return; | ||
} | ||
|
||
PlaylistsContainingMapHash = mapsInPlaylistsByHash[MapHash]; | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters