Add Availability Calendar, Modules system, and route refactoring
- Add AvailabilityPage with price grid (categories × dates), drag-select, channel prices, EditPanel, PeriodModal, and rate periods tab - Add ModulesContext with localStorage persistence and dynamic sidebar items - Add ModulesPage with WiFi Auth, Payments, TV Welcome, Smart Locks, OLAP Reports, Website Builder, Booking Widget modules - Add ReportsPage (OLAP analytics with KPI cards, charts, tables) - Add WebsitePage and BookingWidgetPage placeholders - Remove hotel slug from URL routing; hotel context from JWT - Add Доступность nav item in Sidebar under Управление - Fix LoginPage redirects and HotelSync branding Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -5,7 +5,7 @@ import { MOCK_USERS } from '../data/mockData'
|
||||
interface AuthContextValue {
|
||||
session: AuthSession | null
|
||||
user: User | null
|
||||
login: (email: string, password: string) => Promise<boolean>
|
||||
login: (email: string, password: string) => Promise<User | null>
|
||||
logout: () => void
|
||||
}
|
||||
|
||||
@@ -17,15 +17,15 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {
|
||||
return stored ? JSON.parse(stored) : null
|
||||
})
|
||||
|
||||
const login = async (email: string, _password: string): Promise<boolean> => {
|
||||
const login = async (email: string, _password: string): Promise<User | null> => {
|
||||
// Mock authentication — in production, call POST /auth/login
|
||||
await new Promise(r => setTimeout(r, 800))
|
||||
const user = MOCK_USERS.find(u => u.email.toLowerCase() === email.toLowerCase())
|
||||
if (!user) return false
|
||||
if (!user) return null
|
||||
const s: AuthSession = { user, token: 'mock-jwt-token-' + user.id }
|
||||
setSession(s)
|
||||
sessionStorage.setItem('hotelsync-session', JSON.stringify(s))
|
||||
return true
|
||||
return user
|
||||
}
|
||||
|
||||
const logout = () => {
|
||||
|
||||
Reference in New Issue
Block a user