diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index 8c5ac64..910bcdc 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -1,3 +1,4 @@ +import { useEffect } from 'react'; import { BrowserRouter, Routes, Route } from 'react-router-dom'; import { BrowserView, MobileView } from 'react-device-detect'; @@ -37,11 +38,21 @@ import AdminScheduleBots from './pages/pc/admin/AdminScheduleBots'; import PCLayout from './components/pc/Layout'; import MobileLayout from './components/mobile/Layout'; +// PC 환경에서 body에 클래스 추가하는 래퍼 +function PCWrapper({ children }) { + useEffect(() => { + document.body.classList.add('is-pc'); + return () => document.body.classList.remove('is-pc'); + }, []); + return children; +} + function App() { return ( + {/* 관리자 페이지 (레이아웃 없음) */} } /> @@ -72,6 +83,7 @@ function App() { } /> + diff --git a/frontend/src/pc.css b/frontend/src/pc.css index f11f576..31f49a1 100644 --- a/frontend/src/pc.css +++ b/frontend/src/pc.css @@ -1,14 +1,11 @@ -/* PC 전용 스타일 */ +/* PC 전용 스타일 - body.is-pc 클래스가 있을 때만 적용 */ -/* PC에서만 적용 */ -@media (min-width: 1024px) { - /* PC 항상 스크롤바 공간 확보 - 화면 밀림 방지 */ - html { - overflow-y: scroll; - } - - /* PC 최소 너비 설정 */ - #root { - min-width: 1440px; - } +/* PC 항상 스크롤바 공간 확보 - 화면 밀림 방지 */ +body.is-pc { + overflow-y: scroll; +} + +/* PC 최소 너비 설정 */ +body.is-pc #root { + min-width: 1440px; }