-
Notifications
You must be signed in to change notification settings - Fork 2
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: 사용자 정보기입 페이지 구현 #10
Conversation
질문자 측의 두 dialog box를 스타일에 따라 변경할수 있게 바꿨습니다
spark-web/src/domains/UserInformation/components/Questionbox.tsx
Outdated
Show resolved
Hide resolved
spark-web/src/domains/UserInformation/components/Footers/SNSGoal.tsx
Outdated
Show resolved
Hide resolved
function submitOnEnter(e: React.KeyboardEvent<HTMLInputElement>) { | ||
if (e.key === "Enter") { | ||
onClick(inputText); | ||
setIsTyped(); | ||
} | ||
} |
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.
내부안에 이벤트 할당하는 함수는 function 선언식 대신에 함수 표현식으로 작성해주세요!
useCallback 적용하는데 더 좋아요
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.
혹시 해당 함수가 왜 useCallback을 적용하는게 더 좋다고 생각하셨는지 알 수 있을까요?
해당 함수는 자주 변하는 inputText 상태에 의존적인데, useCallback의 의존성으로 inputText를 설정하면 재생성이 너무 자주 일어나 효용이 떨어지고, 그렇다고 의존성 배열에 입력하지 않으면 해당 상태변화가 적용되지 않는 문제점이 생깁니다
spark-web/src/domains/UserInformation/components/Footers/FulltimeParttime.tsx
Outdated
Show resolved
Hide resolved
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.
고생하셨어요!
prettier와 pr 제목 컨벤션에 맞게 제작해주실수 있나요??
리뷰하기가 살짝 어려워요ㅠㅠ
spark-web/src/pages/UserInfo.tsx
Outdated
return <div>UserInfo</div>; | ||
return ( | ||
<div> | ||
<UserInformation /> |
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.
이렇게 하나의 컴포넌트로 하신 이유가 있으실까요??
한단계 더 타고 들어가야해서 depth가 좀 길어지는것 같습니다!
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.
기존에 작업하던 곳이 UserInfo라 router가 연결되어 있는곳에 넣어놨습니다
UserInformation을 UserInfo로 대체하여 수정하겠습니다!
} | ||
}, [steps]); | ||
|
||
function SheetContents() { |
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.
컴포넌트 안에 또 컴포넌트로 정의한 이유가 있으신가요?
이렇게 정의하면 리렌더링에 대해서 대응할수 없다는 이슈가 있어서 안티패턴이라고 알고 있어요!
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.
유용한 정보 감사합니다! userInformation에서 쓰이는 상태가 많아서 컴포넌트 안에서 정의했습니다
분리하겠습니다!
|
||
return ( | ||
<div className={'px-[20px] flex flex-col'}> | ||
{steps === 0 ? ( |
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.
해당 로직은 분기처리가 많이 되어있는거 같아요.
만약에 steps가 더 늘어나면 또 분기처리를 해줘야할것 같은데 이 부분에 대해서 한번 더 고민해봤으면 좋겠어요!
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.
저도 동의합니다! 두고두고 생각해봐야 할 것 같습니다
spark-web/src/domains/UserInformation/components/Footers/FulltimeParttime.tsx
Outdated
Show resolved
Hide resolved
GOAL: '', | ||
}); | ||
const [isTyped, setIsTyped] = useState<boolean>(false); | ||
const bottomRef: RefObject<HTMLDivElement> = useRef<HTMLDivElement>(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.
RefObject라고 정의하신 이유가 궁금합니다.
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.
DOM에 접근해야했고 readonly로 충분하기 떄문에 RefObject를 썼습니다
onClick={() => { | ||
if (item !== '직접입력') { | ||
onClick(item); | ||
} | ||
setTouched(item !== '직접입력'); | ||
}} |
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.
이벤트 정의 함수가 길어지면 가독성 측면에 안좋아요!
따로 빼서 정의하면 좋을것 같아요
이슈 번호
작업한 목록을 작성해 주세요
질문자측 question box 컴포넌트 한개로 만든 후 props에 따라 정해진 스타일 적용 가능하게 구현
![image](https://private-user-images.githubusercontent.com/62217368/406730020-348dcafa-2a2c-4779-83b5-1507544ed3b1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxMzgzMjMsIm5iZiI6MTczOTEzODAyMywicGF0aCI6Ii82MjIxNzM2OC80MDY3MzAwMjAtMzQ4ZGNhZmEtMmEyYy00Nzc5LTgzYjUtMTUwNzU0NGVkM2IxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA5VDIxNTM0M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWNkNGY4MjM3ODYzMjMxMjFkYzNmNDE2M2RmNWMxMGI1NTBkN2U1NTJjZDFiNTU5ZTQ3YzM4M2E3MGQzN2NlYzgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.pFIHtWH56WgcjvZhpU7pJhfg3a_uv-4HN4TRtfqA9jw)
전업 부업 선택 컴포넌트 구현
![image](https://private-user-images.githubusercontent.com/62217368/406730171-ae991643-4b2d-434e-8fa0-2f1e159115de.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxMzgzMjMsIm5iZiI6MTczOTEzODAyMywicGF0aCI6Ii82MjIxNzM2OC80MDY3MzAxNzEtYWU5OTE2NDMtNGIyZC00MzRlLThmYTAtMmYxZTE1OTExNWRlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA5VDIxNTM0M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTg4NjBjYmM5NzUyOTllNzkwYmIzMmVjY2NlMzUxNmE4NWEzMzYwM2I4YTk2NTBhNmFkMTA5Yzc0MmQ2NjljZTUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.Boe062P7to4I6nPuPGgagtXkawU-qFP6G8Be1yO4OLg)
유튜브를 하는 목적 선택 컴포넌트 구현
![image](https://private-user-images.githubusercontent.com/62217368/406730211-56260aaa-af36-4aab-bd2a-2d857d545971.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxMzgzMjMsIm5iZiI6MTczOTEzODAyMywicGF0aCI6Ii82MjIxNzM2OC80MDY3MzAyMTEtNTYyNjBhYWEtYWYzNi00YWFiLWJkMmEtMmQ4NTdkNTQ1OTcxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA5VDIxNTM0M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNkZTNhZjUwMDk3YjAyMzZiZTNiZTBkN2U2ZDIxZGVlNmM3ZDRjMGQwYzRiNWM2ZjEwMGQxMTQ4YTQ0Y2M2OGMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.KGTzxgcJ37Nyxi6kywBdwJ1IaL6qs9wII9tT5MUrCWE)
프로필 구현
![image](https://private-user-images.githubusercontent.com/62217368/406730225-8df55df7-a24f-45d4-a7b4-0c251a36e194.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxMzgzMjMsIm5iZiI6MTczOTEzODAyMywicGF0aCI6Ii82MjIxNzM2OC80MDY3MzAyMjUtOGRmNTVkZjctYTI0Zi00NWQ0LWE3YjQtMGMyNTFhMzZlMTk0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA5VDIxNTM0M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWFmY2I1YjdiOWNlNjk0ZjBiYzgyMTg1MDlmNDRkMTllYmJjOGZmMTI4M2VjMmNkOTVjNzllYjVhM2Y0NTZjMGMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.nZPGG5aPScDw1w89uySUxGxyBaC6MHd_bHNWjlecHco)
메인 화면
새로운 컴포넌트가 렌더링 될때마다 자동적으로 최하단으로 스크롤 되도록 구현
스크린샷
2025-01-26.9.26.28.mov
pr 포인트나 궁금한 점을 작성해 주세요
연관된 issue: #information