aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/components/Sidebar
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/components/Sidebar')
-rw-r--r--frontend/src/components/Sidebar/Content.tsx9
-rw-r--r--frontend/src/components/Sidebar/Footer.tsx10
-rw-r--r--frontend/src/components/Sidebar/Search.tsx3
-rw-r--r--frontend/src/components/Sidebar/Sidebar.tsx15
4 files changed, 15 insertions, 22 deletions
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 @@
1import React, { useRef } from "react"; 1import React from "react";
2import { Link, useLocation } from "react-router-dom"; 2import { Link } from "react-router-dom";
3import { UserProfile } from "@customTypes/Profile";
4 3
5import styles from "./Sidebar.module.css"; 4import styles from "./Sidebar.module.css";
6 5
@@ -11,14 +10,12 @@ import {
11import links from "./Links"; 10import links from "./Links";
12 11
13interface ContentProps { 12interface ContentProps {
14 profile?: UserProfile;
15 isSearching: boolean; 13 isSearching: boolean;
16 selectedButtonIndex: number 14 selectedButtonIndex: number
17 isSidebarOpen: boolean;
18 handle_sidebar_click: (clicked_sidebar_idx: number) => void; 15 handle_sidebar_click: (clicked_sidebar_idx: number) => void;
19}; 16};
20 17
21const _Content: React.FC<ContentProps> = ({ profile, isSearching, selectedButtonIndex, isSidebarOpen, handle_sidebar_click }) => { 18const _Content: React.FC<ContentProps> = ({ isSearching, selectedButtonIndex, handle_sidebar_click }) => {
22 19
23 return ( 20 return (
24 <div className="h-full"> 21 <div className="h-full">
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";
4import styles from "./Sidebar.module.css"; 4import styles from "./Sidebar.module.css";
5 5
6import { UserProfile } from "@customTypes/Profile"; 6import { UserProfile } from "@customTypes/Profile";
7import Login from "@components/Login";
8 7
9import { 8import {
10 UploadIcon, 9 UploadIcon,
11 BookIcon,
12 HelpIcon,
13} from "../../images/Images"; 10} from "../../images/Images";
14 11
15import links from "./Links"; 12import links from "./Links";
@@ -19,12 +16,13 @@ interface FooterProps {
19 isSearching: boolean; 16 isSearching: boolean;
20 selectedButtonIndex: number; 17 selectedButtonIndex: number;
21 onUploadRun: () => void; 18 onUploadRun: () => void;
22 setProfile: React.Dispatch<React.SetStateAction<UserProfile | undefined>>; 19 // currently unused, but needed for login component
23 setToken: React.Dispatch<React.SetStateAction<string | undefined>>; 20 // setProfile: React.Dispatch<React.SetStateAction<UserProfile | undefined>>;
21 // setToken: React.Dispatch<React.SetStateAction<string | undefined>>;
24 handle_sidebar_click: (clicked_sidebar_idx: number) => void; 22 handle_sidebar_click: (clicked_sidebar_idx: number) => void;
25}; 23};
26 24
27const _Footer: React.FC<FooterProps> = ({ profile, isSearching, selectedButtonIndex, onUploadRun, setToken, setProfile, handle_sidebar_click }) => { 25const _Footer: React.FC<FooterProps> = ({ profile, isSearching, selectedButtonIndex, onUploadRun, handle_sidebar_click }) => {
28 const uploadRunRef = useRef<HTMLButtonElement>(null); 26 const uploadRunRef = useRef<HTMLButtonElement>(null);
29 27
30 return ( 28 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";
7 7
8interface SearchProps { 8interface SearchProps {
9 profile?: UserProfile; 9 profile?: UserProfile;
10 isSearching: boolean;
11}; 10};
12 11
13const _Search: React.FC<SearchProps> = ({ profile, isSearching }) => { 12const _Search: React.FC<SearchProps> = ({ profile }) => {
14 const [searchData, setSearchData] = React.useState<Search | undefined>( 13 const [searchData, setSearchData] = React.useState<Search | undefined>(
15 undefined 14 undefined
16 ); 15 );
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 @@
1import React, { useCallback, useRef } from "react"; 1import React, { useCallback } from "react";
2import { Link, useLocation } from "react-router-dom"; 2import { useLocation } from "react-router-dom";
3import { UserProfile } from "@customTypes/Profile"; 3import { UserProfile } from "@customTypes/Profile";
4 4
5import _Header from "./Header"; 5import _Header from "./Header";
@@ -10,19 +10,18 @@ import links from "./Links";
10 10
11interface SidebarProps { 11interface SidebarProps {
12 setToken: React.Dispatch<React.SetStateAction<string | undefined>>; 12 setToken: React.Dispatch<React.SetStateAction<string | undefined>>;
13 profile?: UserProfile;
14 setProfile: React.Dispatch<React.SetStateAction<UserProfile | undefined>>; 13 setProfile: React.Dispatch<React.SetStateAction<UserProfile | undefined>>;
14 profile?: UserProfile;
15 onUploadRun: () => void; 15 onUploadRun: () => void;
16} 16}
17 17
18const Sidebar: React.FC<SidebarProps> = ({ 18const Sidebar: React.FC<SidebarProps> = ({
19 setToken, 19 setToken,
20 profile,
21 setProfile, 20 setProfile,
21 profile,
22 onUploadRun, 22 onUploadRun,
23}) => { 23}) => {
24 const [isSearching, setIsSearching] = React.useState<boolean>(false); 24 const [isSearching, setIsSearching] = React.useState<boolean>(false);
25 const [isSidebarOpen, setSidebarOpen] = React.useState<boolean>(false);
26 const [selectedButtonIndex, setSelectedButtonIndex] = React.useState<number>(1); 25 const [selectedButtonIndex, setSelectedButtonIndex] = React.useState<number>(1);
27 26
28 const location = useLocation(); 27 const location = useLocation();
@@ -67,14 +66,14 @@ const Sidebar: React.FC<SidebarProps> = ({
67 <div className="flex flex-1 overflow-hidden w-full not-md:hidden "> 66 <div className="flex flex-1 overflow-hidden w-full not-md:hidden ">
68 <div className={`flex flex-col transition-all duration-300 ${isSearching ? "w-[64px]" : "w-full"}`}> 67 <div className={`flex flex-col transition-all duration-300 ${isSearching ? "w-[64px]" : "w-full"}`}>
69 {/* Sidebar Content */} 68 {/* Sidebar Content */}
70 <_Content profile={profile} isSearching={isSearching} selectedButtonIndex={selectedButtonIndex} isSidebarOpen={isSidebarOpen} handle_sidebar_click={handle_sidebar_click} /> 69 <_Content isSearching={isSearching} selectedButtonIndex={selectedButtonIndex} handle_sidebar_click={handle_sidebar_click} />
71 70
72 {/* Bottom Section */} 71 {/* Bottom Section */}
73 <_Footer profile={profile} isSearching={isSearching} selectedButtonIndex={selectedButtonIndex} onUploadRun={onUploadRun} setToken={setToken} setProfile={setProfile} handle_sidebar_click={handle_sidebar_click} /> 72 <_Footer profile={profile} isSearching={isSearching} selectedButtonIndex={selectedButtonIndex} onUploadRun={onUploadRun} handle_sidebar_click={handle_sidebar_click} />
74 </div> 73 </div>
75 74
76 <div className={`flex bg-panel ${isSearching ? 'w-full' : "w-0"}`}> 75 <div className={`flex bg-panel ${isSearching ? 'w-full' : "w-0"}`}>
77 <_Search profile={profile} isSearching={isSearching} /> 76 <_Search profile={profile} />
78 </div> 77 </div>
79 78
80 </div> 79 </div>