Skip to content

[AIBE3/1팀/심수민] TODO APP 만들기 완료#27

Open
SWWWin wants to merge 4 commits intosik2:mainfrom
SWWWin:main
Open

[AIBE3/1팀/심수민] TODO APP 만들기 완료#27
SWWWin wants to merge 4 commits intosik2:mainfrom
SWWWin:main

Conversation

@SWWWin
Copy link

@SWWWin SWWWin commented Jul 9, 2025

TODO APP 구현

스크린샷 2025-07-10 오후 8 37 24

next.js, react를 이용하여 만든 우선순위 기반 Todolist 어플리케이션입니다.

기능 요약

  • 할 일 추가: input을 사용하여 할 일 추가
  • 할 일 삭제: x 표시를 눌러 이미 한 일 삭제
  • 할 일 완료: 현재 완료한 할 일 표시
  • 중요도 선택: 할 일의 중요도 표시

디렉터리 구조

src/
└─ app/
   ├─ components/
   │  ├─ TodoItem.tsx
   │  ├─ TodoList.tsx
   │  └─ TodoWriteForm.tsx
   └─ page.tsx

컴포넌트 설명

TodoItem: 개별 할 일 항목을 렌더링하여 체크, 삭제, 우선순위 스타일링
TodoList: 전체 할 일 리스트 순회
TodoWriteForm: 할 일 & 우선순위 작성 후 등록하는 폼

상태 관리 흐름

todos useState 사용
maxId useRef 사용

@SWWWin SWWWin changed the title feat: Todo 프로젝트 초기 커밋 [AIBE3/심수민] TODO APP 만들기 완료 Jul 9, 2025
@SWWWin SWWWin changed the title [AIBE3/심수민] TODO APP 만들기 완료 [AIBE3/1팀/심수민] TODO APP 만들기 완료 Jul 10, 2025
@@ -0,0 +1,59 @@
"use client";
import { FormEvent, useState } from "react";

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FormEvent 타입을 사용해서 onSubmit 이벤트 객체의 타입을 명확히 지정한 점이 좋은 것 같습니다..! 처음 봤어요 사실

Copy link

@kku1403 kku1403 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

코드 잘 봤습니다. 수고 많으셨어요 😀

function TodoList({ todos, deleteTodo, toggleTodo }: Props) {
return (
<ul className="max-w-md mx-auto mt-6 space-y-4 bg-gray-50 rounded-lg p-4 shadow-md">
{todos &&
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todos가 빈 배열이 아니라 아예 null이거나 undefined일 때를 처리하셨네요! 저는 아예 생각도 못했던 부분인데... 와우 👏 또 하나 배워갑니다...

onChange={(e) => setPriority(Number(e.target.value))}
className="border border-gray-300 rounded-md px-3 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-500"
>
<option value="" disabled>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 부분이 무슨 의미지? 싶었는데 드롭박스를 눌렀을 때 우선순위 선택이라는 안내 문구를 보여주면서, 선택은 하지 못하도록 막은 것이었군요. 디테일이 좋네요👍

@Tahee-Park
Copy link

코드 잘 봤습니다. 많이 배워가요~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants