diff --git a/frontend-web/public/runtime-config.js b/frontend-web/public/runtime-config.js index 371d1694..27b50ee4 100644 --- a/frontend-web/public/runtime-config.js +++ b/frontend-web/public/runtime-config.js @@ -13,6 +13,8 @@ window.__CM_RUNTIME_CONFIG__ = { // 也可以把下方图片地址改为其他 PNG 地址,无需重新打包。 // 是否显示整块欢迎页图标区域:"true" 显示,"false" 隐藏,默认隐藏。 VITE_WELCOME_LOGO_VISIBLE: "false", + // 深色主题顶栏 Logo 位置:"center" 显示在中间,"left" 显示在左上角,默认中间。 + VITE_DARK_LOGO_POSITION: "center", // 红白主题的顶栏系统 Logo 图片地址。 VITE_BRAND_LOGO_LIGHT_URL: "brand-assets/brand-logo-light.png", // 浅蓝主题的顶栏系统 Logo 图片地址。 diff --git a/frontend-web/src/strategy-components/Header.tsx b/frontend-web/src/strategy-components/Header.tsx index e132de1e..cd102e60 100644 --- a/frontend-web/src/strategy-components/Header.tsx +++ b/frontend-web/src/strategy-components/Header.tsx @@ -14,6 +14,7 @@ import { getStoredAuth } from "@/core/auth"; import { useLiveAccount } from "@/core/auth/use-live-account"; import { getHeaderBrandAsset, getHeaderBrandFallback } from "@/core/branding/brand-assets"; import { isWujieEnv } from "@/core/embed/wujie"; +import { readRuntimeEnv } from "@/env"; import { useUnreadCount } from "@/core/notifications"; import { useMyPosition } from "@/core/positions"; import { @@ -47,6 +48,9 @@ type HeaderProps = { const Header = ({ collapsed }: HeaderProps) => { const { theme } = useTheme(); const isDark = theme === "dark"; + const darkLogoPosition = + readRuntimeEnv("VITE_DARK_LOGO_POSITION") === "left" ? "left" : "center"; + const isDarkLogoOnLeft = darkLogoPosition === "left"; const brandTheme = theme; const configuredBrandLogo = getHeaderBrandAsset(brandTheme); const fallbackBrandLogo = getHeaderBrandFallback(brandTheme); @@ -239,19 +243,26 @@ const Header = ({ collapsed }: HeaderProps) => { {showTopNav ? ( <> {/* 左分区(flex-1):菜单靠右贴近中间基座 */} -
-
- -
+
+ {isDarkLogoOnLeft && ( +
+ +
+ )}