Files
han-app/VM1_app/figma/src/app/pages/Root.tsx
T

20 lines
612 B
TypeScript

import { Outlet, useLocation } from 'react-router';
import { Header } from '../components/Header';
export function Root() {
const location = useLocation();
const isChat = location.pathname.startsWith('/chat/');
const isAuth = location.pathname.startsWith('/auth/');
return (
<div className="size-full flex flex-col bg-background">
<div className="w-full max-w-[390px] mx-auto h-full flex flex-col">
{/* Хедер скрываем на чате и экранах авторизации */}
{!isChat && !isAuth && <Header />}
<Outlet />
</div>
</div>
);
}