import React, { useEffect } from 'react'; import { Routes, Route, useLocation } from 'react-router-dom'; import { AnimatePresence, motion } from 'framer-motion'; import DeviceLayout, { useIsMobile } from './components/DeviceLayout'; import Sidebar from './components/Sidebar'; import ServerDetail from './pages/ServerDetail'; import WorldsPage from './pages/WorldsPage'; import PlayersPage from './pages/PlayersPage'; import PlayerStatsPage from './pages/PlayerStatsPage'; import WorldMapPage from './pages/WorldMapPage'; // 페이지 전환 애니메이션 래퍼 컴포넌트 const PageWrapper = ({ children }) => ( {children} ); function App() { const isMobile = useIsMobile(); const location = useLocation(); // 라우트 전환 시 스크롤 맨 위로 useEffect(() => { window.scrollTo(0, 0); }, [location.pathname]); return (
{/* 사이드바 + 메인 콘텐츠 레이아웃 */}
{/* 메인 콘텐츠 영역 */}
} /> } /> } /> } /> } />
); } export default App;