From 4dd315f21f2c204be71ef1859aa2412233420517 Mon Sep 17 00:00:00 2001
From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>
Date: Wed, 22 Oct 2025 16:09:09 +0400
Subject: feat/frontend: tidy up records view on mobile (#283)

---
 frontend/src/components/Sidebar.tsx | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

(limited to 'frontend/src/components/Sidebar.tsx')

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
     setIsMobileSearchOpen(false);
   };
 
+  const _close_mobile_search_and_menu = () => {
+    setIsMobileSearchOpen(false);
+    setIsMobileMenuOpen(false);
+  };
+
   const _handle_search_change = async (q: string) => {
     const searchResponse = await API.get_search(q);
     setSearchData(searchResponse);
@@ -213,7 +218,7 @@ const Sidebar: React.FC<SidebarProps> = ({ setToken, profile, setProfile, onUplo
           <div id='search-data'>
 
             {searchData?.maps.map((q, index) => (
-              <Link to={`/maps/${q.id}`} className='search-map' key={index} onClick={_close_mobile_search}>
+              <Link to={`/maps/${q.id}`} className='search-map' key={index} onClick={_close_mobile_search_and_menu}>
                 <span>{q.game}</span>
                 <span>{q.chapter}</span>
                 <span>{q.map}</span>
@@ -224,7 +229,7 @@ const Sidebar: React.FC<SidebarProps> = ({ setToken, profile, setProfile, onUplo
                 <Link to={
                   profile && q.steam_id === profile.steam_id ? "/profile" :
                     `/users/${q.steam_id}`
-                } className='search-player' key={index} onClick={_close_mobile_search}>
+                } className='search-player' key={index} onClick={_close_mobile_search_and_menu}>
                   <img src={q.avatar_link} alt='pfp'></img>
                   <span style={{ fontSize: `${36 - q.user_name.length * 0.8}px` }}>{q.user_name}</span>
                 </Link>
-- 
cgit v1.2.3

