-
Notifications
You must be signed in to change notification settings - Fork 3
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/#71] 반려동물 질병 유무 뷰 구현 #79
Conversation
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.
고생하셨습니다!
{healthStep === "" && <PetHealthDualSelector stepChange={stepChange} />} | ||
{healthStep === "예" && <Disease />} | ||
{healthStep === "아니오" && <Symptom />} |
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.
p4) 짜기 나름이긴 한데, 이거 함수로 따로 빼서, switch 문으로 return 하는 것도 좋은 방법일 것 같아요 ~~
예를 들면 이렇게 입니다
const renderHealthStep = (healthStep: string, stepChange: () => void) => {
switch (healthStep) {
case "예":
return <Disease />;
case "아니오":
return <Symptom />;
default:
return <PetHealthDualSelector stepChange={stepChange} />;
}
};
const ParentComponent = ({ healthStep, stepChange }: { healthStep: string; stepChange: () => void }) => {
return <div>{renderHealthStep(healthStep, stepChange)}</div>;
};
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.
평소 return문 내부가 깔끔한걸 더 선호하는데 이 방법이 더 깔끔하고 좋은거 같아요!!
이렇게 반영해보도록 하겠습니다! 알려주셔서 감사해요❤️
➡️ 조립해서 렌더링 최종 구현할 때 활용해보겠습니다!
예림언니 PR 영상 보면 반응형 하나하나 고려해서 스타일 준게 너무 멋져요... 👍👍 |
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.
🔥 Related Issues
pr 리뷰어에게 내용만 읽어주시고, File Changed에서 질병~증상 컴포넌트 렌더링하는 PetHealth 컴포넌트만 코드리뷰 해주세욥!
✅ 작업 리스트
🔧 작업 내용
📣 리뷰어에게 어떠신가요?
progressbar
추후 구현 예정입니다!다들 아시겠지만..! 반려동물 질병 유무에 따라 이후 플로우가 달라집니다!(상세 질병 선택 뷰 스킵의 형식)
반려동물 등록
post
할 때 이 부분에서 필요한 정보는 1) 질병아이디 배열(없는 경우null
) 2) 증상아이디 배열 입니다.(null
일 수 없음)3단계에 거쳐 2가지의 정보만 도출되다 보니 이 3단계를 렌더링 하는 껍데기 컴포넌트를 만들어 한 번에 질병 증상 정보를 보내고자 합니다.
현재 한 개의 껍데기로 묶어 분기 처리만 해두었고 추후 자식 컴포넌트 구현한 후 나머지 분기처리 및 로직 구현하고자 합니다.
📸 스크린샷 / GIF / Link
2025-01-17.2.mp4