From 0758a15f15dfa92c80aa2754736b0b919e61edf2 Mon Sep 17 00:00:00 2001 From: Dobromir Popov Date: Sat, 6 Jul 2024 22:07:02 +0300 Subject: [PATCH] fix shifts modal after refactoring --- components/publisher/PublisherShiftsModal.js | 2 +- pages/cart/calendar/index.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/publisher/PublisherShiftsModal.js b/components/publisher/PublisherShiftsModal.js index c873d8b..d8d1bd7 100644 --- a/components/publisher/PublisherShiftsModal.js +++ b/components/publisher/PublisherShiftsModal.js @@ -5,7 +5,7 @@ import axiosInstance from 'src/axiosSecure'; const PublisherShiftsModal = ({ publisher, _shifts, onClose, date, onAssignmentChange }) => { - const [shifts, setShifts] = React.useState([_shifts]); + const [shifts, setShifts] = React.useState([..._shifts]); //Refactor ToDo: show the whole month instead of just the current week by showing the shift start time in front of the rows, and show all shifts in the month from the first to the last week in the cell where we show one shift now const monthInfo = common.getMonthDatesInfo(new Date(date)); diff --git a/pages/cart/calendar/index.tsx b/pages/cart/calendar/index.tsx index 8eed9d4..4d74ca1 100644 --- a/pages/cart/calendar/index.tsx +++ b/pages/cart/calendar/index.tsx @@ -882,7 +882,7 @@ export default function CalendarPage({ initialEvents, initialShifts }) { {isModalOpen && ( setIsModalOpen(false)} date={value} onAssignmentChange={handleAssignmentChange}