From ddfe5015c9237fbe0fea44f8bcde31708eb3adac Mon Sep 17 00:00:00 2001 From: Wolfboy248 Date: Tue, 26 Aug 2025 08:20:51 +0200 Subject: Fixed some inconsistant styles and fixed category queryparam in maplist page --- frontend/src/components/Sidebar/Sidebar.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'frontend/src/components/Sidebar/Sidebar.tsx') diff --git a/frontend/src/components/Sidebar/Sidebar.tsx b/frontend/src/components/Sidebar/Sidebar.tsx index 77e23a6..f280a59 100644 --- a/frontend/src/components/Sidebar/Sidebar.tsx +++ b/frontend/src/components/Sidebar/Sidebar.tsx @@ -1,4 +1,4 @@ -import React, { useCallback } from "react"; +import React, { useCallback, useRef } from "react"; import { useLocation } from "react-router-dom"; import { UserProfile } from "@customTypes/Profile"; @@ -24,6 +24,8 @@ const Sidebar: React.FC = ({ const [isSearching, setIsSearching] = React.useState(false); const [selectedButtonIndex, setSelectedButtonIndex] = React.useState(1); + const searchbarRef = useRef(null); + const location = useLocation(); const path = location.pathname; @@ -34,6 +36,7 @@ const Sidebar: React.FC = ({ if (clicked_sidebar_idx == 0 && !isSearching) { if (!isSearching) { setIsSearching(true); + searchbarRef.current?.focus(); } } else { setIsSearching(false); @@ -57,13 +60,13 @@ const Sidebar: React.FC = ({ }, [path]); return ( -
{/* Header */} <_Header /> -
+
{/* Sidebar Content */} <_Content isSearching={isSearching} selectedButtonIndex={selectedButtonIndex} handle_sidebar_click={handle_sidebar_click} /> @@ -73,7 +76,7 @@ const Sidebar: React.FC = ({
- <_Search profile={profile} /> + <_Search profile={profile} searchbarRef={searchbarRef} />
-- cgit v1.2.3