Skip to content

Commit

Permalink
Refactor chat layout and styles
Browse files Browse the repository at this point in the history
  • Loading branch information
etienne committed Feb 16, 2024
1 parent 2b6c279 commit 5392ac1
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion frontend/src/app/chat/[roomId]/ChatBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function Page() {
}, []);

return (
<div className="flex relative flex-col w-full h-screen space-x-2 space-y-2">
<div className="flex relative flex-col w-full h-screen">
<ChatHeader roomId={roomId} />
<ChatBody roomId={roomId} />
<ChatFooter roomId={roomId} />
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/app/chat/[roomId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ function Page() {
}, []);

return (
<div className="flex relative flex-col w-full h-screen">
<div
className="flex relative flex-col w-full h-screen"
style={{ height: "calc(100vh - 1rem)" }}
>
<ChatHeader roomId={roomId} />
<ChatBody roomId={roomId} />
<ChatFooter roomId={roomId} />
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/chat/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default function RoomLayout({
return (
<RoomProvider>
<SocketProvider>
<div className="flex h-screen space-x-2 space-y-2">
<div className="flex gap-2 m-2 overflow-auto">
<RoomSideBar />
{children}
</div>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

@layer utilities {
body.dark {
background-color: #222222; /* same as bg-gray-800 */
background-color: #161616; /* same as bg-gray-800 */
}
}
@layer base {
Expand Down
9 changes: 8 additions & 1 deletion frontend/src/components/Chat/ChatBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,14 @@ function ChatBody({ roomId }: { roomId: string }) {
}, [socket, roomId]);

return (
<div style={{ flexGrow: 1, overflowY: "auto" }}>
<div
style={{
flexGrow: 1,
overflowY: "auto",
overflowX: "auto",
height: "calc(100vh - 60px)",
}}
>
<div className="basis_[85%] overflow-y-scroll p-5 w-full flex flex-col gap-2 custom-scrollbar rounded-lg">
{messages[roomId]?.map((message: any, index: number) => (
<Message
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/components/Room/RoomSideBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ function RoomSideBar() {
}, [showAddRoomPanel]);

return (
<div className="overflow-y-scroll custom-scrollbar w-full sm:w-20 h-screen dark:bg-neutral-800 bg-slate-200 md:w-1/4 rounded-lg">
<div
className="overflow-y-scroll custom-scrollbar w-full sm:w-20 h-screen dark:bg-neutral-800 bg-slate-200 md:w-1/4 rounded-lg"
style={{ maxWidth: "25vw", height: "calc(100vh - 1rem)" }}
>
<div className="flex justify-center">
<button
type="submit"
Expand Down

0 comments on commit 5392ac1

Please sign in to comment.