From f43404552343a777c0439e65265bd0db46f11d0a Mon Sep 17 00:00:00 2001 From: Chris-1010 <122332721@umail.ucc.ie> Date: Sun, 2 Mar 2025 16:04:17 +0000 Subject: [PATCH] REFACTOR: Update style of editing profile picture; FIX: Correctly position stream error UI --- .../src/components/Stream/VideoPlayer.tsx | 15 +++++++---- frontend/src/pages/UserPage.tsx | 25 +++++++++---------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/frontend/src/components/Stream/VideoPlayer.tsx b/frontend/src/components/Stream/VideoPlayer.tsx index b27ec26..c591fa1 100644 --- a/frontend/src/components/Stream/VideoPlayer.tsx +++ b/frontend/src/components/Stream/VideoPlayer.tsx @@ -68,11 +68,13 @@ const VideoPlayer: React.FC = ({ streamer, extraClasses = "", // Custom error UI const errorElement = document.createElement("div"); - errorElement.className = "absolute top-0 left-0 right-0 flex flex-col items-center justify-center h-full bg-gray-800 text-white p-4 rounded"; + errorElement.className = + "absolute top-0 left-0 right-0 flex flex-col items-center justify-center h-full w-full bg-gray-800 text-white text-center p-4 rounded"; errorElement.innerHTML = ` -
Stream Currently Unavailable
-
The streamer may be offline
- `; +
Stream Currently Unavailable
+ ${window.location.href.includes("dashboard") ? "" : "
The streamer may be offline
"} +

Retrying...

+ `; videoRef.current.appendChild(errorElement); } @@ -113,7 +115,10 @@ const VideoPlayer: React.FC = ({ streamer, extraClasses = "", }, [streamerName]); return ( -
+
); diff --git a/frontend/src/pages/UserPage.tsx b/frontend/src/pages/UserPage.tsx index aac3c9c..ee3381c 100644 --- a/frontend/src/pages/UserPage.tsx +++ b/frontend/src/pages/UserPage.tsx @@ -9,7 +9,7 @@ import Button from "../components/Input/Button"; import DynamicPageContent from "../components/Layout/DynamicPageContent"; import LoadingScreen from "../components/Layout/LoadingScreen"; import { StreamListItem } from "../components/Layout/ListItem"; -import { CameraIcon } from "lucide-react"; +import { EditIcon } from "lucide-react"; import { getCategoryThumbnail } from "../utils/thumbnailUtils"; import { useSameUser } from "../hooks/useSameUser"; @@ -142,14 +142,16 @@ const UserPage: React.FC = () => {
{/* Profile Picture */}
-