feat: Implement Zalo and MktX services with API controllers, add web client pages for Auth and Products, and update client navigation and styling.
This commit is contained in:
@@ -1,16 +1,60 @@
|
||||
@inherits LayoutComponentBase
|
||||
<div class="page">
|
||||
<div class="sidebar">
|
||||
@inject IJSRuntime JS
|
||||
|
||||
@*
|
||||
EN: Main layout with sidebar navigation and theme toggle.
|
||||
VI: Layout chính với sidebar navigation và theme toggle.
|
||||
*@
|
||||
|
||||
<div class="page" data-theme="@currentTheme">
|
||||
<aside class="sidebar">
|
||||
<NavMenu />
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<main>
|
||||
<div class="top-row px-4">
|
||||
<a href="https://learn.microsoft.com/aspnet/core/" target="_blank">About</a>
|
||||
</div>
|
||||
<header class="top-row">
|
||||
<button class="theme-toggle" @onclick="ToggleTheme" title="Toggle theme / Đổi theme">
|
||||
@if (currentTheme == "dark")
|
||||
{
|
||||
<span>☀️ Light</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span>🌙 Dark</span>
|
||||
}
|
||||
</button>
|
||||
</header>
|
||||
|
||||
<article class="content px-4">
|
||||
<article class="content">
|
||||
@Body
|
||||
</article>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
private string currentTheme = "light";
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if (firstRender)
|
||||
{
|
||||
// EN: Load saved theme from localStorage
|
||||
// VI: Tải theme đã lưu từ localStorage
|
||||
var savedTheme = await JS.InvokeAsync<string>("localStorage.getItem", "theme");
|
||||
if (!string.IsNullOrEmpty(savedTheme))
|
||||
{
|
||||
currentTheme = savedTheme;
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private async Task ToggleTheme()
|
||||
{
|
||||
currentTheme = currentTheme == "dark" ? "light" : "dark";
|
||||
|
||||
// EN: Save theme to localStorage
|
||||
// VI: Lưu theme vào localStorage
|
||||
await JS.InvokeVoidAsync("localStorage.setItem", "theme", currentTheme);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user