fromis_9/frontend-temp/src/components/pc/Layout.jsx

38 lines
1 KiB
React
Raw Normal View History

import { useLocation } from 'react-router-dom';
import Header from './Header';
import Footer from './Footer';
import '@/pc.css';
/**
* PC 레이아웃 컴포넌트
*/
function Layout({ children }) {
const location = useLocation();
// Footer 숨김 페이지 (화면 고정 레이아웃)
const hideFooterPages = ['/schedule', '/members', '/album', '/birthday'];
const hideFooter = hideFooterPages.some(
(path) =>
location.pathname === path || location.pathname.startsWith(path + '/')
);
// 일정 페이지에서는 스크롤바도 숨김 (내부에서 자체 스크롤 처리)
const isSchedulePage = location.pathname === '/schedule';
return (
<div className="h-screen overflow-hidden flex flex-col">
<Header />
<main
className={`flex-1 min-h-0 flex flex-col ${
isSchedulePage ? 'overflow-hidden' : 'overflow-y-auto'
}`}
>
<div className="flex-1 flex flex-col">{children}</div>
{!hideFooter && <Footer />}
</main>
</div>
);
}
export default Layout;