-
Notifications
You must be signed in to change notification settings - Fork 1
feat : todo CRUD 개선 #55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
672d6e6
a0b2e1e
c90c8fa
c0f7b44
16f1a93
75b65f0
c772e56
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,60 +1,42 @@ | ||
| 'use client'; | ||
|
|
||
| import { useState } from 'react'; | ||
| import Card from './Card'; | ||
| import CheckList from './CheckList'; | ||
| import { Todo } from '@/services/home/todoService.service'; | ||
| import TodoContainer from './TodoContainer'; | ||
| import type { Todo } from '@/services/home/todoService.service'; | ||
|
|
||
| interface BottomSectionProps { | ||
| className?: string; | ||
| todos: Todo[]; | ||
| onToggleTodo: (id: string, currentStatus: boolean) => void; | ||
| } | ||
| uid: string; | ||
|
|
||
| // const TODAY_DUMMY = [ | ||
| // { id: 't1', text: 'React Hooks 정리', isChecked: false }, | ||
| // { id: 't2', text: 'GSAP ScrollTrigger 복습', isChecked: true }, | ||
| // { id: 't3', text: '알고리즘 1문제 풀기', isChecked: false }, | ||
| // ]; | ||
| todos: Todo[]; | ||
| loading?: boolean; | ||
| error?: string | null; | ||
|
|
||
| // const UPCOMING_DUMMY = [ | ||
| // { id: 'u1', text: 'Next.js App Router 정리', isChecked: false }, | ||
| // { id: 'u2', text: '포트폴리오 리팩토링', isChecked: false }, | ||
| // ]; | ||
| onToggleTodo: (id: string, currentStatus: boolean) => Promise<void> | void; | ||
| onAddTodo: (text: string) => Promise<void> | void; | ||
| onRemoveTodo: (id: string) => Promise<void> | void; | ||
| onEditTodoText: (id: string, text: string) => Promise<void> | void; | ||
| } | ||
|
|
||
| export default function BottomSection({ | ||
| className, | ||
| uid, | ||
| todos, | ||
| loading, | ||
| error, | ||
| onToggleTodo, | ||
| onAddTodo, | ||
| onRemoveTodo, | ||
| onEditTodoText, | ||
| }: BottomSectionProps) { | ||
| // const [today, setToday] = useState<ChecklistItem[]>(TODAY_DUMMY); | ||
| // const [upcoming, setUpcoming] = useState<ChecklistItem[]>(UPCOMING_DUMMY); | ||
|
|
||
| // const toggleToday = (id: string) => { | ||
| // setToday((prev) => | ||
| // prev.map((it) => | ||
| // it.id === id ? { ...it, isChecked: !it.isChecked } : it | ||
| // ) | ||
| // ); | ||
| // }; | ||
|
|
||
| // const toggleUpcoming = (id: string) => { | ||
| // setUpcoming((prev) => | ||
| // prev.map((it) => | ||
| // it.id === id ? { ...it, isChecked: !it.isChecked } : it | ||
| // ) | ||
| // ); | ||
| // }; | ||
|
|
||
| return ( | ||
| <div className={className}> | ||
| <Card title="오늘 할 일"> | ||
| <CheckList | ||
| items={todos} | ||
| onToggleTodo={onToggleTodo} | ||
| emptyText="오늘 할 일이 없습니다" | ||
| /> | ||
| </Card> | ||
| <div> | ||
| <TodoContainer | ||
| uid={uid} | ||
| todos={todos} | ||
| loading={loading} | ||
| error={error} | ||
| onToggleTodo={onToggleTodo} | ||
| onAddTodo={onAddTodo} | ||
| onRemoveTodo={onRemoveTodo} | ||
| onEditTodoText={onEditTodoText} | ||
| ></TodoContainer> | ||
|
Comment on lines
+30
to
+39
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: find . -name "TodoContainer.tsx" -o -name "TodoContainer.ts" -o -name "TodoContainer.jsx" -o -name "TodoContainer.js" 2>/dev/null | head -20Repository: DeveloperBlog-Devflow/devflow Length of output: 108 🏁 Script executed: cat -n ./components/home/TodoContainer.tsxRepository: DeveloperBlog-Devflow/devflow Length of output: 2482
🤖 Prompt for AI Agents |
||
|
|
||
| {/* <Card title="다가오는 일정"> | ||
| <CheckList | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.