mirror of
https://github.com/urosran/cally.git
synced 2026-10-23 09:57:55 +00:00
- Allowed selecting date when Repeat type is set to "None"
- Enabled opening the repeat freq picker with click on the Repeat todo icon
This commit is contained in:
@@ -106,6 +106,11 @@ const AddChoreDialog = (addChoreDialogProps: IAddChoreDialog) => {
|
|||||||
}, 500)
|
}, 500)
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
const repeatPickerRef = useRef();
|
||||||
|
const showRepeatPicker = () => {
|
||||||
|
repeatPickerRef.current?.toggleExpandable(true);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog
|
<Dialog
|
||||||
bottom={true}
|
bottom={true}
|
||||||
@@ -210,26 +215,19 @@ const AddChoreDialog = (addChoreDialogProps: IAddChoreDialog) => {
|
|||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
<View row centerV>
|
<View row centerV>
|
||||||
<TodoRepeatIcon />
|
<TodoRepeatIcon onPress={showRepeatPicker}/>
|
||||||
<Picker
|
<Picker
|
||||||
|
ref={repeatPickerRef}
|
||||||
marginL-12
|
marginL-12
|
||||||
placeholder="Select Repeat Type"
|
placeholder="Select Repeat Type"
|
||||||
value={todo?.repeatType}
|
value={todo?.repeatType}
|
||||||
onChange={(value) => {
|
onChange={(value) => {
|
||||||
if (value) {
|
if (value) {
|
||||||
if (value.toString() == "None") {
|
setTodo((oldValue) => ({
|
||||||
setTodo((oldValue) => ({
|
...oldValue,
|
||||||
...oldValue,
|
date: new Date(),
|
||||||
date: null,
|
repeatType: value.toString(),
|
||||||
repeatType: "None",
|
}));
|
||||||
}));
|
|
||||||
} else {
|
|
||||||
setTodo((oldValue) => ({
|
|
||||||
...oldValue,
|
|
||||||
date: new Date(),
|
|
||||||
repeatType: value.toString(),
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
topBarProps={{title: "Repeat"}}
|
topBarProps={{title: "Repeat"}}
|
||||||
|
|||||||
Reference in New Issue
Block a user