SharpRSS/SharpRSS.Blazor/Components/Layout/ApplicationLayout.razor

25 lines
961 B
Plaintext
Raw Normal View History

2024-06-17 14:47:10 +02:00
@inherits LayoutComponentBase
@layout BaseLayout
<CascadingValue Value="this">
<MudAppBar Color="Color.Primary">
<MudIconButton Icon="@Icons.Material.Filled.Menu" Color="Color.Inherit" Edge="Edge.Start" OnClick="@((e) => ToggleDrawerOpen())" />
<MudText Typo="Typo.h6">@AppText</MudText>
<MudSpacer/>
<MudIconButton Icon="@Icons.Custom.Brands.GitHub" Href="https://github.com/hmaxnl/SharpRSS"/>
<MudToggleIconButton @bind-Toggled="@BaseLayout.DarkTheme" Color="Color.Dark" ToggledColor="Color.Warning" Icon="@Icons.Material.Filled.DarkMode" ToggledIcon="@Icons.Material.Filled.LightMode"/>
</MudAppBar>
@Body
</CascadingValue>
@code {
[CascadingParameter]
public BaseLayout BaseLayout { get; set; } = null!;
public bool DrawerOpen { get; set; } = true;
public string AppText { get; set; } = "SharpRSS";
private void ToggleDrawerOpen()
{
DrawerOpen = !DrawerOpen;
}
}