Extract shared header and skill group block components
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.JSInterop;
|
||||
using RpgRoller.Components.Pages.HomeControls;
|
||||
using RpgRoller.Contracts;
|
||||
using RpgRoller.Domain;
|
||||
|
||||
@@ -846,7 +847,22 @@ public partial class Workspace : IAsyncDisposable
|
||||
|
||||
private bool IsPlayScreen => string.Equals(CurrentScreen, "play", StringComparison.OrdinalIgnoreCase);
|
||||
private bool IsManagementScreen => !IsPlayScreen;
|
||||
private string CurrentScreenLabel => IsPlayScreen ? "Play" : "Campaign Management";
|
||||
private IReadOnlyList<AppHeaderMenuItem> HeaderMenuItems
|
||||
{
|
||||
get
|
||||
{
|
||||
var items = new List<AppHeaderMenuItem>
|
||||
{
|
||||
new() { Label = "Play", IsActive = IsPlayScreen, OnSelected = SwitchToPlayAsync },
|
||||
new() { Label = "Campaign Management", IsActive = IsManagementScreen, OnSelected = SwitchToManagementAsync }
|
||||
};
|
||||
|
||||
if (IsCurrentUserAdmin)
|
||||
items.Add(new AppHeaderMenuItem { Label = "Admin", IsActive = false, OnSelected = OpenAdminAsync });
|
||||
|
||||
return items;
|
||||
}
|
||||
}
|
||||
|
||||
private string ConnectionStateLabel => ConnectionState switch
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user