Skip to content

Commit 6077165

Browse files
committed
feat: MatchingRoom 내부 챗박스 disabled 처리
1 parent 7efd26a commit 6077165

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/pages/Chats/ChatBox/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import SendIcon from '@assets/default/send-message.svg';
1111

1212
import { ChatBoxContainer, Textarea, SendButton } from './styles';
1313

14-
const ChatBox: React.FC = () => {
14+
const ChatBox: React.FC<{ disabled?: boolean }> = ({ disabled = false }) => {
1515
const [newMessage, setNewMessage] = useState('');
1616
const textareaRef = useRef<HTMLTextAreaElement | null>(null);
1717
const socket = useSocket();
@@ -22,9 +22,9 @@ const ChatBox: React.FC = () => {
2222
const isOtherUserValid = !!(otherUser && otherUser.id);
2323

2424
useEffect(() => {
25-
if (textareaRef.current && !isOtherUserValid) {
25+
if (textareaRef.current && (!isOtherUserValid || disabled)) {
2626
textareaRef.current.disabled = true;
27-
textareaRef.current.placeholder = '메시지를 보낼 수 없습니다.';
27+
textareaRef.current.placeholder = '메시지를 보낼 수 없는 채팅방입니다.';
2828
}
2929
}, []);
3030

src/pages/Chats/MatchingRoom/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ const MatchingRoom: React.FC = () => {
105105
)}
106106
<div ref={chatWindowRef} />
107107
</MessagesContainer>
108-
<ChatBox />
108+
<ChatBox disabled={true} />
109109
</OODDFrame>
110110
);
111111
};

0 commit comments

Comments
 (0)