-
Notifications
You must be signed in to change notification settings - Fork 1
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
[FEAT] 모달에 정보 연결하기 #147
Conversation
fc81ffe
to
d7e06c8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
모든 코드에 대해서 확인했습니다! 해당 로직 잘 동작하는 것을 확인했습니다! 조금씩 코드 수정이 많았는데 모든 부분에 대해서 꼼꼼하게 처리를 해주신 것 같아요! date를 null도 받게 처리를 잘해주셔서 좋네요 굳 리더 ~ 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
확인하였습니다! 수고하셨습니다 👍 👍
// date, time 각각 Date|null, String|null 로 관리 | ||
// 값이 없으면 '마감 기한' 등 텍스트 설정, | ||
// 스타일 변경은 date, time null 여부로 결정 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
date가 null으로 넘어오는 경우가 있으니 해당 수정 좋은 것 같습니다 👍 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고하셔씁니다!! 짱짱,,
const [currentDate, setCurrentDate] = useState<Date | null>(date ? new Date(date) : null); | ||
const [currentTime, setCurrentTime] = useState<string | null>(time); |
There was a problem hiding this comment.
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은 선택으로 알고 있는데 요렇게 구현하신 이유가 궁금합니당!
There was a problem hiding this comment.
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) || '마감 기한'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
요렇게 변경된 부분이 훨씬 좋네요! 굿굿 ㅎㅎ
d7e06c8
to
51c876a
Compare
작업 내용 🧑💻
리뷰 요구사항 💬
Modal
컴포넌트에taskId
를 props 로 받게 해주어서 상세정보 요청을taskId
로 하시면 됩니다! 임시로 5로 박아둔 상태고 나중에 값 연결할 때 데이터 형식 잘 확인하고 연결하면 될 것 같아요타입 관리를 용이하게 하기 위해서 기존에 date, time이
Date|'마감 시간'
와 같은 구조로 되어있던 것을Date|null
로 변경하고, null 일 경우에 마감시간 마감기한 등 스트링을 주고 스타일링도 변경하는 방식으로 변경했습니다.BtnTask
내의 정보는 리스트 불러오는 api 에서 가져오고, 모달에 있는 정보는taskId
를 이용해서 상세정보를 불러오기 때문에 모달에만 시간 날짜를 임시저장하고 정보 등록하는 api 호출에 사용할 수 있도록 state를 사용했습니다.더 나은 구조가 있다면 리뷰로 달아주세요!
관련 이슈
close #142
스크린샷 (선택)