@inject ModalService modalService
@inject AccountManager Account
@inject NavigationManager NavManager
@inject ILocalStorage localStorage
@if (shouldShow)
{
@if (modalService.LoginModalIsVisible)
{
}
else if (modalService.GuestAccountDescriptionIsVisible)
{
}
}
@code {
bool shouldShow = false;
protected override void OnInitialized()
{
modalService.ModalVisibilityChangedEvent += OnModalChange;
}
void OnModalChange(object? sender, ModalVisibilityChangedEventArgs args)
{
Console.WriteLine("Modal Change");
if (args != null)
{
shouldShow = args.LoginModalIsVisible || args.GuestAccountDescriptionIsVisible;
StateHasChanged();
}
}
}