프로필 이미지 컴포넌트#11
Conversation
Summary of ChangesHello @HWAN0218, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 이 PR은 애플리케이션 전반에서 사용될 수 있는 강력하고 유연한 Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
이 PR은 재사용 가능한 프로필 이미지 컴포넌트를 구현한 점이 인상적입니다. 반응형 디자인과 다양한 옵션(수정 가능 여부, 보더 등)을 고려하여 매우 유연하게 설계되었습니다. 코드 구조도 useMemo, useCallback 등을 적절히 사용하여 최적화가 잘 되어 있습니다. 몇 가지 개선점을 제안합니다. variant prop에 따라 API 요청을 분기하는 로직을 추가하고, 이미지 업로드 실패 시 사용자에게 피드백을 제공하는 에러 핸들링을 보강하면 컴포넌트의 완성도가 더욱 높아질 것입니다. 또한, CSS에서 !important 사용을 재고하고, 정의되지 않은 CSS 클래스를 정리하는 것이 좋겠습니다. 자세한 내용은 각 파일에 남긴 주석을 참고해주세요.
| if (enableApi) { | ||
| try { | ||
| const url = await uploadImage(file); | ||
| await patchUserImage(url); |
There was a problem hiding this comment.
There was a problem hiding this comment.
팀은 PATCH /groups/{groupId}로 처리하도록 분기했고, 그때 필요한 teamGroupId prop을 추가
| } catch (err) { | ||
| console.error(err); | ||
| } |
There was a problem hiding this comment.
onError 콜백을 추가해서 상위에서 토스트 등으로 사용자 피드백을 줄 수 있게 했고, 실패 시 프리뷰도 원복
| border: 0 !important; | ||
| outline: 0 !important; | ||
| box-shadow: none !important; |
There was a problem hiding this comment.
!important 규칙은 CSS의 자연스러운 계단식 상속(cascading)을 방해하여 유지보수를 어렵게 만들 수 있습니다. 꼭 필요한 경우가 아니라면 사용을 지양하는 것이 좋습니다. 이 속성들이 다른 스타일에 의해 덮어씌워지는 것을 막기 위해 사용되었다면, 대신 선택자의 명시도(specificity)를 높이는 방법을 고려해 보세요.
| border: 0 !important; | |
| outline: 0 !important; | |
| box-shadow: none !important; | |
| border: 0; | |
| outline: 0; | |
| box-shadow: none; |
There was a problem hiding this comment.
!important 삭제하고 .outer .box처럼 선택자 명시도 올리는 방식으로 변경
| const BP_ORDER: Breakpoint[] = ['base', 'sm', 'md', 'lg', 'xl']; | ||
|
|
||
| const BORDER_BY_SIZE: Record<ProfileImageSize, number> = { | ||
| xl: 2, |
There was a problem hiding this comment.
BORDER_WIDTH 상수로 분리완료
| className={`${styles.mask} ${styles[radius]} ${ | ||
| variant === 'team' ? styles.teamMask : styles.profileMask | ||
| }`} |
There was a problem hiding this comment.
variant가 'profile'일 때 styles.profileMask 클래스를 사용하도록 되어 있으나, ProfileImage.module.css 파일에는 해당 클래스가 정의되어 있지 않습니다. 이로 인해 undefined가 클래스 이름으로 추가되어 의도치 않은 동작을 유발할 수 있습니다. 'profile' variant에 대한 특별한 스타일이 필요 없다면 이 부분을 제거하거나, 필요하다면 CSS 파일에 .profileMask를 정의해주세요.
className={`${styles.mask} ${styles[radius]} ${variant === 'team' ? styles.teamMask : ''}`}
There was a problem hiding this comment.
profileMask 사용하지 않아 삭제
Jieunsse
left a comment
There was a problem hiding this comment.
아토믹한 컴포넌트 정의 관련해서 논의가 필요합니다.
월요일 회의에서 자세한 내용 공유하겠습니다!
There was a problem hiding this comment.
해당 컴포넌트 테스트를 위해서 작성하셨던 코드인 것 같아서 지우고 머지하는게 좋을 것 같습니다!
| import { fetchApi } from '@/shared/apis/fetchApi'; | ||
| import { BASE_URL, TEAM_ID } from '@/shared/apis/config'; |
There was a problem hiding this comment.
리뷰 전체 글에서 작성한 내용에 대해 논의가 필요합니다!
- 아토믹한 컴포넌트 정의 관련
Jieunsse
left a comment
There was a problem hiding this comment.
LGTM 👍
코드 작성하시느라 고생 많으셨습니다!
추후에 타입이나 유틸 함수들 분리해봐도 좋을 것 같아요!
Summary
Issue
Scope