@@ -18,7 +18,7 @@ import type { BottomSheetMenuProps } from '@components/BottomSheetMenu/dto';
1818import type { ModalProps } from '@components/Modal/dto' ;
1919import { createExtendedMessages } from './createExtendedMessages' ;
2020import { AllMesagesAtom } from '@recoil/Chats/AllMessages' ;
21- import { OpponentInfoAtom } from '@recoil/util/OpponentInfo ' ;
21+ import { OtherUserAtom } from '@recoil/util/OtherUser ' ;
2222import { useSocket } from '@context/SocketProvider' ;
2323import Back from '@assets/arrow/left.svg' ;
2424import KebabMenu from '@assets/default/more.svg' ;
@@ -52,7 +52,7 @@ const ChatRoom: React.FC = () => {
5252
5353 const { chatRoomId } = useParams ( ) ;
5454 const currentUserId = getCurrentUserId ( ) ;
55- const opponentInfo = useRecoilValue ( OpponentInfoAtom ) ;
55+ const otherUser = useRecoilValue ( OtherUserAtom ) ;
5656
5757 // 메시지 수신 시 아래로 스크롤 (스크롤 아래 고정)
5858 const scrollToBottom = ( ref : React . RefObject < HTMLDivElement > ) => {
@@ -61,21 +61,21 @@ const ChatRoom: React.FC = () => {
6161
6262 // 프로필 사진 클릭 시 프로필 페이지로 이동
6363 const handleUserClick = useCallback ( ( ) => {
64- const opponentId = opponentInfo ?. id ? opponentInfo . id : - 1 ;
64+ const opponentId = otherUser ?. id ? otherUser . id : - 1 ;
6565 if ( opponentId === - 1 ) {
6666 setModalContent ( '유저 정보를 찾을 수 없습니다.' ) ;
6767 setIsStatusModalOpen ( true ) ;
6868 } else {
6969 nav ( `/users/${ opponentId } ` ) ;
7070 }
71- } , [ opponentInfo , nav ] ) ;
71+ } , [ otherUser , nav ] ) ;
7272
7373 // 유저 차단 api
7474 const postUserBlock = async ( ) => {
7575 try {
7676 const data : PostUserBlockRequest = {
7777 requesterId : currentUserId ,
78- targetId : opponentInfo ?. id || - 1 ,
78+ targetId : otherUser ?. id || - 1 ,
7979 action : 'block' ,
8080 } ;
8181 const response = await postUserBlockApi ( data ) ;
@@ -133,7 +133,7 @@ const ChatRoom: React.FC = () => {
133133 // 메시지 수신 시
134134 useEffect ( ( ) => {
135135 // 렌더링에 필요한 정보 추가
136- const temp = createExtendedMessages ( allMessages , currentUserId , opponentInfo ) ;
136+ const temp = createExtendedMessages ( allMessages , currentUserId , otherUser ) ;
137137 setExtendedMessages ( temp ) ;
138138
139139 // 스크롤 아래로 이동
@@ -230,7 +230,7 @@ const ChatRoom: React.FC = () => {
230230 return (
231231 < OODDFrame >
232232 < TopBar
233- text = { opponentInfo ?. nickname || '알수없음' }
233+ text = { otherUser ?. nickname || '알수없음' }
234234 LeftButtonSrc = { Back }
235235 RightButtonSrc = { KebabMenu }
236236 onClickLeftButton = { ( ) => {
0 commit comments