2026-01-21 20:18:15 +09:00
|
|
|
import { useEffect } from 'react';
|
|
|
|
|
import { BrowserRouter, Routes, Route } from 'react-router-dom';
|
|
|
|
|
import { BrowserView, MobileView } from 'react-device-detect';
|
2026-01-21 17:54:27 +09:00
|
|
|
|
2026-01-21 20:18:15 +09:00
|
|
|
// 공통 컴포넌트
|
|
|
|
|
import { ScrollToTop } from '@/components/common';
|
2026-01-21 20:11:21 +09:00
|
|
|
|
2026-01-21 20:18:15 +09:00
|
|
|
// PC 레이아웃
|
|
|
|
|
import { Layout as PCLayout } from '@/components/pc';
|
2026-01-21 20:11:21 +09:00
|
|
|
|
2026-01-21 20:18:15 +09:00
|
|
|
// Mobile 레이아웃
|
|
|
|
|
import { Layout as MobileLayout } from '@/components/mobile';
|
2026-01-21 20:11:21 +09:00
|
|
|
|
2026-01-21 20:18:15 +09:00
|
|
|
// 페이지
|
|
|
|
|
import { PCHome, MobileHome } from '@/pages/home';
|
2026-01-21 20:20:17 +09:00
|
|
|
import { PCMembers, MobileMembers } from '@/pages/members';
|
2026-01-22 11:32:43 +09:00
|
|
|
import {
|
|
|
|
|
PCSchedule,
|
|
|
|
|
MobileSchedule,
|
|
|
|
|
PCScheduleDetail,
|
|
|
|
|
MobileScheduleDetail,
|
|
|
|
|
PCBirthday,
|
|
|
|
|
MobileBirthday,
|
|
|
|
|
} from '@/pages/schedule';
|
|
|
|
|
import {
|
|
|
|
|
PCAlbum,
|
|
|
|
|
MobileAlbum,
|
|
|
|
|
PCAlbumDetail,
|
|
|
|
|
MobileAlbumDetail,
|
|
|
|
|
PCTrackDetail,
|
|
|
|
|
MobileTrackDetail,
|
|
|
|
|
PCAlbumGallery,
|
|
|
|
|
MobileAlbumGallery,
|
|
|
|
|
} from '@/pages/album';
|
2026-01-22 12:10:57 +09:00
|
|
|
import { PCNotFound, MobileNotFound } from '@/pages/common';
|
2026-01-21 20:11:21 +09:00
|
|
|
|
2026-01-21 20:18:15 +09:00
|
|
|
/**
|
|
|
|
|
* PC 환경에서 body에 클래스 추가하는 래퍼
|
|
|
|
|
*/
|
|
|
|
|
function PCWrapper({ children }) {
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
document.body.classList.add('is-pc');
|
|
|
|
|
return () => document.body.classList.remove('is-pc');
|
|
|
|
|
}, []);
|
|
|
|
|
return children;
|
|
|
|
|
}
|
2026-01-21 17:11:00 +09:00
|
|
|
|
2026-01-21 20:18:15 +09:00
|
|
|
/**
|
|
|
|
|
* 프로미스나인 팬사이트 메인 앱
|
|
|
|
|
* react-device-detect를 사용한 PC/Mobile 분리
|
|
|
|
|
*/
|
|
|
|
|
function App() {
|
|
|
|
|
return (
|
|
|
|
|
<BrowserRouter future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
|
|
|
|
|
<ScrollToTop />
|
2026-01-21 17:54:27 +09:00
|
|
|
|
2026-01-21 20:18:15 +09:00
|
|
|
{/* PC 뷰 */}
|
|
|
|
|
<BrowserView>
|
|
|
|
|
<PCWrapper>
|
|
|
|
|
<Routes>
|
|
|
|
|
{/* 관리자 페이지 (레이아웃 없음) - 추후 추가 */}
|
|
|
|
|
{/* <Route path="/admin" element={<AdminLogin />} /> */}
|
2026-01-21 18:07:55 +09:00
|
|
|
|
2026-01-21 20:18:15 +09:00
|
|
|
{/* 일반 페이지 (레이아웃 포함) */}
|
|
|
|
|
<Route
|
|
|
|
|
path="/*"
|
|
|
|
|
element={
|
|
|
|
|
<PCLayout>
|
|
|
|
|
<Routes>
|
|
|
|
|
<Route path="/" element={<PCHome />} />
|
2026-01-21 20:20:17 +09:00
|
|
|
<Route path="/members" element={<PCMembers />} />
|
2026-01-22 09:08:30 +09:00
|
|
|
<Route path="/schedule" element={<PCSchedule />} />
|
2026-01-22 11:32:43 +09:00
|
|
|
<Route path="/schedule/:id" element={<PCScheduleDetail />} />
|
|
|
|
|
<Route path="/birthday/:memberName/:year" element={<PCBirthday />} />
|
2026-01-22 09:23:24 +09:00
|
|
|
<Route path="/album" element={<PCAlbum />} />
|
2026-01-22 11:32:43 +09:00
|
|
|
<Route path="/album/:name" element={<PCAlbumDetail />} />
|
|
|
|
|
<Route path="/album/:name/track/:trackTitle" element={<PCTrackDetail />} />
|
|
|
|
|
<Route path="/album/:name/gallery" element={<PCAlbumGallery />} />
|
2026-01-22 12:10:57 +09:00
|
|
|
{/* 404 페이지 */}
|
|
|
|
|
<Route path="*" element={<PCNotFound />} />
|
2026-01-21 20:18:15 +09:00
|
|
|
</Routes>
|
|
|
|
|
</PCLayout>
|
|
|
|
|
}
|
|
|
|
|
/>
|
|
|
|
|
</Routes>
|
|
|
|
|
</PCWrapper>
|
|
|
|
|
</BrowserView>
|
2026-01-21 18:07:55 +09:00
|
|
|
|
2026-01-21 20:18:15 +09:00
|
|
|
{/* Mobile 뷰 */}
|
|
|
|
|
<MobileView>
|
|
|
|
|
<Routes>
|
|
|
|
|
<Route
|
|
|
|
|
path="/"
|
|
|
|
|
element={
|
|
|
|
|
<MobileLayout>
|
|
|
|
|
<MobileHome />
|
|
|
|
|
</MobileLayout>
|
|
|
|
|
}
|
|
|
|
|
/>
|
2026-01-21 20:20:17 +09:00
|
|
|
<Route
|
|
|
|
|
path="/members"
|
|
|
|
|
element={
|
|
|
|
|
<MobileLayout pageTitle="멤버" noShadow>
|
|
|
|
|
<MobileMembers />
|
|
|
|
|
</MobileLayout>
|
|
|
|
|
}
|
|
|
|
|
/>
|
2026-01-22 09:08:30 +09:00
|
|
|
<Route
|
|
|
|
|
path="/schedule"
|
|
|
|
|
element={
|
|
|
|
|
<MobileLayout pageTitle="일정" useCustomLayout>
|
|
|
|
|
<MobileSchedule />
|
|
|
|
|
</MobileLayout>
|
|
|
|
|
}
|
|
|
|
|
/>
|
2026-01-22 11:32:43 +09:00
|
|
|
<Route path="/schedule/:id" element={<MobileScheduleDetail />} />
|
|
|
|
|
<Route path="/birthday/:memberName/:year" element={<MobileBirthday />} />
|
2026-01-22 09:23:24 +09:00
|
|
|
<Route
|
|
|
|
|
path="/album"
|
|
|
|
|
element={
|
|
|
|
|
<MobileLayout pageTitle="앨범">
|
|
|
|
|
<MobileAlbum />
|
|
|
|
|
</MobileLayout>
|
|
|
|
|
}
|
|
|
|
|
/>
|
2026-01-22 11:32:43 +09:00
|
|
|
<Route
|
|
|
|
|
path="/album/:name"
|
|
|
|
|
element={
|
|
|
|
|
<MobileLayout hideHeader>
|
|
|
|
|
<MobileAlbumDetail />
|
|
|
|
|
</MobileLayout>
|
|
|
|
|
}
|
|
|
|
|
/>
|
|
|
|
|
<Route
|
|
|
|
|
path="/album/:name/track/:trackTitle"
|
|
|
|
|
element={
|
|
|
|
|
<MobileLayout pageTitle="곡 상세">
|
|
|
|
|
<MobileTrackDetail />
|
|
|
|
|
</MobileLayout>
|
|
|
|
|
}
|
|
|
|
|
/>
|
|
|
|
|
<Route
|
|
|
|
|
path="/album/:name/gallery"
|
|
|
|
|
element={
|
|
|
|
|
<MobileLayout hideHeader>
|
|
|
|
|
<MobileAlbumGallery />
|
|
|
|
|
</MobileLayout>
|
|
|
|
|
}
|
|
|
|
|
/>
|
2026-01-22 12:10:57 +09:00
|
|
|
{/* 404 페이지 */}
|
|
|
|
|
<Route path="*" element={<MobileNotFound />} />
|
2026-01-21 20:18:15 +09:00
|
|
|
</Routes>
|
|
|
|
|
</MobileView>
|
2026-01-21 17:04:18 +09:00
|
|
|
</BrowserRouter>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default App;
|