generated from ludops/ludops-skeleton
feat: repeats default to false
Build and Deploy / build-and-push (push) Successful in 1m22s
Details
Build and Deploy / build-and-push (push) Successful in 1m22s
Details
This commit is contained in:
parent
c5f386490a
commit
f00dff6b26
|
|
@ -11,7 +11,7 @@ export default function CreateTaskForm({ onCreateTask }: CreateTaskFormProps) {
|
|||
const { t } = useLanguage();
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
const [name, setName] = useState('');
|
||||
const [doesRepeat, setDoesRepeat] = useState(true);
|
||||
const [doesRepeat, setDoesRepeat] = useState(false);
|
||||
const [repeatAmount, setRepeatAmount] = useState('1');
|
||||
const [repeatUnit, setRepeatUnit] = useState<'WEEKS' | 'MONTHS' | 'YEARS'>('WEEKS');
|
||||
const [toDoToday, setToDoToday] = useState(true);
|
||||
|
|
@ -26,7 +26,7 @@ export default function CreateTaskForm({ onCreateTask }: CreateTaskFormProps) {
|
|||
doesRepeat,
|
||||
repeatsEvery: doesRepeat ? `${repeatAmount}_${repeatUnit}` : undefined,
|
||||
priority,
|
||||
toDoToday,
|
||||
toDoToday: doesRepeat ? toDoToday : true,
|
||||
};
|
||||
onCreateTask(taskInput);
|
||||
setName('');
|
||||
|
|
@ -106,13 +106,15 @@ export default function CreateTaskForm({ onCreateTask }: CreateTaskFormProps) {
|
|||
</div>
|
||||
)}
|
||||
|
||||
<div className="form-group">
|
||||
<label>{t.toDoRightNow}</label>
|
||||
<div className="btn-group">
|
||||
<button type="button" className={`btn-option${toDoToday ? ' btn-option--active' : ''}`} onClick={() => setToDoToday(true)}>{t.yes}</button>
|
||||
<button type="button" className={`btn-option${!toDoToday ? ' btn-option--active' : ''}`} onClick={() => setToDoToday(false)}>{t.no}</button>
|
||||
{doesRepeat && (
|
||||
<div className="form-group">
|
||||
<label>{t.toDoRightNow}</label>
|
||||
<div className="btn-group">
|
||||
<button type="button" className={`btn-option${toDoToday ? ' btn-option--active' : ''}`} onClick={() => setToDoToday(true)}>{t.yes}</button>
|
||||
<button type="button" className={`btn-option${!toDoToday ? ' btn-option--active' : ''}`} onClick={() => setToDoToday(false)}>{t.no}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="form-group">
|
||||
<label>{t.priority}</label>
|
||||
|
|
|
|||
Loading…
Reference in New Issue