From 92aa83cb71853894cdb0cd8d99668951e86e371f Mon Sep 17 00:00:00 2001 From: riverLethe <865192079@qq.com> Date: Sun, 28 Sep 2025 14:19:29 +0800 Subject: [PATCH] feat/ui-1.0.2:when about page content is empty,need to hide about navigation --- .../src/components/theme/AboutThemeSelector.tsx | 8 ++++++++ .../components/theme/ProductDetailThemeSelector.tsx | 13 ++++++++++++- frontend/src/components/theme/Theme.const.ts | 4 ---- frontend/src/components/theme/ThemeSelector.tsx | 8 ++++++++ 4 files changed, 28 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/theme/AboutThemeSelector.tsx b/frontend/src/components/theme/AboutThemeSelector.tsx index 537abd8..5dad0e8 100644 --- a/frontend/src/components/theme/AboutThemeSelector.tsx +++ b/frontend/src/components/theme/AboutThemeSelector.tsx @@ -17,6 +17,14 @@ export const AboutThemeSelector: React.FC = () => { const currentTheme = platformConfig.theme || Theme.DEFAULT; const navigationItems = [ ...NavigationItems, + ...(platformConfig.about_page + ? [ + { + label: "About", + href: "/about", + }, + ] + : []), ...topNavigation.map((item) => ({ label: item.title, href: item.link, diff --git a/frontend/src/components/theme/ProductDetailThemeSelector.tsx b/frontend/src/components/theme/ProductDetailThemeSelector.tsx index 2094080..71572d1 100644 --- a/frontend/src/components/theme/ProductDetailThemeSelector.tsx +++ b/frontend/src/components/theme/ProductDetailThemeSelector.tsx @@ -36,6 +36,14 @@ export const ProductDetailThemeSelector: React.FC< const { t } = useTranslation(); const navigationItems = [ ...NavigationItems, + ...(platformConfig.about_page + ? [ + { + label: "About", + href: "/about", + }, + ] + : []), ...topNavigation.map((item) => ({ label: item.title, href: item.link, @@ -45,7 +53,10 @@ export const ProductDetailThemeSelector: React.FC< useEffect(() => { if (url || !product.slug_name) return; setUrl( - `${mcpServerPrefix || `${window.location.protocol}//${window.location.hostname}:8002`}/mcp/${product.slug_name}` + `${ + mcpServerPrefix || + `${window.location.protocol}//${window.location.hostname}:8002` + }/mcp/${product.slug_name}` ); }, [product.slug_name]); function sanitizeMCPServerName(rawName: string | undefined): string { diff --git a/frontend/src/components/theme/Theme.const.ts b/frontend/src/components/theme/Theme.const.ts index ef95f52..24a7804 100644 --- a/frontend/src/components/theme/Theme.const.ts +++ b/frontend/src/components/theme/Theme.const.ts @@ -5,8 +5,4 @@ export const NavigationItems: NavigationItem[] = [ label: "Home", href: "/", }, - { - label: "About", - href: "/about", - }, ]; diff --git a/frontend/src/components/theme/ThemeSelector.tsx b/frontend/src/components/theme/ThemeSelector.tsx index e0c7ef1..3c9f629 100644 --- a/frontend/src/components/theme/ThemeSelector.tsx +++ b/frontend/src/components/theme/ThemeSelector.tsx @@ -38,6 +38,14 @@ export const ThemeSelector: React.FC = ({ const currentTheme = platformConfig.theme || Theme.DEFAULT; const navigationItems = [ ...NavigationItems, + ...(platformConfig.about_page + ? [ + { + label: "About", + href: "/about", + }, + ] + : []), ...topNavigation.map((item) => ({ label: item.title, href: item.link,