Skip to content

Conversation

@kyubumjang
Copy link
Member

@kyubumjang kyubumjang commented Nov 21, 2022

📌 개요

ChatListItem 전체적인 구조 및 코드 리팩토링

  • 전체 코드, 구조 파악, 도메인 분리 시도
  • InnerWrapper 스타일 코드 분리
  • common 파일 내 코드 분리 및 불필요한 스타일 삭제
  • Text 컴포넌트 구현
  • 불필요한 CSS 삭제

👩‍💻 구현 내용

  • 구현 사항(화면은 같지만 코드는 변경되었습니다.)

스크린샷 2022-11-21 오전 11 36 40

issue/140 [Refactor] ChatListItem

이슈에 있는 내용들을 구현했습니다. 조금 내용을 정돈해보면 코드를 파악하고 더 좋은 코드 구조에 대한 고민, 도메인에 대한 고민을 해봤지만 코드 구조, 도메인 유지 모두 현재 코드 그대로 유지하기로 결정했습니다. 자세한 이유는 이슈에서 확인 부탁드려요.

현재 PR에서 진행한 사항은 다음과 같습니다.

fix(useform): commitzen husky hook error 발생하여 임시 처리

커밋 에러

커밋을 할 때 위 스크린샷과 같은 에러가 발생하여 임시로 unknown 처리 해뒀습니다.

refactor(chatlistitem): 리팩토링한 avatar 적용

리팩토링 해주신 avatar props에 맞춰서 적용시켰습니다.

feat(text): text 컴포넌트 구현

스크린샷 2022-11-21 오후 1 02 05

tag, fontSize, fontWeight, fontStyle, color 를 props로 받아 텍스트를 커스텀 할 수 있습니다.
현재는 if 문 때문에 아주 난잡해보이는데 말씀해주신 타입 적용을 해볼 생각입니다.
tag를 기존에 사용하던 BoldB3 boldGrayB1 대소문자 구분없이 원하는 형태를 넣어서 해당하는 글자가 포함되는 경우 구현되도록 만들어뒀습니다. 더 좋은 방식이 있다면 말씀해주세요.

refactor(chatlistitem): chatlistitem container, wrapper 명칭 수정, 불필요한 css 삭제

기존 InnerWrapper로 작업하던 justify-content, alignItems를 분리해봤습니다. 가독성 때문에 구분해뒀는데 한 곳으로 컴포넌트처럼 쓰던 거라 굳이 이렇게 할 필요성이 있을까 생각도 했습니다. 의견 부탁드립니다.
개인적으로 InnerWrapper라는 명칭을 바꾸는게 더 괜찮아보이기도 합니다.
LayoutWrapper 혹은 FlexWrapper 명칭은 잘 모르겠네요.

✅ PR 포인트 & 궁금한 점

  • 더 좋은 방식의 Text 구현방식(includes(), type 등등) 리뷰 부탁드려요!
  • OldBadge 명칭을 matchStatusBadge라고 변경하는게 좋을 것 같다고 생각하는데 어떻게 생각하시나요?
  • InnerWrapper의 명칭 변경에 대해서 어떻게 생각하시나요?

close #140

@kyubumjang kyubumjang requested a review from chmini November 21, 2022 07:52
@kyubumjang kyubumjang self-assigned this Nov 21, 2022
@vercel
Copy link

vercel bot commented Nov 21, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
sfam ✅ Ready (Inspect) Visit Preview Nov 21, 2022 at 7:52AM (UTC)

Copy link
Collaborator

@chmini chmini left a 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을 활용하더라도 조금 빡세네요..

나머지 추가, 변경사항은 모두 확인했어요 :)

Comment on lines 19 to 26
{imgSrc !== null ? (
<OldAvatar
imgSrc={imgSrc}
imgSize='72px'
borderRadius='50%'
<Avatar
src={imgSrc}
size='72px'
/>
) : (
<OldAvatar imgSize='72px' />
<Avatar size='72px' />
)}
Copy link
Collaborator

Choose a reason for hiding this comment

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

이 부분 제가 적용하려 하는데 아마 조건문을 제거하는 방향으로 갈 것 같아요 :)

Comment on lines +12 to +24
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;
}
};
Copy link
Collaborator

Choose a reason for hiding this comment

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

이 파트 수요일이나 목요일에 라이브 코딩으로 같이 하도록 해요
리뷰로 달려니 뭔가 빡세네요 ㅠ

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.

[Refactor] ChatListItem 리팩토링

2 participants