-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* ✨ feat: 채팅 정렬 상태 추가 * ✨ feat: useInfiniteQuery 옵션에서 pageParam을 설정하도록 변경 * ✨ feat: 채팅의 작성자인지 확인하는 유틸함수 분리 * ✨ feat: 채팅 정렬 상태 관리하는 커스텀훅 구현 * ✨ feat: 채팅 좋아요 순 쿼리 반영 * ✨ feat: 좋아요순으로 불러올 때 받아온 채팅 데이터를 저장하도록 설정 * 🐛 fix: 테마 저장 로컬스토리지 변경 * 🐛 fix: 테마 localStorage key값 원래대로 변경 * 🐛 fix: 시가총액에 억 단위 추가 * ✨ feat: 채팅 엔터키로 전송, 줄바꿈 반영 * 🐛 fix: 채팅의 개행이 필요할 때 개행되지 않는 문제 수정 * 🐛 fix: isFetching 상태일 때 로더를 띄우도록 설정 * ✨ feat: hasNextPage를 추가하여 페이지가 더이상 없을 때 리렌더링 방지 * 🐛 fix: flat 메서드 삭제
- Loading branch information
Showing
10 changed files
with
125 additions
and
67 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from './schema'; | ||
export * from './usePostChatLike'; | ||
export * from './useGetChatList'; |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
11 changes: 11 additions & 0 deletions
11
packages/frontend/src/pages/stock-detail/hooks/useChatOrder.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { useState } from 'react'; | ||
|
||
type OrderType = 'latest' | 'like'; | ||
|
||
export const useChatOrder = () => { | ||
const [order, setOrder] = useState<OrderType>('latest'); | ||
const handleOrderType = () => | ||
setOrder((prev) => (prev === 'latest' ? 'like' : 'latest')); | ||
|
||
return { order, handleOrderType }; | ||
}; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { ChatData } from '@/sockets/schema'; | ||
|
||
interface CheckChatWriterProps { | ||
chat: ChatData; | ||
nickname: string; | ||
subName: string; | ||
} | ||
|
||
export const checkChatWriter = ({ | ||
chat, | ||
nickname, | ||
subName, | ||
}: CheckChatWriterProps) => | ||
chat.nickname === nickname && chat.subName === subName; |