Initial commit: HotelSync PMS v0.1.0
- React 18 + TypeScript + Vite + Tailwind CSS - Шахматка бронирований (drag-to-book) - Страницы: Calendar, Bookings, Rooms, Housekeeping, Channels, API Docs, Settings - Роли: super_admin, hotel_manager, housekeeper - Светлая/тёмная тема - Docker + Nginx конфигурация - Лендинг hotelsync.ru
This commit is contained in:
25
src/layouts/AppLayout.tsx
Normal file
25
src/layouts/AppLayout.tsx
Normal file
@@ -0,0 +1,25 @@
|
||||
import { Outlet, Navigate } from 'react-router-dom'
|
||||
import { useState } from 'react'
|
||||
import { Sidebar } from '../components/layout/Sidebar'
|
||||
import { Topbar } from '../components/layout/Topbar'
|
||||
import { useAuth } from '../contexts/AuthContext'
|
||||
|
||||
export function AppLayout() {
|
||||
const { user } = useAuth()
|
||||
const [sidebarOpen, setSidebarOpen] = useState(false)
|
||||
|
||||
if (!user) return <Navigate to="/login" replace />
|
||||
|
||||
return (
|
||||
<div className="flex h-screen bg-slate-50 dark:bg-slate-900 overflow-hidden">
|
||||
<Sidebar open={sidebarOpen} onClose={() => setSidebarOpen(false)} />
|
||||
|
||||
<div className="flex-1 flex flex-col min-w-0">
|
||||
<Topbar onMenuToggle={() => setSidebarOpen(v => !v)} />
|
||||
<main className="flex-1 overflow-auto">
|
||||
<Outlet />
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user