diff options
| author | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2025-10-22 13:59:12 +0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-22 12:59:12 +0300 |
| commit | 69aeb7889ac136a8e4fbe7de1330298e30345479 (patch) | |
| tree | 6b2cd2d420105dc7ffad3c3649df359f634cae77 /frontend/src/components/Sidebar.tsx | |
| parent | feat/rankings: update wr for 3 maps (#279) (diff) | |
| download | lphub-69aeb7889ac136a8e4fbe7de1330298e30345479.tar.gz lphub-69aeb7889ac136a8e4fbe7de1330298e30345479.tar.bz2 lphub-69aeb7889ac136a8e4fbe7de1330298e30345479.zip | |
feat/frontend: switch to vite, update node to v22 (#281)
Diffstat (limited to 'frontend/src/components/Sidebar.tsx')
| -rw-r--r-- | frontend/src/components/Sidebar.tsx | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/frontend/src/components/Sidebar.tsx b/frontend/src/components/Sidebar.tsx index f972c6f..eef5bca 100644 --- a/frontend/src/components/Sidebar.tsx +++ b/frontend/src/components/Sidebar.tsx | |||
| @@ -1,11 +1,11 @@ | |||
| 1 | import React from 'react'; | 1 | import React from "react"; |
| 2 | import { Link, useLocation } from 'react-router-dom'; | 2 | import { Link, useLocation } from "react-router-dom"; |
| 3 | 3 | ||
| 4 | import { BookIcon, FlagIcon, HelpIcon, HomeIcon, LogoIcon, PortalIcon, SearchIcon, UploadIcon } from '@images/Images'; | 4 | import { BookIcon, FlagIcon, HelpIcon, HomeIcon, LogoIcon, PortalIcon, SearchIcon, UploadIcon } from "@images/Images"; |
| 5 | import Login from '@components/Login'; | 5 | import Login from "@components/Login"; |
| 6 | import { UserProfile } from '@customTypes/Profile'; | 6 | import { UserProfile } from "@customTypes/Profile"; |
| 7 | import { Search } from '@customTypes/Search'; | 7 | import { Search } from "@customTypes/Search"; |
| 8 | import { API } from '@api/Api'; | 8 | import { API } from "@api/Api"; |
| 9 | import "@css/Sidebar.css"; | 9 | import "@css/Sidebar.css"; |
| 10 | 10 | ||
| 11 | interface SidebarProps { | 11 | interface SidebarProps { |
| @@ -39,7 +39,7 @@ const Sidebar: React.FC<SidebarProps> = ({ setToken, profile, setProfile, onUplo | |||
| 39 | }; | 39 | }; |
| 40 | 40 | ||
| 41 | const _handle_sidebar_hide = () => { | 41 | const _handle_sidebar_hide = () => { |
| 42 | var btn = document.querySelectorAll("button.sidebar-button") as NodeListOf<HTMLElement> | 42 | const btn = document.querySelectorAll("button.sidebar-button") as NodeListOf<HTMLElement> |
| 43 | const span = document.querySelectorAll("button.sidebar-button>span") as NodeListOf<HTMLElement> | 43 | const span = document.querySelectorAll("button.sidebar-button>span") as NodeListOf<HTMLElement> |
| 44 | const side = document.querySelector("#sidebar-list") as HTMLElement; | 44 | const side = document.querySelector("#sidebar-list") as HTMLElement; |
| 45 | const searchbar = document.querySelector("#searchbar") as HTMLInputElement; | 45 | const searchbar = document.querySelector("#searchbar") as HTMLInputElement; |
| @@ -140,13 +140,13 @@ const Sidebar: React.FC<SidebarProps> = ({ setToken, profile, setProfile, onUplo | |||
| 140 | </div> | 140 | </div> |
| 141 | </div> | 141 | </div> |
| 142 | </Link> | 142 | </Link> |
| 143 | <button id='hamburger-menu' onClick={_toggle_mobile_menu} className={isMobileMenuOpen ? 'open' : ''}> | 143 | <button id='hamburger-menu' onClick={_toggle_mobile_menu} className={isMobileMenuOpen ? "open" : ""}> |
| 144 | <span></span> | 144 | <span></span> |
| 145 | <span></span> | 145 | <span></span> |
| 146 | <span></span> | 146 | <span></span> |
| 147 | </button> | 147 | </button> |
| 148 | </div> | 148 | </div> |
| 149 | <div id='sidebar' className={isMobileMenuOpen ? 'mobile-open' : ''}> | 149 | <div id='sidebar' className={isMobileMenuOpen ? "mobile-open" : ""}> |
| 150 | <Link to="/" tabIndex={-1}> | 150 | <Link to="/" tabIndex={-1}> |
| 151 | <div id='logo'> {/* logo */} | 151 | <div id='logo'> {/* logo */} |
| 152 | <img src={LogoIcon} alt="" height={"80px"} /> | 152 | <img src={LogoIcon} alt="" height={"80px"} /> |
| @@ -204,7 +204,7 @@ const Sidebar: React.FC<SidebarProps> = ({ setToken, profile, setProfile, onUplo | |||
| 204 | </Link> | 204 | </Link> |
| 205 | </div> | 205 | </div> |
| 206 | </div> | 206 | </div> |
| 207 | <div id='search-panel' className={isMobileSearchOpen ? 'mobile-search-open' : ''}> | 207 | <div id='search-panel' className={isMobileSearchOpen ? "mobile-search-open" : ""}> |
| 208 | <input type="text" id='searchbar' placeholder='Search for map or a player...' onChange={(e) => _handle_search_change(e.target.value)} /> | 208 | <input type="text" id='searchbar' placeholder='Search for map or a player...' onChange={(e) => _handle_search_change(e.target.value)} /> |
| 209 | <div className='mobile-search-header'> | 209 | <div className='mobile-search-header'> |
| 210 | <button className='mobile-search-close' onClick={_close_mobile_search}>✕</button> | 210 | <button className='mobile-search-close' onClick={_close_mobile_search}>✕</button> |
| @@ -220,15 +220,15 @@ const Sidebar: React.FC<SidebarProps> = ({ setToken, profile, setProfile, onUplo | |||
| 220 | </Link> | 220 | </Link> |
| 221 | ))} | 221 | ))} |
| 222 | {searchData?.players.map((q, index) => | 222 | {searchData?.players.map((q, index) => |
| 223 | ( | 223 | ( |
| 224 | <Link to={ | 224 | <Link to={ |
| 225 | profile && q.steam_id === profile.steam_id ? `/profile` : | 225 | profile && q.steam_id === profile.steam_id ? "/profile" : |
| 226 | `/users/${q.steam_id}` | 226 | `/users/${q.steam_id}` |
| 227 | } className='search-player' key={index} onClick={_close_mobile_search}> | 227 | } className='search-player' key={index} onClick={_close_mobile_search}> |
| 228 | <img src={q.avatar_link} alt='pfp'></img> | 228 | <img src={q.avatar_link} alt='pfp'></img> |
| 229 | <span style={{ fontSize: `${36 - q.user_name.length * 0.8}px` }}>{q.user_name}</span> | 229 | <span style={{ fontSize: `${36 - q.user_name.length * 0.8}px` }}>{q.user_name}</span> |
| 230 | </Link> | 230 | </Link> |
| 231 | ))} | 231 | ))} |
| 232 | 232 | ||
| 233 | </div> | 233 | </div> |
| 234 | </div> | 234 | </div> |