From a2f89644a69e53a8b391e79a98fff2ab03d045d9 Mon Sep 17 00:00:00 2001 From: caadiq Date: Fri, 9 Jan 2026 18:11:21 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20body.is-pc=20=ED=81=B4=EB=9E=98=EC=8A=A4?= =?UTF-8?q?=20=EA=B8=B0=EB=B0=98=20PC=20CSS=20=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - App.jsx에 PCWrapper 추가하여 PC에서만 body.is-pc 클래스 추가 - pc.css를 body.is-pc 기반으로 변경하여 모바일 영향 없앰 - useEffect import 추가 --- frontend/src/App.jsx | 12 ++++++++++++ frontend/src/pc.css | 21 +++++++++------------ 2 files changed, 21 insertions(+), 12 deletions(-) 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; }