Refactor BottomNav and CommunityPage to enhance community forum integration; update navigation logic for mobile and desktop views. Add new localized strings for community page and system settings, including device information and user prompts.

This commit is contained in:
yangy
2026-05-13 17:42:26 +08:00
parent 5285b886ea
commit b3d3f0edcb
9 changed files with 372 additions and 92 deletions
+16 -15
View File
@@ -2,7 +2,7 @@
BOTTOM NAV — Luxsin X9 Controller (Mobile)
Design: iOS/Android App-style bottom tab bar
5 tabs — labels from locales/bottomNav, language = deviceState.language (同系统页)
- 社区:仅桌面宽屏(lg ≥1024px)显示,手机等小屏隐藏
- 社区:移动端进入 /community 引导复制链接;桌面(lg+)点击仍 window.open 论坛
- Active tab: cyan icon + top indicator bar
- Inactive: muted icon + label
============================================================ */
@@ -54,12 +54,6 @@ export default function BottomNav() {
return (pack.bottomNav ?? localeZh.bottomNav) as BottomNavLocale;
}, [deviceState?.language]);
/** 社区入口仅在桌面级视口显示(与 useIsLgUp / Tailwind lg 一致) */
const visibleNavItems = useMemo(
() => NAV_ITEMS.filter((item) => item.path !== "/community" || isLgUp),
[isLgUp],
);
return (
<nav
className="fixed bottom-0 left-0 right-0 z-50 lg:left-1/2 lg:right-auto lg:w-[min(1180px,calc(100vw-3rem))] lg:-translate-x-1/2"
@@ -73,7 +67,7 @@ export default function BottomNav() {
}}
>
<div className="flex items-stretch justify-around">
{visibleNavItems.map((item) => {
{NAV_ITEMS.map((item) => {
const isActive =
item.path === "/ai"
? location === "/ai" || (isLgUp && aiDrawerOpen)
@@ -132,15 +126,22 @@ export default function BottomNav() {
);
if (item.path === "/community") {
if (isLgUp) {
return (
<button
key={item.path}
type="button"
className="cursor-pointer border-0 bg-transparent p-0 text-inherit outline-none focus-visible:ring-2 focus-visible:ring-[#00FFF6]/40 focus-visible:ring-offset-2 focus-visible:ring-offset-[rgba(10,10,12,0.96)]"
onClick={() => window.open(FORUM_URL, "_blank", "noopener,noreferrer")}
>
{inner}
</button>
);
}
return (
<button
key={item.path}
type="button"
className="cursor-pointer border-0 bg-transparent p-0 text-inherit outline-none focus-visible:ring-2 focus-visible:ring-[#00FFF6]/40 focus-visible:ring-offset-2 focus-visible:ring-offset-[rgba(10,10,12,0.96)]"
onClick={() => window.open(FORUM_URL, "_blank", "noopener,noreferrer")}
>
<Link key={item.path} href={item.path}>
{inner}
</button>
</Link>
);
}