squash a bunch of commits
This commit is contained in:
39
Shogi.UI/Shared/Modal/Modals.razor
Normal file
39
Shogi.UI/Shared/Modal/Modals.razor
Normal file
@@ -0,0 +1,39 @@
|
||||
@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)
|
||||
{
|
||||
Console.WriteLine("Modal Change");
|
||||
if (args != null)
|
||||
{
|
||||
shouldShow = args.LoginModalIsVisible || args.GuestAccountDescriptionIsVisible;
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user