diff options
| author | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2025-10-22 16:09:09 +0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-22 15:09:09 +0300 |
| commit | 4dd315f21f2c204be71ef1859aa2412233420517 (patch) | |
| tree | 95831f985e9cef3a5385f51eafb443121dd069b4 /frontend/src/components/Sidebar.tsx | |
| parent | fix/frontend: use API url based on environment (#282) (diff) | |
| download | lphub-4dd315f21f2c204be71ef1859aa2412233420517.tar.gz lphub-4dd315f21f2c204be71ef1859aa2412233420517.tar.bz2 lphub-4dd315f21f2c204be71ef1859aa2412233420517.zip | |
feat/frontend: tidy up records view on mobile (#283)
Diffstat (limited to 'frontend/src/components/Sidebar.tsx')
| -rw-r--r-- | frontend/src/components/Sidebar.tsx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/frontend/src/components/Sidebar.tsx b/frontend/src/components/Sidebar.tsx index eef5bca..c45ec27 100644 --- a/frontend/src/components/Sidebar.tsx +++ b/frontend/src/components/Sidebar.tsx | |||
| @@ -105,6 +105,11 @@ const Sidebar: React.FC<SidebarProps> = ({ setToken, profile, setProfile, onUplo | |||
| 105 | setIsMobileSearchOpen(false); | 105 | setIsMobileSearchOpen(false); |
| 106 | }; | 106 | }; |
| 107 | 107 | ||
| 108 | const _close_mobile_search_and_menu = () => { | ||
| 109 | setIsMobileSearchOpen(false); | ||
| 110 | setIsMobileMenuOpen(false); | ||
| 111 | }; | ||
| 112 | |||
| 108 | const _handle_search_change = async (q: string) => { | 113 | const _handle_search_change = async (q: string) => { |
| 109 | const searchResponse = await API.get_search(q); | 114 | const searchResponse = await API.get_search(q); |
| 110 | setSearchData(searchResponse); | 115 | setSearchData(searchResponse); |
| @@ -213,7 +218,7 @@ const Sidebar: React.FC<SidebarProps> = ({ setToken, profile, setProfile, onUplo | |||
| 213 | <div id='search-data'> | 218 | <div id='search-data'> |
| 214 | 219 | ||
| 215 | {searchData?.maps.map((q, index) => ( | 220 | {searchData?.maps.map((q, index) => ( |
| 216 | <Link to={`/maps/${q.id}`} className='search-map' key={index} onClick={_close_mobile_search}> | 221 | <Link to={`/maps/${q.id}`} className='search-map' key={index} onClick={_close_mobile_search_and_menu}> |
| 217 | <span>{q.game}</span> | 222 | <span>{q.game}</span> |
| 218 | <span>{q.chapter}</span> | 223 | <span>{q.chapter}</span> |
| 219 | <span>{q.map}</span> | 224 | <span>{q.map}</span> |
| @@ -224,7 +229,7 @@ const Sidebar: React.FC<SidebarProps> = ({ setToken, profile, setProfile, onUplo | |||
| 224 | <Link to={ | 229 | <Link to={ |
| 225 | profile && q.steam_id === profile.steam_id ? "/profile" : | 230 | profile && q.steam_id === profile.steam_id ? "/profile" : |
| 226 | `/users/${q.steam_id}` | 231 | `/users/${q.steam_id}` |
| 227 | } className='search-player' key={index} onClick={_close_mobile_search}> | 232 | } className='search-player' key={index} onClick={_close_mobile_search_and_menu}> |
| 228 | <img src={q.avatar_link} alt='pfp'></img> | 233 | <img src={q.avatar_link} alt='pfp'></img> |
| 229 | <span style={{ fontSize: `${36 - q.user_name.length * 0.8}px` }}>{q.user_name}</span> | 234 | <span style={{ fontSize: `${36 - q.user_name.length * 0.8}px` }}>{q.user_name}</span> |
| 230 | </Link> | 235 | </Link> |