From 7d11e8158115bef1ae55d996ab01480d416d98f3 Mon Sep 17 00:00:00 2001 From: Chris-1010 <122332721@umail.ucc.ie> Date: Sat, 1 Feb 2025 15:20:35 +0000 Subject: [PATCH] UPDATE: Refactored ChatPanel and VideoPlayer layout for improved responsiveness and user experience --- frontend/src/components/Video/ChatPanel.tsx | 24 +++++++++---------- frontend/src/components/Video/VideoPlayer.tsx | 2 +- frontend/src/pages/VideoPage.tsx | 7 +++--- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/frontend/src/components/Video/ChatPanel.tsx b/frontend/src/components/Video/ChatPanel.tsx index 9a28b6e..6e415ea 100644 --- a/frontend/src/components/Video/ChatPanel.tsx +++ b/frontend/src/components/Video/ChatPanel.tsx @@ -123,7 +123,7 @@ const ChatPanel: React.FC = ({ streamId }) => { {isChatVisible ? "Hide Chat" : "Show Chat"} @@ -139,11 +139,8 @@ const ChatPanel: React.FC = ({ streamId }) => { {messages.map((msg, index) => (
- - {new Date(msg.time_sent).toLocaleTimeString()} - = ({ streamId }) => { {" "} {msg.chatter_username}:{" "} - {msg.message} + {msg.message} + + {new Date(msg.time_sent).toLocaleTimeString()} +
))}
- {isLoggedIn && ( + {isLoggedIn ? ( <> = ({ streamId }) => { Send - )} - - {!isLoggedIn && ( + ) : ( + > + Login to Chat + )}
{showAuthModal && ( diff --git a/frontend/src/components/Video/VideoPlayer.tsx b/frontend/src/components/Video/VideoPlayer.tsx index bd34642..c2fb867 100644 --- a/frontend/src/components/Video/VideoPlayer.tsx +++ b/frontend/src/components/Video/VideoPlayer.tsx @@ -53,7 +53,7 @@ const VideoPlayer: React.FC = ({ streamId }) => {
diff --git a/frontend/src/pages/VideoPage.tsx b/frontend/src/pages/VideoPage.tsx index afb5561..f998e3f 100644 --- a/frontend/src/pages/VideoPage.tsx +++ b/frontend/src/pages/VideoPage.tsx @@ -77,18 +77,19 @@ const VideoPage: React.FC = ({ streamId }) => {
-
+

{streamData ? streamData.streamTitle : "Loading..."}