import React, { useState, useEffect, Suspense, lazy, memo } from 'react'; import { FloatingNav } from './components/FloatingNav'; import { Hero } from './components/Hero'; // Lazy load non-critical sections to speed up initial paint const TheShift = lazy(() => import('./components/TheShift').then(m => ({ default: m.TheShift }))); const RevenueAddons = lazy(() => import('./components/RevenueAddons').then(m => ({ default: m.RevenueAddons }))); const Amplifier = lazy(() => import('./components/Amplifier').then(m => ({ default: m.Amplifier }))); const PartnershipTabs = lazy(() => import('./components/PartnershipTabs').then(m => ({ default: m.PartnershipTabs }))); const TechnicalPromise = lazy(() => import('./components/TechnicalPromise').then(m => ({ default: m.TechnicalPromise }))); const StrategyAudit = lazy(() => import('./components/StrategyAudit').then(m => ({ default: m.StrategyAudit }))); // Memoized wrapper for the Hero to prevent re-renders on scroll const MemoHero = memo(Hero); const App: React.FC = () => { const [scrolled, setScrolled] = useState(false); useEffect(() => { let ticking = false; const handleScroll = () => { if (!ticking) { window.requestAnimationFrame(() => { const isScrolled = window.scrollY > 50; setScrolled(prev => prev !== isScrolled ? isScrolled : prev); ticking = false; }); ticking = true; } }; window.addEventListener('scroll', handleScroll, { passive: true }); return () => window.removeEventListener('scroll', handleScroll); }, []); const handleScrollToId = (e: React.MouseEvent, href: string) => { e.preventDefault(); const targetId = href.replace('#', ''); const elem = document.getElementById(targetId); if (elem) { elem.scrollIntoView({ behavior: 'smooth' }); } }; return (
{/* Visual Depth Decor - Flat Gradients (GPU Efficient) */}
LOADING INFRASTRUCTURE...
}>
); }; export default App;