-
Notifications
You must be signed in to change notification settings - Fork 0
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
채팅 컴포넌트 마크업 (after #6 merged) #8
base: dev
Are you sure you want to change the base?
Conversation
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.
채팅 컴포넌트 잘 참고하겠습니닷!!! 🤗👍🏻
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>} |
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.
- fromAdmin이 true일 때만 adminName과 image가 존재하는 것일텐데, 이 부분을 타입으로 강제해줄 수는 없을까요?
- image -> adminImage로 네이밍을 바꿔도 좋지 않을까요? 또는 admin?: { name: string; image: string; } 이런 식으로 ..?
export const chatFromUser = { | ||
fromAdmin: false, | ||
content: `안녕하세요! 프로젝트 너무 훌륭하군요 !! ㅎㅎㅎ 다만 사용해보니 로그인 기능에 버튼이 제대로 동작하지 않는 버그가 있는 것 같습니다.`, | ||
}; |
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.
여기 스토리북 컴포넌트 argument를 fixture로 빼니까 뭔가 스토리북 코드 내에서 컴포넌트의 props 정보를 한눈에 보기 힘들다는 단점이 있는 것 같은데, 어떻게 생각하시나효?
개요
이슈 번호
변경사항
특이사항