Skip to content

Commit

Permalink
feat: client -> server ui로 메세지 전달
Browse files Browse the repository at this point in the history
  • Loading branch information
HeoJiye committed Nov 16, 2023
1 parent dfb5b9f commit c22e277
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 3 additions & 1 deletion frontend/src/pages/AIChatPage/AIChatPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import ChatList from '@components/ChatList/ChatList';
import CustomButton from '@components/CustomButton';
import Header from '@components/Header';

import { sendMessage } from '@business/services/socket';

interface AIChatPageProps {}

const AIChatPage = ({}: AIChatPageProps) => {
Expand Down Expand Up @@ -57,7 +59,7 @@ const AIChatPage = ({}: AIChatPageProps) => {
disabled={false}
sendChatMessage={message => {
// TODO: 서버로 메시지 전송 & 화면에 메시지 컴포넌트 그리기
console.log(message);
sendMessage(message);
}}
/>
</div>
Expand Down
6 changes: 1 addition & 5 deletions frontend/src/pages/HomePage/HomePage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { connect, sendMessage, setMessageEventListener } from '@business/services/socket';
import { connect, setMessageEventListener } from '@business/services/socket';
import { useNavigate } from 'react-router-dom';

import CustomButton from '@components/CustomButton';
Expand All @@ -11,10 +11,6 @@ const HomePage = () => {

// 테스트를 위한 부분
setMessageEventListener(message => alert(message));
setTimeout(() => {
sendMessage('안녕, 곧 수능인데 내가 수능을 잘 볼 수 있을까?');
}, 3000);

navigate('/chat/ai');
};

Expand Down

0 comments on commit c22e277

Please sign in to comment.