-
Notifications
You must be signed in to change notification settings - Fork 3
[Refactor/140] ChatlistItem 컴포넌트 리팩토링 #152
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
base: develop
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
PR이 작아 리뷰가 편했어요 👍🏻
한 가지 궁금한 점이 있습니당
폴더 구조에서 의문이었던 것이 styles 파일을 저희가 따로 두지 않기로 했었는데 따로 해두신 이유가 있을까요?
Text 컴포넌트 관련해서 스크럼 리뷰 때 같이 보면 좋을 것 같아요
suggestion을 활용하더라도 조금 빡세네요..
나머지 추가, 변경사항은 모두 확인했어요 :)
| {imgSrc !== null ? ( | ||
| <OldAvatar | ||
| imgSrc={imgSrc} | ||
| imgSize='72px' | ||
| borderRadius='50%' | ||
| <Avatar | ||
| src={imgSrc} | ||
| size='72px' | ||
| /> | ||
| ) : ( | ||
| <OldAvatar imgSize='72px' /> | ||
| <Avatar size='72px' /> | ||
| )} |
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 getFontSize = () => { | ||
| if (tag) { | ||
| const compareTag = tag.toLowerCase(); | ||
| if (compareTag.includes('h1')) return theme.fontSize.h1; | ||
| if (compareTag.includes('h2')) return theme.fontSize.h2; | ||
| if (compareTag.includes('b1')) return theme.fontSize.b1; | ||
| if (compareTag.includes('b2')) return theme.fontSize.b2; | ||
| if (compareTag.includes('b3')) return theme.fontSize.b3; | ||
| if (compareTag.includes('b4')) return theme.fontSize.b4; | ||
| if (compareTag.includes('c1')) return theme.fontSize.c1; | ||
| if (compareTag.includes('c2')) return theme.fontSize.c2; | ||
| } | ||
| }; |
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.
이 파트 수요일이나 목요일에 라이브 코딩으로 같이 하도록 해요
리뷰로 달려니 뭔가 빡세네요 ㅠ
📌 개요
ChatListItem 전체적인 구조 및 코드 리팩토링
👩💻 구현 내용
issue/140 [Refactor] ChatListItem
이슈에 있는 내용들을 구현했습니다. 조금 내용을 정돈해보면 코드를 파악하고 더 좋은 코드 구조에 대한 고민, 도메인에 대한 고민을 해봤지만 코드 구조, 도메인 유지 모두 현재 코드 그대로 유지하기로 결정했습니다. 자세한 이유는 이슈에서 확인 부탁드려요.
현재 PR에서 진행한 사항은 다음과 같습니다.
fix(useform): commitzen husky hook error 발생하여 임시 처리
커밋을 할 때 위 스크린샷과 같은 에러가 발생하여 임시로 unknown 처리 해뒀습니다.
refactor(chatlistitem): 리팩토링한 avatar 적용
리팩토링 해주신 avatar props에 맞춰서 적용시켰습니다.
feat(text): text 컴포넌트 구현
tag,fontSize,fontWeight,fontStyle,color를 props로 받아 텍스트를 커스텀 할 수 있습니다.현재는 if 문 때문에 아주 난잡해보이는데 말씀해주신 타입 적용을 해볼 생각입니다.
tag를 기존에 사용하던BoldB3boldGrayB1대소문자 구분없이 원하는 형태를 넣어서 해당하는 글자가 포함되는 경우 구현되도록 만들어뒀습니다. 더 좋은 방식이 있다면 말씀해주세요.refactor(chatlistitem): chatlistitem container, wrapper 명칭 수정, 불필요한 css 삭제
기존
InnerWrapper로 작업하던 justify-content, alignItems를 분리해봤습니다. 가독성 때문에 구분해뒀는데 한 곳으로 컴포넌트처럼 쓰던 거라 굳이 이렇게 할 필요성이 있을까 생각도 했습니다. 의견 부탁드립니다.개인적으로 InnerWrapper라는 명칭을 바꾸는게 더 괜찮아보이기도 합니다.
LayoutWrapper혹은FlexWrapper명칭은 잘 모르겠네요.✅ PR 포인트 & 궁금한 점
close #140