From 9ef979ebd29b16db96b90a04a1ffe7d196ef4fa0 Mon Sep 17 00:00:00 2001 From: CREDO23 Date: Wed, 2 Oct 2024 20:25:06 +0200 Subject: [PATCH] fix dropdowns in 'See plan' modal --- apps/web/lib/components/modal.tsx | 7 +++- .../add-task-estimation-hours-modal.tsx | 41 +++++++++---------- .../features/daily-plan/all-plans-modal.tsx | 7 +++- 3 files changed, 31 insertions(+), 24 deletions(-) diff --git a/apps/web/lib/components/modal.tsx b/apps/web/lib/components/modal.tsx index 33ea9eed9..84985fc01 100644 --- a/apps/web/lib/components/modal.tsx +++ b/apps/web/lib/components/modal.tsx @@ -11,6 +11,7 @@ type Props = { description?: string; isOpen: boolean; closeModal: () => void; + customCloseModal?: () => void; className?: string; alignCloseIcon?: boolean; showCloseIcon?: boolean; @@ -19,6 +20,7 @@ type Props = { export function Modal({ isOpen, closeModal, + customCloseModal, children, title, titleClass, @@ -54,7 +56,10 @@ export function Modal({ {description && {description}} {showCloseIcon && (
{ + closeModal(); + customCloseModal?.(); + }} className={`absolute ${ alignCloseIcon ? 'right-2 top-3' : 'right-3 top-3' } md:right-2 md:top-3 cursor-pointer z-50`} diff --git a/apps/web/lib/features/daily-plan/add-task-estimation-hours-modal.tsx b/apps/web/lib/features/daily-plan/add-task-estimation-hours-modal.tsx index 8914ae272..69a8b0184 100644 --- a/apps/web/lib/features/daily-plan/add-task-estimation-hours-modal.tsx +++ b/apps/web/lib/features/daily-plan/add-task-estimation-hours-modal.tsx @@ -89,13 +89,6 @@ export function AddTasksEstimationHoursModal(props: IAddTasksEstimationHoursModa draft: false, saved: false }); - const isTomorrowPlan = useMemo( - () => - plan && - new Date(moment().add(1, 'days').toDate()).toLocaleDateString('en') == - new Date(plan.date).toLocaleDateString('en'), - [plan] - ); const canStartWorking = useMemo(() => { const isTodayPlan = @@ -260,8 +253,8 @@ export function AddTasksEstimationHoursModal(props: IAddTasksEstimationHoursModa const StartWorkingButton = (