fix: remove dropdown title, improve video modal centering
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Your Name 2026-01-31 21:48:10 +08:00
parent 9653f47560
commit f8b5de0aaf

View File

@ -276,9 +276,6 @@ export function TopNavbar({
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end" className="w-[320px] p-2">
<div className="text-sm font-medium text-muted-foreground mb-2 px-2">
选择教程视频
</div>
<div className="space-y-1 max-h-[400px] overflow-y-auto">
{tutorialVideos
.sort((a, b) => a.order - b.order)
@ -450,33 +447,34 @@ export function TopNavbar({
/>
)}
{/* 功能教程弹窗 */}
{/* 功能教程弹窗 - 全屏居中 */}
{showTutorialModal && currentTutorialVideo && (
<div
className="fixed inset-0 z-[100] flex items-center justify-center bg-black/90 p-4"
className="fixed top-0 left-0 right-0 bottom-0 z-[9999] flex items-center justify-center bg-black/95"
style={{ margin: 0, padding: 0 }}
onClick={() => {
setShowTutorialModal(false);
setCurrentTutorialVideo(null);
}}
>
<div
className="relative w-full max-w-5xl max-h-[90vh] flex flex-col"
className="relative w-[90vw] max-w-[1200px] mx-auto"
onClick={(e) => e.stopPropagation()}
>
{/* 标题和关闭按钮 */}
<div className="flex items-center justify-between mb-4">
<h3 className="text-white text-lg font-medium">{currentTutorialVideo.title}</h3>
<button
onClick={() => {
setShowTutorialModal(false);
setCurrentTutorialVideo(null);
}}
className="text-white hover:text-gray-300 transition-colors"
title="关闭"
>
<X className="h-8 w-8" />
</button>
</div>
{/* 关闭按钮 - 右上角 */}
<button
onClick={() => {
setShowTutorialModal(false);
setCurrentTutorialVideo(null);
}}
className="absolute -top-12 right-0 text-white hover:text-gray-300 transition-colors z-10"
title="关闭"
>
<X className="h-10 w-10" />
</button>
{/* 标题 */}
<h3 className="text-white text-xl font-medium mb-4 text-center">{currentTutorialVideo.title}</h3>
{/* 视频播放器 */}
{currentTutorialVideo.videoUrl.includes('youtube.com') || currentTutorialVideo.videoUrl.includes('youtu.be') ? (