fix: remove bing redirect, fix modal centering across all pages
- 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 <noreply@anthropic.com>
This commit is contained in:
parent
124d0e8ff7
commit
ee8fc85516
@ -73,7 +73,6 @@ function AnimatedRoute({ children, pageName }: { children: React.ReactNode; page
|
|||||||
initial="initial"
|
initial="initial"
|
||||||
animate="animate"
|
animate="animate"
|
||||||
exit="exit"
|
exit="exit"
|
||||||
style={{ willChange: 'transform, opacity' }}
|
|
||||||
>
|
>
|
||||||
<PageErrorBoundary pageName={pageName}>
|
<PageErrorBoundary pageName={pageName}>
|
||||||
{children}
|
{children}
|
||||||
|
|||||||
@ -70,8 +70,6 @@ export function DemoDisclaimerModal() {
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
setIsOpen(false);
|
setIsOpen(false);
|
||||||
setIsClosing(false);
|
setIsClosing(false);
|
||||||
// 跳转到必应
|
|
||||||
window.location.href = 'https://www.bing.com';
|
|
||||||
}, 300);
|
}, 300);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
|
import { createPortal } from 'react-dom';
|
||||||
import { motion, AnimatePresence } from 'framer-motion';
|
import { motion, AnimatePresence } from 'framer-motion';
|
||||||
import { X, ChevronRight, ChevronLeft, CheckCircle, Factory, ClipboardList, Share2, Package } from 'lucide-react';
|
import { X, ChevronRight, ChevronLeft, CheckCircle, Factory, ClipboardList, Share2, Package } from 'lucide-react';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
@ -136,7 +137,7 @@ export function OnboardingGuide({ role, isOpen, onClose }: OnboardingGuideProps)
|
|||||||
// 如果已完成引导或不显示,返回null
|
// 如果已完成引导或不显示,返回null
|
||||||
if (!isOpen || isCompleted) return null;
|
if (!isOpen || isCompleted) return null;
|
||||||
|
|
||||||
return (
|
return createPortal(
|
||||||
<div className="fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-50 p-4">
|
<div className="fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-50 p-4">
|
||||||
<motion.div
|
<motion.div
|
||||||
initial={{ opacity: 0, scale: 0.95, y: 20 }}
|
initial={{ opacity: 0, scale: 0.95, y: 20 }}
|
||||||
@ -244,7 +245,8 @@ export function OnboardingGuide({ role, isOpen, onClose }: OnboardingGuideProps)
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
</div>
|
</div>,
|
||||||
|
document.body
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user