From 3f0655d280e744e685b5b449d716ff1443c93690 Mon Sep 17 00:00:00 2001 From: Wolfboy248 Date: Mon, 25 Aug 2025 09:47:23 +0200 Subject: Removed unnecessary imports --- frontend/src/components/Sidebar/Content.tsx | 9 +++------ frontend/src/components/Sidebar/Footer.tsx | 10 ++++------ frontend/src/components/Sidebar/Search.tsx | 3 +-- frontend/src/components/Sidebar/Sidebar.tsx | 15 +++++++-------- 4 files changed, 15 insertions(+), 22 deletions(-) (limited to 'frontend') diff --git a/frontend/src/components/Sidebar/Content.tsx b/frontend/src/components/Sidebar/Content.tsx index 3d9533a..ceb9e67 100644 --- a/frontend/src/components/Sidebar/Content.tsx +++ b/frontend/src/components/Sidebar/Content.tsx @@ -1,6 +1,5 @@ -import React, { useRef } from "react"; -import { Link, useLocation } from "react-router-dom"; -import { UserProfile } from "@customTypes/Profile"; +import React from "react"; +import { Link } from "react-router-dom"; import styles from "./Sidebar.module.css"; @@ -11,14 +10,12 @@ import { import links from "./Links"; interface ContentProps { - profile?: UserProfile; isSearching: boolean; selectedButtonIndex: number - isSidebarOpen: boolean; handle_sidebar_click: (clicked_sidebar_idx: number) => void; }; -const _Content: React.FC = ({ profile, isSearching, selectedButtonIndex, isSidebarOpen, handle_sidebar_click }) => { +const _Content: React.FC = ({ isSearching, selectedButtonIndex, handle_sidebar_click }) => { return (
diff --git a/frontend/src/components/Sidebar/Footer.tsx b/frontend/src/components/Sidebar/Footer.tsx index 8e910b3..3b0d543 100644 --- a/frontend/src/components/Sidebar/Footer.tsx +++ b/frontend/src/components/Sidebar/Footer.tsx @@ -4,12 +4,9 @@ import { Link } from "react-router-dom"; import styles from "./Sidebar.module.css"; import { UserProfile } from "@customTypes/Profile"; -import Login from "@components/Login"; import { UploadIcon, - BookIcon, - HelpIcon, } from "../../images/Images"; import links from "./Links"; @@ -19,12 +16,13 @@ interface FooterProps { isSearching: boolean; selectedButtonIndex: number; onUploadRun: () => void; - setProfile: React.Dispatch>; - setToken: React.Dispatch>; + // currently unused, but needed for login component + // setProfile: React.Dispatch>; + // setToken: React.Dispatch>; handle_sidebar_click: (clicked_sidebar_idx: number) => void; }; -const _Footer: React.FC = ({ profile, isSearching, selectedButtonIndex, onUploadRun, setToken, setProfile, handle_sidebar_click }) => { +const _Footer: React.FC = ({ profile, isSearching, selectedButtonIndex, onUploadRun, handle_sidebar_click }) => { const uploadRunRef = useRef(null); return ( diff --git a/frontend/src/components/Sidebar/Search.tsx b/frontend/src/components/Sidebar/Search.tsx index 0c6b868..00d9e1e 100644 --- a/frontend/src/components/Sidebar/Search.tsx +++ b/frontend/src/components/Sidebar/Search.tsx @@ -7,10 +7,9 @@ import { UserProfile } from "@customTypes/Profile"; interface SearchProps { profile?: UserProfile; - isSearching: boolean; }; -const _Search: React.FC = ({ profile, isSearching }) => { +const _Search: React.FC = ({ profile }) => { const [searchData, setSearchData] = React.useState( undefined ); diff --git a/frontend/src/components/Sidebar/Sidebar.tsx b/frontend/src/components/Sidebar/Sidebar.tsx index 1d58d2e..77e23a6 100644 --- a/frontend/src/components/Sidebar/Sidebar.tsx +++ b/frontend/src/components/Sidebar/Sidebar.tsx @@ -1,5 +1,5 @@ -import React, { useCallback, useRef } from "react"; -import { Link, useLocation } from "react-router-dom"; +import React, { useCallback } from "react"; +import { useLocation } from "react-router-dom"; import { UserProfile } from "@customTypes/Profile"; import _Header from "./Header"; @@ -10,19 +10,18 @@ import links from "./Links"; interface SidebarProps { setToken: React.Dispatch>; - profile?: UserProfile; setProfile: React.Dispatch>; + profile?: UserProfile; onUploadRun: () => void; } const Sidebar: React.FC = ({ setToken, - profile, setProfile, + profile, onUploadRun, }) => { const [isSearching, setIsSearching] = React.useState(false); - const [isSidebarOpen, setSidebarOpen] = React.useState(false); const [selectedButtonIndex, setSelectedButtonIndex] = React.useState(1); const location = useLocation(); @@ -67,14 +66,14 @@ const Sidebar: React.FC = ({
{/* Sidebar Content */} - <_Content profile={profile} isSearching={isSearching} selectedButtonIndex={selectedButtonIndex} isSidebarOpen={isSidebarOpen} handle_sidebar_click={handle_sidebar_click} /> + <_Content isSearching={isSearching} selectedButtonIndex={selectedButtonIndex} handle_sidebar_click={handle_sidebar_click} /> {/* Bottom Section */} - <_Footer profile={profile} isSearching={isSearching} selectedButtonIndex={selectedButtonIndex} onUploadRun={onUploadRun} setToken={setToken} setProfile={setProfile} handle_sidebar_click={handle_sidebar_click} /> + <_Footer profile={profile} isSearching={isSearching} selectedButtonIndex={selectedButtonIndex} onUploadRun={onUploadRun} handle_sidebar_click={handle_sidebar_click} />
- <_Search profile={profile} isSearching={isSearching} /> + <_Search profile={profile} />
-- cgit v1.2.3