aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/App.tsx4
-rw-r--r--src/Chat/Chat.tsx (renamed from src/Chat/ChatWrapper.tsx)4
-rw-r--r--src/handlers/server.ts (renamed from src/Chat/server.ts)2
3 files changed, 5 insertions, 5 deletions
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 <MessageContainer {...message} />;
})}
{
- <ChatWrapper
+ <Chat
user={username as string}
/>
}
diff --git a/src/Chat/ChatWrapper.tsx b/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<ReactElement[]>([]);
let stompClientRef = useRef(
new Client({
@@ -117,4 +117,4 @@ const ChatWrapper = ({ user }: { user: string }): React.ReactElement => {
</div>
);
};
-export default ChatWrapper;
+export default Chat;
diff --git a/src/Chat/server.ts b/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`