fix: remove page transition animations to prevent flashing

AnimatePresence was causing black flash between page transitions.
Removed page-level animations - stagger animations inside pages still work.
This commit is contained in:
c0mrade
2026-02-01 21:48:28 +03:00
parent 5ad5e8d365
commit dda8323b45

View File

@@ -1,7 +1,6 @@
import { useEffect, useState, useCallback, useRef } from 'react';
import { useLocation, useNavigate, Link } from 'react-router-dom';
import { useQuery } from '@tanstack/react-query';
import { AnimatePresence, motion } from 'framer-motion';
import { useTranslation } from 'react-i18next';
import { useAuthStore } from '@/store/auth';
@@ -30,8 +29,6 @@ import { MobileBottomNav } from './MobileBottomNav';
import { AppHeader } from './AppHeader';
import { Aurora } from './Aurora';
import { slideUp, slideUpTransition } from '@/components/motion/transitions';
// Desktop nav icons
const HomeIcon = ({ className }: { className?: string }) => (
<svg
@@ -502,25 +499,7 @@ export function AppShell({ children }: AppShellProps) {
<div className="lg:hidden" style={{ height: headerHeight }} />
{/* Main content */}
<main className="mx-auto max-w-6xl px-4 py-6 pb-28 lg:px-6 lg:pb-8">
{/* Disable animations in admin pages (scroll restoration conflicts with animations) */}
{location.pathname.startsWith('/admin') ? (
children
) : (
<AnimatePresence mode="wait" initial={false}>
<motion.div
key={location.pathname}
variants={slideUp}
initial="initial"
animate="animate"
exit="exit"
transition={slideUpTransition}
>
{children}
</motion.div>
</AnimatePresence>
)}
</main>
<main className="mx-auto max-w-6xl px-4 py-6 pb-28 lg:px-6 lg:pb-8">{children}</main>
{/* Mobile Bottom Navigation */}
<MobileBottomNav