LearnChineseSimplified/CCharLearn/Shared/MainLayout.razor

31 lines
1.2 KiB
Plaintext
Raw Permalink Normal View History

2023-06-27 11:48:18 +02:00
@using System.Text;
@inherits LayoutComponentBase
@inject NavigationManager navigator
@inject Blazored.LocalStorage.ILocalStorageService localStorage
<MudLayout>
<MudAppBar Elevation="0">
@if (Program.CCharsLeft > 0)
{
2023-07-02 21:50:38 +02:00
<MudButton OnClick="()=>{navigator.NavigateTo(string.Empty); Program.CCharsLeft = 0;}" Variant="Variant.Outlined" Color="Color.Primary">Back</MudButton>
2023-06-29 21:27:58 +02:00
<MudText Class="pl-8">@("CChars left: " + Program.CCharsLeft)</MudText>
}
2023-06-27 11:48:18 +02:00
<MudSpacer />
<MudIconButton Icon="@Icons.Custom.Brands.MudBlazor" Color="Color.Inherit" Link="https://mudblazor.com/" Target="_blank" />
<MudIconButton Icon="@Icons.Custom.Brands.LinkedIn" Color="Color.Inherit" Link="https://www.linkedin.com/in/zhentao-wei-3a3a0a182/" Target="_blank" />
</MudAppBar>
<MudMainContent>
<MudContainer MaxWidth="MaxWidth.Large" Style="height: 90vh;" Class="pt-2">
@Body
</MudContainer>
</MudMainContent>
</MudLayout>
@code {
protected override async Task OnInitializedAsync()
{
Program.UpdateUiEvent += OnUiUpdate;
}
2023-06-27 11:48:18 +02:00
void OnUiUpdate() => StateHasChanged();
2023-06-27 11:48:18 +02:00
}