Enhance scheduling features in management dashboard
- Added new scheduling functionality with a dedicated Scheduling component to manage availability and experiment scheduling. - Integrated react-big-calendar for visual calendar representation of availability slots. - Updated Dashboard and DashboardLayout components to handle current route and pass it to child components. - Implemented route handling for scheduling sub-routes to improve user navigation. - Added new dependencies: moment and react-big-calendar for date handling and calendar UI. - Improved user experience with dynamic URL updates based on selected scheduling views.
This commit is contained in:
@@ -99,6 +99,20 @@ function App() {
|
||||
return match ? `camera${match[1]}` : null
|
||||
}
|
||||
|
||||
// Check if current route is a scheduling sub-route
|
||||
const isSchedulingRoute = (route: string) => {
|
||||
return route.startsWith('/scheduling')
|
||||
}
|
||||
|
||||
// Extract scheduling sub-route
|
||||
const getSchedulingSubRoute = (route: string) => {
|
||||
if (route === '/scheduling') {
|
||||
return 'main'
|
||||
}
|
||||
const match = route.match(/^\/scheduling\/(.+)$/)
|
||||
return match ? match[1] : 'main'
|
||||
}
|
||||
|
||||
if (loading) {
|
||||
return (
|
||||
<div className="min-h-screen flex items-center justify-center bg-gray-50">
|
||||
@@ -133,7 +147,7 @@ function App() {
|
||||
return (
|
||||
<>
|
||||
{isAuthenticated ? (
|
||||
<Dashboard onLogout={handleLogout} />
|
||||
<Dashboard onLogout={handleLogout} currentRoute={currentRoute} />
|
||||
) : (
|
||||
<Login onLoginSuccess={handleLoginSuccess} />
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user