aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/components/Sidebar.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/components/Sidebar.tsx')
-rw-r--r--frontend/src/components/Sidebar.tsx9
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>