diff --git a/frontend/src/app/(users)/chat/[id]/page.tsx b/frontend/src/app/(users)/chat/[id]/page.tsx index df866bf..af161a1 100644 --- a/frontend/src/app/(users)/chat/[id]/page.tsx +++ b/frontend/src/app/(users)/chat/[id]/page.tsx @@ -2,7 +2,7 @@ import { ContextUser, Room, UserContext } from "@/app/context/getUserContext"; import { useRouter, useParams, redirect } from "next/navigation"; import { FormEvent, useContext, useEffect, useState } from "react"; -import { SideBar } from "../page"; +import SideBar from "@/app/ui/chat/SideBar"; import FriendList from "@/app/ui/chat/FriendList"; import Image from "next/image"; import { SocketContext } from "@/app/context/SocketContext"; diff --git a/frontend/src/app/(users)/chat/page.tsx b/frontend/src/app/(users)/chat/page.tsx index 52b11fb..fc79426 100644 --- a/frontend/src/app/(users)/chat/page.tsx +++ b/frontend/src/app/(users)/chat/page.tsx @@ -33,88 +33,4 @@ export default function Chat() { resolve() }, [user]); if(location) return redirect(location); -} - -export function SideBar({ - username, - rooms, - handleFriend, - toggleFriendButton, - addFriend, - handleClick, - active, -}: { - username: string; - active: string; - handleFriend: () => void; - addFriend: (id: string) => void; - toggleFriendButton: boolean; - handleClick: (id: string) => void; - rooms: { roomId: string, id: string; username: string; imageUrl: string }[]; -}) { - const { id } = useParams(); - return ( -
-
-
-

Chats

- -
- -
-
- -
-
- ); -} +} \ No newline at end of file diff --git a/frontend/src/app/ui/chat/SideBar.tsx b/frontend/src/app/ui/chat/SideBar.tsx new file mode 100644 index 0000000..f343ec6 --- /dev/null +++ b/frontend/src/app/ui/chat/SideBar.tsx @@ -0,0 +1,88 @@ +import Image from "next/image"; +import { useParams } from "next/navigation"; +import { AddMessagePopup } from "./AddTalk"; + +export default function SideBar({ + username, + rooms, + handleFriend, + toggleFriendButton, + addFriend, + handleClick, + active, + }: { + username: string; + active: string; + handleFriend: () => void; + addFriend: (id: string) => void; + toggleFriendButton: boolean; + handleClick: (id: string) => void; + rooms: { roomId: string, id: string; username: string; imageUrl: string }[]; + }) { + const { id } = useParams(); + return ( +
+
+
+

Chats

+ +
+ +
+
+ +
+
+ ); + } + \ No newline at end of file