Skip to content

Commit

Permalink
feat: Task 컴포넌트에 blockId prop 추가(#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoonncho committed Mar 2, 2023
1 parent 442b24f commit 9a39a81
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/components/Block/Task/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ import type { Task as TaskType } from '@/types/block'
import useDebounce from '@/hooks/useDebounce'
import { dayBlockAPI } from '@/api'

const Task = ({ isDone, task, taskId }: TaskType) => {
const Task = ({
isDone,
task,
taskId,
blockId,
}: TaskType & { blockId: number }) => {
const [isChecked, setIsChecked] = useState(isDone)
const [taskValue, setTaskValue] = useState<string>('')
const debouncedValue = useDebounce<string>(taskValue, 500)
Expand Down
2 changes: 1 addition & 1 deletion src/components/Block/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ const Block = ({
<AddTaskButton blockId={blockId} />
<div className="mt-6">
{tasks?.map((task) => (
<Task {...task} key={task.taskId} />
<Task key={task.taskId} {...task} blockId={blockId} />
))}
</div>
</div>
Expand Down

0 comments on commit 9a39a81

Please sign in to comment.