Files
WotBlitzStatisticsBlazor/WotBlitzStatisticsPro.Blazor/Pages/Index.razor
T

51 lines
2.1 KiB
Plaintext

@page "/"
@using MediatR
@using WotBlitzStatisticsPro.Blazor.Messages
@using WotBlitzStatisticsPro.Blazor.Model
@using WotBlitzStatisticsPro.Blazor.Services
@inject IStringLocalizer<App> Localize
@inject IMediator Mediator
@inject ILocalStorageService LocalStorage
<div class="splash">
<div class="splash-content">
<RadzenLabel Text=@Localize["Welcome to WOT Blitz statistics application!"] Style="margin: 30px 0px 100px 0px"></RadzenLabel>
@if(LoginInfo != null)
{
<RadzenButton Click=@(async args => { await Mediator.Publish(new OpenPlayerInfoMessage(LoginInfo.AccountId, true)); })
Icon="person"
[email protected]
Style="width: 300px; margin: 30px" />
<RadzenButton Click=@(async args => { await Mediator.Publish(new LogOutFromWgMessage()); })
Icon="logout"
Text=@Localize["Log out"]
Style="width: 300px; margin: 30px" />
}
else
{
<RadzenButton Click=@(async args => { await Mediator.Publish(new LoginToWgMessage()); })
Icon="vpn_key"
Text=@Localize["Login with WG.net ID"]
Style="width: 300px; margin: 30px" />
}
<RadzenButton Click=@(async args => { await Mediator.Publish(new OpenSearchDialogMessage(DialogType.FindPlayer)); })
Icon="person_search"
Text=@Localize["Search player"]
Style="width: 300px; margin: 30px" />
<RadzenButton Click=@(async args => { await Mediator.Publish(new OpenSearchDialogMessage(DialogType.FindClan)); })
Icon="screen_search_desktop"
Text=@Localize["Search clan"]
Style="width: 300px; margin: 30px" />
</div>
</div>
@code {
public LoginInfo? LoginInfo { get; set; }
protected override async Task OnInitializedAsync()
{
LoginInfo = await LocalStorage.GetItemAsync<LoginInfo>(Constants.LoginInfoLocalStorageKey);
}
}