Conversation
Seogeurim
approved these changes
Jan 8, 2022
Comment on lines
+9
to
+24
| interface ChatItemProps { | ||
| content: string; | ||
| fromAdmin: boolean; | ||
| adminName?: string; | ||
| image?: string; | ||
| } | ||
|
|
||
| const ChatItem = memo<ChatItemProps>( | ||
| ({ adminName, content, fromAdmin, image }) => { | ||
| const theme = useTheme(); | ||
|
|
||
| return ( | ||
| <div css={chatItemWrapperStyle(theme, fromAdmin)}> | ||
| {image && <img src={image} alt="채팅 로고 이미지" />} | ||
| <div> | ||
| {adminName && <div css={chatAdminNameStyle}>{adminName}</div>} |
Member
There was a problem hiding this comment.
- fromAdmin이 true일 때만 adminName과 image가 존재하는 것일텐데, 이 부분을 타입으로 강제해줄 수는 없을까요?
- image -> adminImage로 네이밍을 바꿔도 좋지 않을까요? 또는 admin?: { name: string; image: string; } 이런 식으로 ..?
| export const chatFromUser = { | ||
| fromAdmin: false, | ||
| content: `안녕하세요! 프로젝트 너무 훌륭하군요 !! ㅎㅎㅎ 다만 사용해보니 로그인 기능에 버튼이 제대로 동작하지 않는 버그가 있는 것 같습니다.`, | ||
| }; |
Member
There was a problem hiding this comment.
여기 스토리북 컴포넌트 argument를 fixture로 빼니까 뭔가 스토리북 코드 내에서 컴포넌트의 props 정보를 한눈에 보기 힘들다는 단점이 있는 것 같은데, 어떻게 생각하시나효?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
개요
이슈 번호
변경사항
특이사항