feat: 관리자 페이지 모바일 반응형 사이드바 토글 추가

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-30 22:11:00 +09:00
parent 22c9a2f2de
commit fc96b665f5
3 changed files with 84 additions and 18 deletions

View File

@@ -0,0 +1,49 @@
'use client';
import { useState } from 'react';
import AdminSidebar from './AdminSidebar';
export default function AdminShell({ children }: { children: React.ReactNode }) {
const [sidebarOpen, setSidebarOpen] = useState(false);
return (
<div className="flex h-screen bg-slate-950 overflow-hidden">
{/* 모바일 오버레이 */}
{sidebarOpen && (
<div
className="fixed inset-0 z-20 bg-black/60 lg:hidden"
onClick={() => setSidebarOpen(false)}
/>
)}
<AdminSidebar isOpen={sidebarOpen} onClose={() => setSidebarOpen(false)} />
<div className="flex-1 flex flex-col overflow-hidden min-w-0">
{/* 모바일 상단 헤더 */}
<header className="lg:hidden flex items-center justify-between px-4 py-3 bg-slate-900 border-b border-slate-700/60 flex-shrink-0">
<button
onClick={() => setSidebarOpen(true)}
className="p-2 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800 transition"
aria-label="메뉴 열기"
>
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M4 6h16M4 12h16M4 18h16" />
</svg>
</button>
<div className="flex items-center gap-2">
<div className="w-8 h-8 rounded-xl bg-gradient-to-br from-red-500 to-orange-500 flex items-center justify-center text-white font-bold text-sm">
</div>
<span className="text-white font-bold text-sm"> </span>
</div>
<div className="w-9" />
</header>
{/* 메인 스크롤 영역 */}
<main className="flex-1 overflow-y-auto">
{children}
</main>
</div>
</div>
);
}