diff --git a/components/top-navbar.tsx b/components/top-navbar.tsx index 77f85150c..f51ab693f 100644 --- a/components/top-navbar.tsx +++ b/components/top-navbar.tsx @@ -6,6 +6,7 @@ import { Settings, ExternalLink, Briefcase, Images, Sparkles, Trophy, Building2, import { Button } from "@/components/ui/button"; import { useTheme } from "next-themes"; import { useState, useEffect, useRef } from "react"; +import { createPortal } from "react-dom"; import { DropdownMenu, DropdownMenuContent, @@ -152,7 +153,7 @@ export function TopNavbar({ setEditorImageUrl(""); }; - return ( + const navContent = ( + ); - {/* 功能教程弹窗 - 全屏居中 */} - {showTutorialModal && currentTutorialVideo && ( -
{ + setShowTutorialModal(false); + setCurrentTutorialVideo(null); + }} + > +
e.stopPropagation()} + > + {/* 关闭按钮 */} + - - {/* 标题 */} -

{currentTutorialVideo.title}

- - {/* 视频播放器 */} - {currentTutorialVideo.videoUrl.includes('youtube.com') || currentTutorialVideo.videoUrl.includes('youtu.be') ? ( - // YouTube 嵌入 - 启用自动播放和性能优化 -
-