diff --git a/src/components/Navbars/HomeNavbar.js b/src/components/Navbars/HomeNavbar.js index d52ecc20..63d37692 100644 --- a/src/components/Navbars/HomeNavbar.js +++ b/src/components/Navbars/HomeNavbar.js @@ -44,11 +44,6 @@ import { DesktopNav, MoreMenu, PersonalCenterMenu } from './components/Navigatio // Phase 5 优化: 提取的移动端抽屉菜单组件 import { MobileDrawer } from './components/MobileDrawer'; -// Phase 6 优化: 提取的功能菜单组件和自定义 Hooks -import { WatchlistMenu, FollowingEventsMenu } from './components/FeatureMenus'; -import { useWatchlist } from '../../hooks/useWatchlist'; -import { useFollowingEvents } from '../../hooks/useFollowingEvents'; - // Phase 7 优化: 提取的资料完整性、右侧功能区组件 import ProfileCompletenessAlert from './components/ProfileCompletenessAlert'; import { useProfileCompleteness } from '../../hooks/useProfileCompleteness'; @@ -96,11 +91,6 @@ export default function HomeNavbar() { return user.nickname || user.username || user.name || user.email || '用户'; }; - // Phase 6: 自选股和关注事件逻辑已提取到自定义 Hooks - const { watchlistQuotes, followingEvents } = useWatchlist(); - const { followingEvents: events } = useFollowingEvents(); - // 注意:这里只需要数据用于 TabletUserMenu,实际的菜单组件会自己管理状态 - // Phase 7: 资料完整性逻辑已提取到 useProfileCompleteness Hook const { profileCompleteness, @@ -174,8 +164,6 @@ export default function HomeNavbar() { isMobile={isMobile} onMenuOpen={onOpen} handleLogout={handleLogout} - watchlistQuotes={watchlistQuotes} - followingEvents={followingEvents} /> diff --git a/src/components/Navbars/components/NavbarActions/index.js b/src/components/Navbars/components/NavbarActions/index.js index 0e804f1a..0994252b 100644 --- a/src/components/Navbars/components/NavbarActions/index.js +++ b/src/components/Navbars/components/NavbarActions/index.js @@ -7,7 +7,6 @@ import { Menu } from 'lucide-react'; // import ThemeToggleButton from '../ThemeToggleButton'; // ❌ 已删除 - 不再支持深色模式切换 import LoginButton from '../LoginButton'; import CalendarButton from '../CalendarButton'; -import { WatchlistMenu, FollowingEventsMenu } from '../FeatureMenus'; import { DesktopUserMenu, TabletUserMenu } from '../UserMenu'; import { PersonalCenterMenu, MoreMenu } from '../Navigation'; @@ -24,8 +23,6 @@ import { PersonalCenterMenu, MoreMenu } from '../Navigation'; * @param {boolean} props.isMobile - 是否为移动端 * @param {Function} props.onMenuOpen - 打开移动端抽屉菜单的回调 * @param {Function} props.handleLogout - 登出回调 - * @param {Array} props.watchlistQuotes - 自选股数据(用于 TabletUserMenu) - * @param {Array} props.followingEvents - 关注事件数据(用于 TabletUserMenu) */ const NavbarActions = memo(({ isLoading, @@ -35,9 +32,7 @@ const NavbarActions = memo(({ isTablet, isMobile, onMenuOpen, - handleLogout, - watchlistQuotes, - followingEvents + handleLogout }) => { return ( @@ -56,12 +51,6 @@ const NavbarActions = memo(({ {/* 投资日历 - 仅大屏显示 */} {isDesktop && } - {/* 自选股 - 仅大屏显示 */} - {isDesktop && } - - {/* 关注的事件 - 仅大屏显示 */} - {isDesktop && } - {/* 头像区域 - 响应式 */} {isDesktop ? ( @@ -69,8 +58,6 @@ const NavbarActions = memo(({ )} diff --git a/src/components/Navbars/components/UserMenu/TabletUserMenu.js b/src/components/Navbars/components/UserMenu/TabletUserMenu.js index 9cca6165..70f1d032 100644 --- a/src/components/Navbars/components/UserMenu/TabletUserMenu.js +++ b/src/components/Navbars/components/UserMenu/TabletUserMenu.js @@ -11,7 +11,6 @@ import { Box, Text, Badge, - Flex, useColorModeValue } from '@chakra-ui/react'; import { Star, Calendar, User, Settings, Home, LogOut, Crown } from 'lucide-react'; @@ -26,14 +25,10 @@ import { useSubscription } from '../../../../hooks/useSubscription'; * @param {Object} props * @param {Object} props.user - 用户信息 * @param {Function} props.handleLogout - 退出登录回调 - * @param {Array} props.watchlistQuotes - 自选股列表 - * @param {Array} props.followingEvents - 自选事件列表 */ const TabletUserMenu = memo(({ user, - handleLogout, - watchlistQuotes, - followingEvents + handleLogout }) => { const navigate = useNavigate(); const { subscriptionInfo } = useSubscription(); @@ -101,22 +96,12 @@ const TabletUserMenu = memo(({ {/* 自选股 */} } onClick={() => navigate('/home/center')}> - - 我的自选股 - {watchlistQuotes && watchlistQuotes.length > 0 && ( - {watchlistQuotes.length} - )} - + 我的自选股 {/* 自选事件 */} } onClick={() => navigate('/home/center')}> - - 我的自选事件 - {followingEvents && followingEvents.length > 0 && ( - {followingEvents.length} - )} - + 我的自选事件