변경 전:
components/
├── pc/admin/ (플랫)
├── pc/public/ (플랫)
└── mobile/ (플랫)
변경 후:
components/
├── pc/admin/
│ ├── layout/ (Layout, Header)
│ ├── common/ (ConfirmDialog, DatePicker, TimePicker, NumberPicker)
│ └── schedule/ (AdminScheduleCard, CategorySelector)
├── pc/public/
│ ├── layout/ (Layout, Header, Footer)
│ └── schedule/ (Calendar, ScheduleCard, BirthdayCard, CategoryFilter)
└── mobile/
├── layout/ (Layout, Header, BottomNav)
└── schedule/ (Calendar, ScheduleCard 등)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
25 lines
729 B
JavaScript
25 lines
729 B
JavaScript
/**
|
|
* AdminLayout 컴포넌트
|
|
* 모든 Admin 페이지에서 공통으로 사용하는 레이아웃
|
|
* 헤더 고정 + 본문 스크롤 구조
|
|
*/
|
|
import { useLocation } from 'react-router-dom';
|
|
import Header from './Header';
|
|
|
|
function AdminLayout({ user, children }) {
|
|
const location = useLocation();
|
|
|
|
// 일정 관리 페이지는 내부 스크롤 처리
|
|
const isSchedulePage = location.pathname.includes('/admin/schedule');
|
|
|
|
return (
|
|
<div className="h-screen overflow-hidden flex flex-col bg-gray-50">
|
|
<Header user={user} />
|
|
<main className={`flex-1 min-h-0 ${isSchedulePage ? 'overflow-hidden' : 'overflow-y-auto'}`}>
|
|
{children}
|
|
</main>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default AdminLayout;
|