[REFACTOR] Name change projects and solution
This commit is contained in:
20
Manager.App/Components/Layout/ApplicationLayout.razor
Normal file
20
Manager.App/Components/Layout/ApplicationLayout.razor
Normal file
@@ -0,0 +1,20 @@
|
||||
@inherits LayoutComponentBase
|
||||
@layout BaseLayout
|
||||
|
||||
<CascadingValue Value="this">
|
||||
<MudAppBar Color="Color.Primary">
|
||||
<MudIconButton Icon="@Icons.Material.Filled.Menu" Color="Color.Inherit" Edge="Edge.Start" OnClick="@(_ => ToggleDrawerOpen())" />
|
||||
<MudText Typo="Typo.h6">@AppText</MudText>
|
||||
<MudSpacer/>
|
||||
<MudTooltip Text="Gitea source">
|
||||
<MudIconButton Icon="@Icons.Material.Filled.Source" Href="https://git.netzbyte.com/max/Yt-Import" Target="_blank"/>
|
||||
</MudTooltip>
|
||||
@if (BaseLayout != null)
|
||||
{
|
||||
<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>
|
||||
}
|
||||
</MudAppBar>
|
||||
@Body
|
||||
</CascadingValue>
|
16
Manager.App/Components/Layout/ApplicationLayout.razor.cs
Normal file
16
Manager.App/Components/Layout/ApplicationLayout.razor.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace Manager.App.Components.Layout;
|
||||
|
||||
public partial class ApplicationLayout
|
||||
{
|
||||
[CascadingParameter]
|
||||
public BaseLayout? BaseLayout { get; set; }
|
||||
public bool DrawerOpen { get; set; } = true;
|
||||
public string AppText { get; set; } = "YouTube Import";
|
||||
|
||||
private void ToggleDrawerOpen()
|
||||
{
|
||||
DrawerOpen = !DrawerOpen;
|
||||
}
|
||||
}
|
20
Manager.App/Components/Layout/BaseLayout.razor
Normal file
20
Manager.App/Components/Layout/BaseLayout.razor
Normal file
@@ -0,0 +1,20 @@
|
||||
@inherits LayoutComponentBase
|
||||
|
||||
<MudThemeProvider @ref="@_themeProvider" Theme="@_mudTheme" IsDarkMode="@DarkTheme"/>
|
||||
<MudPopoverProvider />
|
||||
<MudDialogProvider/>
|
||||
<MudSnackbarProvider/>
|
||||
|
||||
<CascadingValue Value="this">
|
||||
<MudLayout>
|
||||
<MudMainContent>
|
||||
@Body
|
||||
</MudMainContent>
|
||||
</MudLayout>
|
||||
</CascadingValue>
|
||||
|
||||
<div id="blazor-error-ui">
|
||||
An unhandled error has occurred.
|
||||
<a href="" class="reload">Reload</a>
|
||||
<a class="dismiss">🗙</a>
|
||||
</div>
|
37
Manager.App/Components/Layout/BaseLayout.razor.cs
Normal file
37
Manager.App/Components/Layout/BaseLayout.razor.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using MudBlazor;
|
||||
|
||||
namespace Manager.App.Components.Layout;
|
||||
|
||||
public partial class BaseLayout
|
||||
{
|
||||
private readonly MudTheme _mudTheme = new MudTheme();
|
||||
private MudThemeProvider? _themeProvider;
|
||||
private bool _isDarkTheme = true;
|
||||
|
||||
public event EventHandler<bool>? OnDarkThemeChanged;
|
||||
|
||||
public bool DarkTheme
|
||||
{
|
||||
get => _isDarkTheme;
|
||||
set
|
||||
{
|
||||
_isDarkTheme = value;
|
||||
ThemeChanged();
|
||||
}
|
||||
}
|
||||
|
||||
private void ThemeChanged()
|
||||
{
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if (firstRender && _themeProvider != null)
|
||||
{
|
||||
DarkTheme = await _themeProvider.GetSystemDarkModeAsync();
|
||||
_themeProvider.IsDarkModeChanged = EventCallback.Factory.Create<bool>(this, x => OnDarkThemeChanged?.Invoke(this, x));
|
||||
}
|
||||
}
|
||||
}
|
18
Manager.App/Components/Layout/BaseLayout.razor.css
Normal file
18
Manager.App/Components/Layout/BaseLayout.razor.css
Normal file
@@ -0,0 +1,18 @@
|
||||
#blazor-error-ui {
|
||||
background: lightyellow;
|
||||
bottom: 0;
|
||||
box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
|
||||
display: none;
|
||||
left: 0;
|
||||
padding: 0.6rem 1.25rem 0.7rem 1.25rem;
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
#blazor-error-ui .dismiss {
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
right: 0.75rem;
|
||||
top: 0.5rem;
|
||||
}
|
16
Manager.App/Components/Layout/MainLayout.razor
Normal file
16
Manager.App/Components/Layout/MainLayout.razor
Normal file
@@ -0,0 +1,16 @@
|
||||
@inherits LayoutComponentBase
|
||||
@layout ApplicationLayout
|
||||
|
||||
@if (ApplicationLayout != null)
|
||||
{
|
||||
<MudDrawer @bind-Open="@ApplicationLayout.DrawerOpen" ClipMode="DrawerClipMode.Always">
|
||||
<NavMenu/>
|
||||
<MudSpacer/>
|
||||
</MudDrawer>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudAlert Severity="Severity.Error" Variant="Variant.Outlined">Error getting cascading parameter 'ApplicationLayout'!</MudAlert>
|
||||
}
|
||||
|
||||
@Body
|
9
Manager.App/Components/Layout/MainLayout.razor.cs
Normal file
9
Manager.App/Components/Layout/MainLayout.razor.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace Manager.App.Components.Layout;
|
||||
|
||||
public partial class MainLayout
|
||||
{
|
||||
[CascadingParameter]
|
||||
public ApplicationLayout? ApplicationLayout { get; set; }
|
||||
}
|
10
Manager.App/Components/Layout/MainLayout.razor.css
Normal file
10
Manager.App/Components/Layout/MainLayout.razor.css
Normal file
@@ -0,0 +1,10 @@
|
||||
.page {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
main {
|
||||
flex: 1;
|
||||
}
|
||||
|
9
Manager.App/Components/Layout/NavMenu.razor
Normal file
9
Manager.App/Components/Layout/NavMenu.razor
Normal file
@@ -0,0 +1,9 @@
|
||||
|
||||
<MudNavMenu>
|
||||
<MudText Typo="Typo.h6" Class="px-4">YouTube Import</MudText>
|
||||
<MudDivider Class="my-2"/>
|
||||
<MudNavLink Href="/" Match="NavLinkMatch.Prefix">Home</MudNavLink>
|
||||
<MudNavLink Href="/Accounts" Match="NavLinkMatch.All">Accounts</MudNavLink>
|
||||
<MudNavLink Href="/Library" Match="NavLinkMatch.All">Library</MudNavLink>
|
||||
<MudNavLink Href="/Playlists" Match="NavLinkMatch.All">Playlists</MudNavLink>
|
||||
</MudNavMenu>
|
0
Manager.App/Components/Layout/NavMenu.razor.css
Normal file
0
Manager.App/Components/Layout/NavMenu.razor.css
Normal file
Reference in New Issue
Block a user