-
Notifications
You must be signed in to change notification settings - Fork 4
✨ feat: Show Apartment Details on Result Page #50
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
Conversation
src/App.jsx
Outdated
| @@ -40,6 +41,7 @@ export default function App() { | |||
| <Route path="/profile/new" component={NewProfilePage} /> | |||
| <Route exact path="/apartment" component={ApartmentPage} /> | |||
| <Route path="/apartment/:id" component={ApartmentPage} /> | |||
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.
상세 페이지인가요? RESTful 하게 apartments/:id와 같이 복수형으로 처리하는게 좋을 것 같아요~
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.
collection(집합)을 먼저 표현하고,
그 집합 중에 특정한 1개는 id(식별자)로 구분하는 방식.
| if (title === '보기') { | ||
| changeApartment(apartment); | ||
| } |
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.
특정 경우에만 changeApartment()가 실행되는건가요?
그럼 title이 보기인 경우에만 사용하는 곳에서 changeApartment를 주입해주고
이 핸들러 함수에서는 changeApartment가 있는 경우에만 호출하도록 처리할 수도 있을 것 같아요.
changeApartment?.(apartment);
아니면 props로 onClick을 넘겨주고 있으니 onClick에 title이 보기인 경우에만 핸들링하는 로직을 넣어서 넘기는 방법도 있을 것 같아요.
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.
#42 반영 완료!
| return ( | ||
| <> | ||
| {apartments?.map((apartment) => ( | ||
| <article key={apartment.name}> |
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.
아파트 name이 key가 되는건가요? 아파트 이름이 겹치는 케이스는 없을까요?
아니라면 id 프로퍼티를 추가해서 사용해도 좋을 것 같네요 ㅎㅎ
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.
아파트 이름이 중복될 가능성은 희박하다.
절대란 없으니, 추후에 백엔드에서 data를 가공할떄, id를 넣어주도록 수정 예정.
| if (!isNew) { | ||
| return ( | ||
| <article> | ||
| <p> | ||
| {name} | ||
| 님 안녕하세요!! | ||
| </p> | ||
|
|
||
| <LinkField | ||
| url="/profile" | ||
| title="내 정보 확인하러가기" | ||
| onClick={onClick} | ||
| /> | ||
| </article> | ||
| ); | ||
| } | ||
| return ( | ||
| <article> | ||
| {isNew && ( | ||
| <> | ||
| <LinkField | ||
| url="/profile/new" | ||
| title="내 정보 입력하러가기" | ||
| onClick={onClick} | ||
| /> | ||
| </> | ||
| )} | ||
| </article> | ||
| ); |
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.
오잉 조금 햇갈리는데, isNew에 따른 예외처리가 둘다 들어가네요. 이 경우에는 한쪽의 예외처리를 없애거나, 삼항연산자로 처리해주는건 어떨까요?
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.
이미 isNew 상태값에 따라 전처리를 하기 떄문에, 하단에 단락평가는 삭제가 옳다.
|
rebase 설정 잘못으로 인해 force push 불가. reflog로 탐색해도 rebase 전 커밋으로 변경 불가능.... 다음에는 좀 더 주의하도록하겠습니다... ※꿀팁 발견 github에서 merge button 오른쪽 화살표를 누르면 |
Users can now check out the details of the apartment which they select on the apartment page.
If Users haven't filled up the form yet, the result screen shows a link to enter their information.