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:
Ho Ngoc Hai
2026-01-19 01:23:09 +07:00
parent d285f1f9eb
commit 37db21fbc0
31 changed files with 3328 additions and 134 deletions

View File

@@ -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);
}
}