diff options
| author | Wolfboy248 <georgejvindkarlsen@gmail.com> | 2025-08-21 10:33:27 +0200 |
|---|---|---|
| committer | Wolfboy248 <georgejvindkarlsen@gmail.com> | 2025-08-21 10:33:27 +0200 |
| commit | da1fd74f9387149b2b94d62853587a8afdb74ddd (patch) | |
| tree | 57f13021890b6d27848a3379d0869790fd1d7c97 /frontend/src/components/Sidebar/Footer.tsx | |
| parent | organised pages, started work on theme (diff) | |
| download | lphub-da1fd74f9387149b2b94d62853587a8afdb74ddd.tar.gz lphub-da1fd74f9387149b2b94d62853587a8afdb74ddd.tar.bz2 lphub-da1fd74f9387149b2b94d62853587a8afdb74ddd.zip | |
Reorganised Maplist and Sidebar
Diffstat (limited to 'frontend/src/components/Sidebar/Footer.tsx')
| -rw-r--r-- | frontend/src/components/Sidebar/Footer.tsx | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/frontend/src/components/Sidebar/Footer.tsx b/frontend/src/components/Sidebar/Footer.tsx new file mode 100644 index 0000000..070301a --- /dev/null +++ b/frontend/src/components/Sidebar/Footer.tsx | |||
| @@ -0,0 +1,80 @@ | |||
| 1 | import React, { useRef } from "react"; | ||
| 2 | import { Link } from "react-router-dom"; | ||
| 3 | |||
| 4 | import styles from "./Sidebar.module.css"; | ||
| 5 | |||
| 6 | import { UserProfile } from "@customTypes/Profile"; | ||
| 7 | import Login from "@components/Login"; | ||
| 8 | |||
| 9 | import { | ||
| 10 | UploadIcon, | ||
| 11 | BookIcon, | ||
| 12 | HelpIcon, | ||
| 13 | } from "../../images/Images"; | ||
| 14 | |||
| 15 | interface FooterProps { | ||
| 16 | profile?: UserProfile; | ||
| 17 | onUploadRun: () => void; | ||
| 18 | setProfile: React.Dispatch<React.SetStateAction<UserProfile | undefined>>; | ||
| 19 | setToken: React.Dispatch<React.SetStateAction<string | undefined>>; | ||
| 20 | sidebarButtonRefs: React.RefObject<(HTMLButtonElement | null)[]>; | ||
| 21 | getButtonClasses: (buttonIndex: number) => string; | ||
| 22 | handle_sidebar_click: (clicked_sidebar_idx: number) => void; | ||
| 23 | }; | ||
| 24 | |||
| 25 | const Footer: React.FC<FooterProps> = ({ profile, onUploadRun, setToken, setProfile, sidebarButtonRefs, getButtonClasses, handle_sidebar_click }) => { | ||
| 26 | const uploadRunRef = useRef<HTMLButtonElement>(null); | ||
| 27 | |||
| 28 | return ( | ||
| 29 | <div className=""> | ||
| 30 | {profile && profile.profile && ( | ||
| 31 | <button | ||
| 32 | ref={uploadRunRef} | ||
| 33 | id="upload-run" | ||
| 34 | className={getButtonClasses(-1)} | ||
| 35 | onClick={() => onUploadRun()} | ||
| 36 | > | ||
| 37 | <img src={UploadIcon} alt="Upload" className={``} /> | ||
| 38 | {true && <span className="font-[--font-barlow-semicondensed-regular] truncate">Upload Record</span>} | ||
| 39 | </button> | ||
| 40 | )} | ||
| 41 | |||
| 42 | <div className={true ? 'min-w-0' : 'flex justify-center'}> | ||
| 43 | <Login | ||
| 44 | setToken={setToken} | ||
| 45 | profile={profile} | ||
| 46 | setProfile={setProfile} | ||
| 47 | isOpen={true} | ||
| 48 | /> | ||
| 49 | </div> | ||
| 50 | |||
| 51 | <Link to="/rules" tabIndex={-1}> | ||
| 52 | <button | ||
| 53 | ref={el => { | ||
| 54 | sidebarButtonRefs.current[5] = el | ||
| 55 | }} | ||
| 56 | className={`${styles.button}`} | ||
| 57 | onClick={() => handle_sidebar_click(5)} | ||
| 58 | > | ||
| 59 | <img src={BookIcon} alt="Rules" /> | ||
| 60 | {true && <span className="font-[--font-barlow-semicondensed-regular] truncate">Leaderboard Rules</span>} | ||
| 61 | </button> | ||
| 62 | </Link> | ||
| 63 | |||
| 64 | <Link to="/about" tabIndex={-1}> | ||
| 65 | <button | ||
| 66 | ref={el => { | ||
| 67 | sidebarButtonRefs.current[6] = el | ||
| 68 | }} | ||
| 69 | className={`${styles.button}`} | ||
| 70 | onClick={() => handle_sidebar_click(6)} | ||
| 71 | > | ||
| 72 | <img src={HelpIcon} alt="About" /> | ||
| 73 | {true && <span className="font-[--font-barlow-semicondensed-regular] truncate">About LPHUB</span>} | ||
| 74 | </button> | ||
| 75 | </Link> | ||
| 76 | </div> | ||
| 77 | ); | ||
| 78 | } | ||
| 79 | |||
| 80 | export default Footer; | ||