diff --git a/src/App.tsx b/src/App.tsx index 9542d36..8c4c748 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,5 +1,5 @@ import React, { useState } from "react"; -import ChatWrapper from "./Chat/ChatWrapper"; +import Chat from "./Chat/Chat"; import "./App.css"; import { Message } from "./Chat/types"; import { MessageContainer } from "./Chat/MessageContainer"; @@ -21,7 +21,7 @@ const App = (): React.ReactElement => { return ; })} { - } diff --git a/src/Chat/ChatWrapper.tsx b/src/Chat/Chat.tsx similarity index 97% rename from src/Chat/ChatWrapper.tsx rename to src/Chat/Chat.tsx index 66e0301..648628e 100644 --- a/src/Chat/ChatWrapper.tsx +++ b/src/Chat/Chat.tsx @@ -15,7 +15,7 @@ const endpoints = { subscription: "/sub/chat", history: "/api/v1/msg/", }; -const ChatWrapper = ({ user }: { user: string }): React.ReactElement => { +const Chat = ({ user }: { user: string }): React.ReactElement => { const [messages, setMessages] = useState([]); let stompClientRef = useRef( new Client({ @@ -117,4 +117,4 @@ const ChatWrapper = ({ user }: { user: string }): React.ReactElement => { ); }; -export default ChatWrapper; +export default Chat; diff --git a/src/Chat/server.ts b/src/handlers/server.ts similarity index 96% rename from src/Chat/server.ts rename to src/handlers/server.ts index d155270..9c0d747 100644 --- a/src/Chat/server.ts +++ b/src/handlers/server.ts @@ -1,5 +1,5 @@ import { Client } from "@stomp/stompjs"; -import { Message, MessageType } from "./types"; +import { Message, MessageType } from "../Chat/types"; const domain = window.location.hostname const port = "8080" const connectionAddress = `ws://${domain}:${port}/ws`