From 012a70313b9c6434dc90666c6b8614c13ecb2854 Mon Sep 17 00:00:00 2001 From: Dejan Date: Wed, 20 Nov 2024 20:04:23 +0100 Subject: [PATCH] - Allowed selecting date when Repeat type is set to "None" - Enabled opening the repeat freq picker with click on the Repeat todo icon --- components/pages/todos/AddChoreDialog.tsx | 26 +++++++++++------------ 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/components/pages/todos/AddChoreDialog.tsx b/components/pages/todos/AddChoreDialog.tsx index d095dc9..6f2aa32 100644 --- a/components/pages/todos/AddChoreDialog.tsx +++ b/components/pages/todos/AddChoreDialog.tsx @@ -106,6 +106,11 @@ const AddChoreDialog = (addChoreDialogProps: IAddChoreDialog) => { }, 500) }, []); + const repeatPickerRef = useRef(); + const showRepeatPicker = () => { + repeatPickerRef.current?.toggleExpandable(true); + } + return ( { )} - + { if (value) { - if (value.toString() == "None") { - setTodo((oldValue) => ({ - ...oldValue, - date: null, - repeatType: "None", - })); - } else { - setTodo((oldValue) => ({ - ...oldValue, - date: new Date(), - repeatType: value.toString(), - })); - } + setTodo((oldValue) => ({ + ...oldValue, + date: new Date(), + repeatType: value.toString(), + })); } }} topBarProps={{title: "Repeat"}}