39 lines
889 B
Plaintext
39 lines
889 B
Plaintext
@inject ModalService modalService
|
|
@inject AccountManager Account
|
|
@inject NavigationManager NavManager
|
|
@inject ILocalStorage localStorage
|
|
|
|
@if (shouldShow)
|
|
{
|
|
<div class="my-modal-background">
|
|
<div class="my-modal">
|
|
@if (modalService.LoginModalIsVisible)
|
|
{
|
|
|
|
}
|
|
else if (modalService.GuestAccountDescriptionIsVisible)
|
|
{
|
|
|
|
}
|
|
</div>
|
|
</div>
|
|
}
|
|
|
|
@code {
|
|
bool shouldShow = false;
|
|
|
|
protected override void OnInitialized()
|
|
{
|
|
modalService.ModalVisibilityChangedEvent += OnModalChange;
|
|
}
|
|
|
|
void OnModalChange(object? sender, ModalVisibilityChangedEventArgs args)
|
|
{
|
|
if (args != null)
|
|
{
|
|
shouldShow = args.LoginModalIsVisible || args.GuestAccountDescriptionIsVisible;
|
|
StateHasChanged();
|
|
}
|
|
}
|
|
}
|