From ee8fc8551616d655e42c7508612a0e4ff46951ff Mon Sep 17 00:00:00 2001 From: Chever John Date: Tue, 30 Jun 2026 03:11:25 +0800 Subject: [PATCH] fix: remove bing redirect, fix modal centering across all pages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - DemoDisclaimerModal: remove bing redirect on "稍后再说", just close - App.tsx: remove will-change:transform from AnimatedRoute which created a new containing block and broke fixed positioning for all modals - OnboardingGuide: add Portal as extra safety for centering Co-Authored-By: Claude --- src/App.tsx | 1 - src/components/DemoDisclaimerModal.tsx | 2 -- src/components/OnboardingGuide.tsx | 6 ++++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 6983c2b..9c2f6c2 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -73,7 +73,6 @@ function AnimatedRoute({ children, pageName }: { children: React.ReactNode; page initial="initial" animate="animate" exit="exit" - style={{ willChange: 'transform, opacity' }} > {children} diff --git a/src/components/DemoDisclaimerModal.tsx b/src/components/DemoDisclaimerModal.tsx index 3fa22ab..c49609b 100644 --- a/src/components/DemoDisclaimerModal.tsx +++ b/src/components/DemoDisclaimerModal.tsx @@ -70,8 +70,6 @@ export function DemoDisclaimerModal() { setTimeout(() => { setIsOpen(false); setIsClosing(false); - // 跳转到必应 - window.location.href = 'https://www.bing.com'; }, 300); }; diff --git a/src/components/OnboardingGuide.tsx b/src/components/OnboardingGuide.tsx index 98ec25a..653bc44 100644 --- a/src/components/OnboardingGuide.tsx +++ b/src/components/OnboardingGuide.tsx @@ -1,4 +1,5 @@ import React, { useState, useEffect } from 'react'; +import { createPortal } from 'react-dom'; import { motion, AnimatePresence } from 'framer-motion'; import { X, ChevronRight, ChevronLeft, CheckCircle, Factory, ClipboardList, Share2, Package } from 'lucide-react'; import { useNavigate } from 'react-router-dom'; @@ -136,7 +137,7 @@ export function OnboardingGuide({ role, isOpen, onClose }: OnboardingGuideProps) // 如果已完成引导或不显示,返回null if (!isOpen || isCompleted) return null; - return ( + return createPortal(
- + , + document.body ); }