-
Notifications
You must be signed in to change notification settings - Fork 2
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
#837 채팅창에서 메세지별로 안 읽은 사람 수 보여주기 #846
#837 채팅창에서 메세지별로 안 읽은 사람 수 보여주기 #846
Conversation
❌ Deploy Preview for taxi-dev-preview failed.
|
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.
수고하셨습니다..! 동작 엄청 잘 되네요! 드디어 숙원 사업 중 하나가 완료되는군요. 몇 가지 코멘트 남겼는데 확인 부탁드립니다
)} | ||
<div css={styleMessageDetail}> | ||
{unreadUsersNum(chat.time) > 0 && ( | ||
<UnreadUsers value={unreadUsersNum(chat.time)} /> |
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.
UnreadUsers 컴포넌트를 별도로 분리하신 이유가 있나요?? 그냥 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.
넵 div 바로 사용하면 될 것 같습니다!
@@ -74,6 +81,24 @@ const MessageSet = ({ chats, layoutType, roomInfo }: MessageSetProps) => { | |||
const isBot = authorId === "bot"; | |||
const isAlone = roomInfo.part.length === 1; | |||
|
|||
// Chat의 time에 따라 안 읽은 사람 수 설정 | |||
const unreadUsersNum = useCallback( |
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.
useCallback을 사용하는 것보다는, useMemo를 이용해서 안 읽은 사람 수 자체를 메모이제이션 하는게 성능상 더 유리할 것 같습니다!
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.
GPT 랑 얘기를 좀 해봤는데, 어짜피 readAtList랑 time이 많이 바뀌니깐 메모이제이션 해봤자 별 효용이 없다고 하네요. 그리고 웬만한 최적화는 react가 알아서 해준다고 합니다. 그래서 걍 메모이제이션 뺐습니다.
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.
LGTM! 수고하셨습니다! 많은 요청사항 잘 들어주셔서 감사합니다~~
머지 전에 loadenv 수정 꼭 부탁드려용
Summary
It closes #837
Images or Screenshots