diff --git a/client/src/components/templates/ScheduleManagementLayout/ScheduleList/ScheduleItem.tsx b/client/src/components/templates/ScheduleManagementLayout/ScheduleList/ScheduleItem.tsx index 7219da8c..47b94d20 100644 --- a/client/src/components/templates/ScheduleManagementLayout/ScheduleList/ScheduleItem.tsx +++ b/client/src/components/templates/ScheduleManagementLayout/ScheduleList/ScheduleItem.tsx @@ -123,7 +123,7 @@ const ScheduleItem: FC = (props): JSX.Element => {
diff --git a/client/src/pages/schedule-management.tsx b/client/src/pages/schedule-management.tsx index 7eb160c0..fac868c5 100644 --- a/client/src/pages/schedule-management.tsx +++ b/client/src/pages/schedule-management.tsx @@ -25,7 +25,6 @@ import DayButton from '~/components/atoms/Buttons/DayButton' import useEmployeeSchedule from '~/hooks/useEmployeeSchedule' import { customStyles } from '~/utils/customReactSelectStyles' import { IWorkDay } from '~/utils/types/employeeScheduleTypes' -import { shiftSchedule } from '~/utils/constants/shiftSchedule' import ClearButton from '~/components/atoms/Buttons/ClearButton' import ButtonAction from '~/components/atoms/Buttons/ButtonAction' import ApplyToAllModal from '~/components/molecules/ApplyToAllModal' @@ -204,7 +203,6 @@ const ScheduleManagement: NextPage = (): JSX.Element => { } const assignDay = (): void => { - setSelectedShift(shiftSchedule[0]) setValue('scheduleName', EmployeeSchedule?.scheduleName as string) const dayProperties: any = { Monday: { @@ -298,7 +296,6 @@ const ScheduleManagement: NextPage = (): JSX.Element => { const handleReset = (): void => { setErrorMessage('') - setSelectedShift(shiftSchedule[0]) if (!isEmpty(id)) { assignDay() @@ -441,7 +438,9 @@ const ScheduleManagement: NextPage = (): JSX.Element => { ) : (
-

{watch('scheduleName') ?? 'New Schedule'}

+ {!isEmpty(id) && ( +

{watch('scheduleName') ?? 'New Schedule'}

+ )} {!isEmpty(id) && ( <> @@ -471,23 +470,27 @@ const ScheduleManagement: NextPage = (): JSX.Element => { )}
-
-

Schedule Shift:

-
- handleShiftChange(option as ReactSelectOption)} - /> -
-
+ {isEmpty(id) ? ( +
+

Schedule Shift:

+
+ handleShiftChange(option as ReactSelectOption)} + /> +
+
+ ) : ( +
+ )}
{ ) : ( <> - Save + {isEmpty(id) ? 'Save' : 'Update'} )}