From 56711f5b591a501dd566bd1715447fa74524c7a2 Mon Sep 17 00:00:00 2001 From: kjuulh Date: Mon, 15 Nov 2021 22:46:14 +0100 Subject: [PATCH] Add project to edit --- src/client/src/pages/todos/[todoId]/index.tsx | 31 ++++++++++++------- .../presentation/contexts/SocketContext.tsx | 2 +- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/src/client/src/pages/todos/[todoId]/index.tsx b/src/client/src/pages/todos/[todoId]/index.tsx index 92e122b..24d8865 100644 --- a/src/client/src/pages/todos/[todoId]/index.tsx +++ b/src/client/src/pages/todos/[todoId]/index.tsx @@ -4,7 +4,7 @@ import { useUpdateTodo, } from "@src/presentation/hooks/socketHooks"; import { Todo } from "@src/core/entities/todo"; -import { FC, useEffect, useState } from "react"; +import { FC, useState } from "react"; import { PageHeading } from "@src/components/common/headings/pageHeading"; import { TodoCheckmark } from "@src/components/todos/todoCheckmark"; @@ -15,6 +15,7 @@ interface EditTodoProps { } const EditTodo: FC = ({ todo, onCancel, onSave }) => { const [todoTitle, setTodoTitle] = useState(todo.title); + const [project, setProject] = useState(todo.project); return (
@@ -26,11 +27,22 @@ const EditTodo: FC = ({ todo, onCancel, onSave }) => { type="text" />
+ +
+ setProject(e.target.value)} + /> +