- AdminShell: 로그인 페이지에서 사이드바 렌더링 제거 (usePathname 조건 분기) - 로그인 페이지: 프로덕션 노출 힌트 텍스트 제거 - 마케팅 에셋: SVG → PNG 브라우저 Canvas 직접 변환 버튼 추가 (폰트 깨짐 해결) - .claude/commands/: AI 에이전트 팀 슬래시 커맨드 6종 추가 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
57 lines
2.0 KiB
TypeScript
57 lines
2.0 KiB
TypeScript
'use client';
|
|
|
|
import { useState } from 'react';
|
|
import { usePathname } from 'next/navigation';
|
|
import AdminSidebar from './AdminSidebar';
|
|
|
|
export default function AdminShell({ children }: { children: React.ReactNode }) {
|
|
const pathname = usePathname();
|
|
const [sidebarOpen, setSidebarOpen] = useState(false);
|
|
|
|
// 로그인 페이지는 사이드바 없이 독립 렌더링
|
|
if (pathname === '/admin/login') {
|
|
return <>{children}</>;
|
|
}
|
|
|
|
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>
|
|
);
|
|
}
|