Skip to content

Conversation

@dodoongtak
Copy link
Contributor

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.

apartment details

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} />
Copy link

Choose a reason for hiding this comment

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

상세 페이지인가요? RESTful 하게 apartments/:id와 같이 복수형으로 처리하는게 좋을 것 같아요~

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Restful 참고링크

collection(집합)을 먼저 표현하고,
그 집합 중에 특정한 1개는 id(식별자)로 구분하는 방식.

Comment on lines +8 to +10
if (title === '보기') {
changeApartment(apartment);
}
Copy link

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이 보기인 경우에만 핸들링하는 로직을 넣어서 넘기는 방법도 있을 것 같아요.

Copy link
Contributor Author

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}>
Copy link

Choose a reason for hiding this comment

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

아파트 name이 key가 되는건가요? 아파트 이름이 겹치는 케이스는 없을까요?

아니라면 id 프로퍼티를 추가해서 사용해도 좋을 것 같네요 ㅎㅎ

Copy link
Contributor Author

Choose a reason for hiding this comment

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

아파트 이름이 중복될 가능성은 희박하다.

절대란 없으니, 추후에 백엔드에서 data를 가공할떄, id를 넣어주도록 수정 예정.

Comment on lines 8 to 36
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>
);
Copy link

Choose a reason for hiding this comment

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

오잉 조금 햇갈리는데, isNew에 따른 예외처리가 둘다 들어가네요. 이 경우에는 한쪽의 예외처리를 없애거나, 삼항연산자로 처리해주는건 어떨까요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

이미 isNew 상태값에 따라 전처리를 하기 떄문에, 하단에 단락평가는 삭제가 옳다.

@dodoongtak
Copy link
Contributor Author

dodoongtak commented Apr 6, 2021

rebase 설정 잘못으로 인해 force push 불가.

reflog로 탐색해도 rebase 전 커밋으로 변경 불가능....

다음에는 좀 더 주의하도록하겠습니다...

※꿀팁 발견

github에서 merge button 오른쪽 화살표를 누르면 squash and merge 선택하여 merge하는 기능이 있습니다! 🤯

@dodoongtak dodoongtak merged commit 51cb8e7 into CodeSoom:main Apr 6, 2021
@dodoongtak dodoongtak deleted the feature/result-screen branch April 6, 2021 17:42
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.

2 participants