mirror of
https://github.com/urosran/cally.git
synced 2026-03-10 20:51:42 +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)
|
||||
}, []);
|
||||
|
||||
const repeatPickerRef = useRef();
|
||||
const showRepeatPicker = () => {
|
||||
repeatPickerRef.current?.toggleExpandable(true);
|
||||
}
|
||||
|
||||
return (
|
||||
<Dialog
|
||||
bottom={true}
|
||||
@ -210,26 +215,19 @@ const AddChoreDialog = (addChoreDialogProps: IAddChoreDialog) => {
|
||||
)}
|
||||
</View>
|
||||
<View row centerV>
|
||||
<TodoRepeatIcon />
|
||||
<TodoRepeatIcon onPress={showRepeatPicker}/>
|
||||
<Picker
|
||||
ref={repeatPickerRef}
|
||||
marginL-12
|
||||
placeholder="Select Repeat Type"
|
||||
value={todo?.repeatType}
|
||||
onChange={(value) => {
|
||||
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"}}
|
||||
|
||||
Reference in New Issue
Block a user