From 4a27f69776a0ceee0ece8f0eae20e3797ab795ec Mon Sep 17 00:00:00 2001 From: JustIceO7 Date: Thu, 6 Mar 2025 18:49:51 +0000 Subject: [PATCH] UPDATE: Added navigation to streamers page on sidebar UPDATE: Added text to following page for no search results --- .../src/components/Navigation/Sidebar.tsx | 5 +- frontend/src/pages/Following.tsx | 111 +++++++++--------- 2 files changed, 59 insertions(+), 57 deletions(-) diff --git a/frontend/src/components/Navigation/Sidebar.tsx b/frontend/src/components/Navigation/Sidebar.tsx index a718700..7542015 100644 --- a/frontend/src/components/Navigation/Sidebar.tsx +++ b/frontend/src/components/Navigation/Sidebar.tsx @@ -111,11 +111,12 @@ const Sidebar: React.FC = ({ extraClasses = "" }) => {
(e.currentTarget.style.boxShadow = "var(--follow-shadow)")} onMouseLeave={(e) => (e.currentTarget.style.boxShadow = "none")} + onClick={() => (window.location.href = `/user/${username}/following?tab=streamers`)} > -

Following

+

Following

Streamers

diff --git a/frontend/src/pages/Following.tsx b/frontend/src/pages/Following.tsx index 08b7999..60bac8b 100644 --- a/frontend/src/pages/Following.tsx +++ b/frontend/src/pages/Following.tsx @@ -89,67 +89,68 @@ const Following: React.FC = ({ extraClasses = "" }) => { className={`w-[96vw] h-full bg-slate-50/35 rounded-lg overflow-x-hidden flex flex-col text-center scrollbar-hide transition-all duration-500 ease-in-out ${extraClasses}`} > {activeTab === "streamers" && ( -
- {followedStreamers.map((streamer: any) => ( - -
- - {/* Profile Picture */} - {`${streamer.username}'s { - e.currentTarget.onerror = null; - e.currentTarget.src = "/default-profile.png"; // Fallback if image fails to load - }} - /> - - {/* Username */} -

{streamer.username}

- - {/* Follow/Unfollow Button */} - +
+ {followedStreamers.length > 0 ? ( +
+ {followedStreamers.map((streamer: any) => ( +
+ {`${streamer.username}'s { + e.currentTarget.onerror = null; + e.currentTarget.src = "/default-profile.png"; + }} + /> +

{streamer.username}

+ +
+ ))}
- ))} + ) : ( +

No followed streamers.

+ )}
)} - {activeTab === "categories" && ( -
- {followedCategories.map((category) => { - return ( -
navigate(`/category/${category.category_name}`)} - > - - {category.category_name} -
- {category.category_name} -
-
- ) - })} + {activeTab === "categories" && ( +
+ {followedCategories.length > 0 ? ( +
+ {followedCategories.map((category) => ( +
navigate(`/category/${category.category_name}`)} + > + + {category.category_name} +
+ {category.category_name} +
+
+ ))} +
+ ) : ( +

No followed categories.

+ )}
- )}; + )}