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

29 lines
1.2 KiB
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/>
<MudTooltip Text="Go to the source code on GitHub">
<MudIconButton Icon="@Icons.Custom.Brands.GitHub" Href="https://github.com/hmaxnl/SharpRSS" Target="_blank"/>
</MudTooltip>
<MudTooltip Text="@(BaseLayout.DarkTheme ? "Toggle to light mode" : "Toggle to dark mode")">
<MudToggleIconButton @bind-Toggled="@BaseLayout.DarkTheme" Color="Color.Dark" ToggledColor="Color.Warning" Icon="@Icons.Material.Filled.DarkMode" ToggledIcon="@Icons.Material.Filled.LightMode"/>
</MudTooltip>
2024-06-17 14:47:10 +02:00
</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;
}
}