- Added Daily repeat type for the todos and implemented creating and updating this kinds of todos

This commit is contained in:
Dejan
2024-11-10 18:00:17 +01:00
parent 7da8005fb1
commit 5b80a3ba80
4 changed files with 32 additions and 6 deletions

View File

@ -1,5 +1,5 @@
import { createContext, FC, ReactNode, useContext, useState } from "react";
import {IToDo} from "@/hooks/firebase/types/todoData";
import {IToDo, REPEAT_TYPE} from "@/hooks/firebase/types/todoData";
import {useGetTodos} from "@/hooks/firebase/useGetTodos";
import {useCreateTodo} from "@/hooks/firebase/useCreateTodo";
import {useUpdateTodo} from "@/hooks/firebase/useUpdateTodo";
@ -83,10 +83,11 @@ const initialTodosList = [
];
export const repeatOptions = [
{ label: "None", value: "None" },
{ label: "Every week", value: "Every week" },
{ label: "Once a month", value: "Once a month" },
{ label: "Once a year", value: "Once a year" },
{ label: REPEAT_TYPE.NONE, value: REPEAT_TYPE.NONE },
{ label: REPEAT_TYPE.DAILY, value: REPEAT_TYPE.DAILY},
{ label: REPEAT_TYPE.EVERY_WEEK, value: REPEAT_TYPE.EVERY_WEEK },
{ label: REPEAT_TYPE.ONCE_A_MONTH, value: REPEAT_TYPE.ONCE_A_MONTH },
{ label: REPEAT_TYPE.ONCE_A_YEAR, value: REPEAT_TYPE.ONCE_A_YEAR },
];
interface IToDosContext {