From 246eabe4a46d2585d653738e46089ed2bfada8bd Mon Sep 17 00:00:00 2001 From: Wolfboy248 Date: Mon, 25 Aug 2025 09:36:51 +0200 Subject: Restructured sidebar and implemented links var --- frontend/src/components/Sidebar/Content.tsx | 117 +++++----------------------- 1 file changed, 19 insertions(+), 98 deletions(-) (limited to 'frontend/src/components/Sidebar/Content.tsx') diff --git a/frontend/src/components/Sidebar/Content.tsx b/frontend/src/components/Sidebar/Content.tsx index 4051b08..3d9533a 100644 --- a/frontend/src/components/Sidebar/Content.tsx +++ b/frontend/src/components/Sidebar/Content.tsx @@ -1,124 +1,45 @@ import React, { useRef } from "react"; -import { Link } from "react-router-dom"; +import { Link, useLocation } from "react-router-dom"; import { UserProfile } from "@customTypes/Profile"; -import { Search } from "@customTypes/Search"; -import { API } from "@api/Api"; import styles from "./Sidebar.module.css"; import { - FlagIcon, - HomeIcon, - PortalIcon, SearchIcon, } from "../../images/Images"; +import links from "./Links"; + interface ContentProps { profile?: UserProfile; + isSearching: boolean; + selectedButtonIndex: number isSidebarOpen: boolean; - sidebarButtonRefs: React.RefObject<(HTMLButtonElement | null)[]>; - getButtonClasses: (buttonIndex: number) => string; handle_sidebar_click: (clicked_sidebar_idx: number) => void; }; -const Content: React.FC = ({ profile, isSidebarOpen, sidebarButtonRefs, getButtonClasses, handle_sidebar_click }) => { - const [searchData, setSearchData] = React.useState( - undefined - ); - - const searchbarRef = useRef(null); - - const _handle_search_change = async (q: string) => { - const searchResponse = await API.get_search(q); - setSearchData(searchResponse); - }; - - const iconClasses = ""; +const _Content: React.FC = ({ profile, isSearching, selectedButtonIndex, isSidebarOpen, handle_sidebar_click }) => { return (
-
-
- Search - Search -
- -
- _handle_search_change(e.target.value)} - className="w-full p-2 bg-input text-foreground border border-border rounded-lg text-sm min-w-0" - /> - - {searchData && ( -
- {searchData?.maps.map((q, index) => ( - - {q.game} - {q.chapter} - {q.map} - - ))} - {searchData?.players.map((q, index) => ( - - pfp - - {q.user_name} - - - ))} -
- )} -
+
+
-
+