e.stopPropagation()}>
diff --git a/management-dashboard-web-app/src/components/ScheduleModal.tsx b/management-dashboard-web-app/src/components/ScheduleModal.tsx
index 2cd7133..1539882 100755
--- a/management-dashboard-web-app/src/components/ScheduleModal.tsx
+++ b/management-dashboard-web-app/src/components/ScheduleModal.tsx
@@ -94,7 +94,7 @@ export function ScheduleModal({ experiment, onClose, onScheduleUpdated }: Schedu
return (
e.stopPropagation()}>
diff --git a/management-dashboard-web-app/src/components/Scheduling.tsx b/management-dashboard-web-app/src/components/Scheduling.tsx
index 81e14dd..4ebbc4e 100644
--- a/management-dashboard-web-app/src/components/Scheduling.tsx
+++ b/management-dashboard-web-app/src/components/Scheduling.tsx
@@ -362,52 +362,40 @@ function AvailabilityCalendar({ user }: { user: User }) {
}
])
- const [selectedDate, setSelectedDate] = useState(null)
- const [showTimeSlotForm, setShowTimeSlotForm] = useState(false)
- const [newTimeSlot, setNewTimeSlot] = useState({
- startTime: '09:00',
- endTime: '17:00',
- title: 'Available'
+ const [selectedDate, setSelectedDate] = useState(null)
+ const [showTimeSlotForm, setShowTimeSlotForm] = useState(false)
+ const [newTimeSlot, setNewTimeSlot] = useState({
+ startTime: '09:00',
+ endTime: '17:00'
+ })
+ const [currentView, setCurrentView] = useState(Views.MONTH)
+
+ const eventStyleGetter = (event: CalendarEvent) => {
+ return {
+ style: {
+ backgroundColor: '#10b981', // green-500 for available
+ borderColor: '#10b981',
+ color: 'white',
+ borderRadius: '4px',
+ border: 'none',
+ display: 'block'
+ }
+ }
+ }
+
+ const handleSelectSlot = ({ start, end }: { start: Date; end: Date }) => {
+ // Set the selected date and show the time slot form
+ setSelectedDate(start)
+ setShowTimeSlotForm(true)
+
+ // Pre-fill the form with the selected time range
+ const startTime = moment(start).format('HH:mm')
+ const endTime = moment(end).format('HH:mm')
+ setNewTimeSlot({
+ startTime,
+ endTime
})
-
- const eventStyleGetter = (event: CalendarEvent) => {
- let backgroundColor = '#3174ad'
- let borderColor = '#3174ad'
-
- if (event.resource === 'available') {
- backgroundColor = '#10b981' // green-500
- borderColor = '#10b981'
- } else if (event.resource === 'unavailable') {
- backgroundColor = '#ef4444' // red-500
- borderColor = '#ef4444'
- }
-
- return {
- style: {
- backgroundColor,
- borderColor,
- color: 'white',
- borderRadius: '4px',
- border: 'none',
- display: 'block'
- }
- }
- }
-
- const handleSelectSlot = ({ start, end }: { start: Date; end: Date }) => {
- // Set the selected date and show the time slot form
- setSelectedDate(start)
- setShowTimeSlotForm(true)
-
- // Pre-fill the form with the selected time range
- const startTime = moment(start).format('HH:mm')
- const endTime = moment(end).format('HH:mm')
- setNewTimeSlot({
- startTime,
- endTime,
- title: 'Available'
- })
- }
+ }
const handleSelectEvent = (event: CalendarEvent) => {
if (window.confirm('Do you want to remove this availability?')) {
@@ -495,10 +483,35 @@ function AvailabilityCalendar({ user }: { user: User }) {
- {/* Time Slot Form Modal */}
- {showTimeSlotForm && selectedDate && (
-