태블릿 전용 라우트 / 폴더 추가
- routes/tablet.jsx: 태블릿 placeholder - App.jsx: isMobileOnly / isTablet / (그 외=PC) 3단 분기 - components/tablet/, pages/tablet/: 향후 태블릿 전용 컴포넌트·페이지 자리 - features/registry.js: tablet device 지원 (getTabletComponent 추가) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
57715726b8
commit
bc0c2b22f0
5 changed files with 43 additions and 18 deletions
|
|
@ -1,16 +1,10 @@
|
|||
import { BrowserView, MobileView } from 'react-device-detect'
|
||||
import { isMobileOnly, isTablet } from 'react-device-detect'
|
||||
import PCRoutes from './routes/pc'
|
||||
import MobileRoutes from './routes/mobile'
|
||||
import TabletRoutes from './routes/tablet'
|
||||
|
||||
export default function App() {
|
||||
return (
|
||||
<>
|
||||
<BrowserView>
|
||||
<PCRoutes />
|
||||
</BrowserView>
|
||||
<MobileView>
|
||||
<MobileRoutes />
|
||||
</MobileView>
|
||||
</>
|
||||
)
|
||||
if (isMobileOnly) return <MobileRoutes />
|
||||
if (isTablet) return <TabletRoutes />
|
||||
return <PCRoutes />
|
||||
}
|
||||
|
|
|
|||
0
frontend/src/components/tablet/.gitkeep
Normal file
0
frontend/src/components/tablet/.gitkeep
Normal file
|
|
@ -1,18 +1,15 @@
|
|||
/**
|
||||
* 기능 자동 등록 시스템
|
||||
*
|
||||
* - features/{kebab-case}/pc/{PascalCase}.jsx : PC 사용자 페이지
|
||||
* - features/{kebab-case}/pc/{PascalCase}Admin.jsx : PC 관리자 페이지
|
||||
* - features/{kebab-case}/pc/{PascalCase}.jsx : PC 사용자 페이지
|
||||
* - features/{kebab-case}/pc/{PascalCase}Admin.jsx: PC 관리자 페이지
|
||||
* - features/{kebab-case}/tablet/{PascalCase}.jsx : 태블릿 사용자 페이지
|
||||
* - features/{kebab-case}/mobile/{PascalCase}.jsx : 모바일 사용자 페이지
|
||||
*
|
||||
* 예시:
|
||||
* /boss-crystal → features/boss-crystal/pc/BossCrystal.jsx
|
||||
* /admin/boss-crystal → features/boss-crystal/pc/BossCrystalAdmin.jsx
|
||||
*/
|
||||
|
||||
import { lazy } from 'react'
|
||||
|
||||
const pages = import.meta.glob('./*/{pc,mobile}/*.jsx')
|
||||
const pages = import.meta.glob('./*/{pc,tablet,mobile}/*.jsx')
|
||||
|
||||
function slugToPascal(slug) {
|
||||
return slug
|
||||
|
|
@ -23,6 +20,7 @@ function slugToPascal(slug) {
|
|||
|
||||
const userPcCache = new Map()
|
||||
const adminPcCache = new Map()
|
||||
const userTabletCache = new Map()
|
||||
const userMobileCache = new Map()
|
||||
|
||||
function loadCached(cache, slug, device, suffix) {
|
||||
|
|
@ -49,6 +47,13 @@ export function getAdminComponent(slug) {
|
|||
return loadCached(adminPcCache, slug, 'pc', 'Admin')
|
||||
}
|
||||
|
||||
/**
|
||||
* slug에 해당하는 태블릿 사용자 페이지 컴포넌트 반환
|
||||
*/
|
||||
export function getTabletComponent(slug) {
|
||||
return loadCached(userTabletCache, slug, 'tablet', '')
|
||||
}
|
||||
|
||||
/**
|
||||
* slug에 해당하는 모바일 사용자 페이지 컴포넌트 반환
|
||||
*/
|
||||
|
|
|
|||
0
frontend/src/pages/tablet/.gitkeep
Normal file
0
frontend/src/pages/tablet/.gitkeep
Normal file
26
frontend/src/routes/tablet.jsx
Normal file
26
frontend/src/routes/tablet.jsx
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import { Routes, Route } from 'react-router-dom'
|
||||
|
||||
/**
|
||||
* 태블릿 라우트 (placeholder)
|
||||
* 추후 TabletLayout, 기능별 태블릿 페이지 등록 예정
|
||||
*/
|
||||
export default function TabletRoutes() {
|
||||
return (
|
||||
<Routes>
|
||||
<Route
|
||||
path="*"
|
||||
element={
|
||||
<div
|
||||
className="min-h-screen flex items-center justify-center p-6 text-center"
|
||||
style={{ color: 'var(--text-muted)' }}
|
||||
>
|
||||
<div>
|
||||
<div className="text-4xl mb-3 opacity-50">📱</div>
|
||||
<p className="text-sm">태블릿 버전은 준비 중입니다</p>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
</Routes>
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue