@using Wabbajack.App.Blazor.Pages
@using Wabbajack.App.Blazor.Shared
@using Wabbajack.App.Blazor.State
@inject NavigationManager _navigationManager
@inject IStateContainer _stateContainer
@namespace Wabbajack.App.Blazor.Components
@code {
private static readonly Dictionary Pages = new()
{
{"Play", Play.Route},
{"Gallery", Gallery.Route},
{"Install", Select.Route},
{"Create", Create.Route}
};
private void Navigate(string page)
{
_navigationManager.NavigateTo(page);
}
protected override void OnInitialized()
{
// TODO(erri120): update this
// _navigationManager.LocationChanged += (_, _) => StateHasChanged();
// _globalState.OnNavigationStateChange += StateHasChanged;
}
private string CurrentPage(string page)
{
var relativePath = _navigationManager.ToBaseRelativePath(_navigationManager.Uri);
return page.Equals(relativePath, StringComparison.OrdinalIgnoreCase) ? "active" : string.Empty;
}
}