Skip to content
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

[FEAT] 모달에 정보 연결하기 #147

Merged
merged 10 commits into from
Jul 17, 2024
Merged

Conversation

wrryu09
Copy link
Member

@wrryu09 wrryu09 commented Jul 16, 2024

작업 내용 🧑‍💻

  • 모달과 데이트피커 날짜, 시간 정보를 연결했습니다

리뷰 요구사항 💬

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요

  • Modal 컴포넌트에 taskId를 props 로 받게 해주어서 상세정보 요청을 taskId로 하시면 됩니다! 임시로 5로 박아둔 상태고 나중에 값 연결할 때 데이터 형식 잘 확인하고 연결하면 될 것 같아요

  • 타입 관리를 용이하게 하기 위해서 기존에 date, time이 Date|'마감 시간' 와 같은 구조로 되어있던 것을 Date|null 로 변경하고, null 일 경우에 마감시간 마감기한 등 스트링을 주고 스타일링도 변경하는 방식으로 변경했습니다.

  • BtnTask 내의 정보는 리스트 불러오는 api 에서 가져오고, 모달에 있는 정보는 taskId를 이용해서 상세정보를 불러오기 때문에 모달에만 시간 날짜를 임시저장하고 정보 등록하는 api 호출에 사용할 수 있도록 state를 사용했습니다.

  • 더 나은 구조가 있다면 리뷰로 달아주세요!

관련 이슈

close #142

스크린샷 (선택)

image image

@wrryu09 wrryu09 self-assigned this Jul 16, 2024
@wrryu09 wrryu09 linked an issue Jul 16, 2024 that may be closed by this pull request
1 task
Copy link
Member

@seong-hui seong-hui left a comment

Choose a reason for hiding this comment

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

모든 코드에 대해서 확인했습니다! 해당 로직 잘 동작하는 것을 확인했습니다! 조금씩 코드 수정이 많았는데 모든 부분에 대해서 꼼꼼하게 처리를 해주신 것 같아요! date를 null도 받게 처리를 잘해주셔서 좋네요 굳 리더 ~ 👍

Copy link
Contributor

@Kjiw0n Kjiw0n left a comment

Choose a reason for hiding this comment

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

확인하였습니다! 수고하셨습니다 👍 👍

Comment on lines +22 to +24
// date, time 각각 Date|null, String|null 로 관리
// 값이 없으면 '마감 기한' 등 텍스트 설정,
// 스타일 변경은 date, time null 여부로 결정
Copy link
Contributor

Choose a reason for hiding this comment

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

date가 null으로 넘어오는 경우가 있으니 해당 수정 좋은 것 같습니다 👍 👍

Copy link
Member

@jeeminyi jeeminyi left a comment

Choose a reason for hiding this comment

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

수고하셔씁니다!! 짱짱,,

Comment on lines +31 to +32
const [currentDate, setCurrentDate] = useState<Date | null>(date ? new Date(date) : null);
const [currentTime, setCurrentTime] = useState<string | null>(time);
Copy link
Member

Choose a reason for hiding this comment

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

초기값 타입을 Date로 두고 초기값이 없을 경우 null로 두는 state군요!
혹시 time 에서는 따로 ? : null을 안해주신 이유가 있을까요? date가 필수값이고 time은 선택으로 알고 있는데 요렇게 구현하신 이유가 궁금합니당!

Copy link
Member Author

Choose a reason for hiding this comment

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

date값이 string 또는 null 로 들어오기 때문에 있을 경우 Date object 로 보관하고 있기 위해서 형변환하는 작업입니다! time는 어차피 string 또는 null 로 오기 때문에 그리고 정해진 Date같은 형식이 없기 때문에 저런 형식으로 받은 거예요!

@@ -58,14 +65,14 @@ function BtnDate(props: BtnDateProps) {
>
<BtnDateText
icon={<CalanderIcon isDelayed={isDelayed} />}
text={date}
text={formatDatetoString(currentDate) || '마감 기한'}
Copy link
Member

Choose a reason for hiding this comment

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

요렇게 변경된 부분이 훨씬 좋네요! 굿굿 ㅎㅎ

@wrryu09 wrryu09 merged commit ca2dee3 into develop Jul 17, 2024
2 checks passed
@wrryu09 wrryu09 deleted the feat/#142/link-modal-info branch July 17, 2024 01:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[FEAT] 모달에 정보 연결하기
4 participants