diff options
| author | Wolfboy248 <georgejvindkarlsen@gmail.com> | 2025-08-26 08:20:51 +0200 |
|---|---|---|
| committer | Wolfboy248 <georgejvindkarlsen@gmail.com> | 2025-08-26 08:20:51 +0200 |
| commit | ddfe5015c9237fbe0fea44f8bcde31708eb3adac (patch) | |
| tree | db7d9812461c0ab0dc39812465f20bc958f9bf67 /frontend/src/components/Sidebar/Search.tsx | |
| parent | Moved breadcrum navigation into its own component (diff) | |
| download | lphub-ddfe5015c9237fbe0fea44f8bcde31708eb3adac.tar.gz lphub-ddfe5015c9237fbe0fea44f8bcde31708eb3adac.tar.bz2 lphub-ddfe5015c9237fbe0fea44f8bcde31708eb3adac.zip | |
Fixed some inconsistant styles and fixed category queryparam in maplist pagecss
Diffstat (limited to '')
| -rw-r--r-- | frontend/src/components/Sidebar/Search.tsx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/frontend/src/components/Sidebar/Search.tsx b/frontend/src/components/Sidebar/Search.tsx index 00d9e1e..49bcec7 100644 --- a/frontend/src/components/Sidebar/Search.tsx +++ b/frontend/src/components/Sidebar/Search.tsx | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | import React, { useRef } from "react"; | 1 | import React from "react"; |
| 2 | import { Link } from "react-router-dom"; | 2 | import { Link } from "react-router-dom"; |
| 3 | 3 | ||
| 4 | import { Search } from "@customTypes/Search"; | 4 | import { Search } from "@customTypes/Search"; |
| @@ -7,21 +7,20 @@ import { UserProfile } from "@customTypes/Profile"; | |||
| 7 | 7 | ||
| 8 | interface SearchProps { | 8 | interface SearchProps { |
| 9 | profile?: UserProfile; | 9 | profile?: UserProfile; |
| 10 | searchbarRef: React.RefObject<HTMLInputElement | null>; | ||
| 10 | }; | 11 | }; |
| 11 | 12 | ||
| 12 | const _Search: React.FC<SearchProps> = ({ profile }) => { | 13 | const _Search: React.FC<SearchProps> = ({ profile, searchbarRef }) => { |
| 13 | const [searchData, setSearchData] = React.useState<Search | undefined>( | 14 | const [searchData, setSearchData] = React.useState<Search | undefined>( |
| 14 | undefined | 15 | undefined |
| 15 | ); | 16 | ); |
| 16 | 17 | ||
| 17 | const searchbarRef = useRef<HTMLInputElement>(null); | ||
| 18 | |||
| 19 | const _handle_search_change = async (q: string) => { | 18 | const _handle_search_change = async (q: string) => { |
| 20 | const searchResponse = await API.get_search(q); | 19 | const searchResponse = await API.get_search(q); |
| 21 | setSearchData(searchResponse); | 20 | setSearchData(searchResponse); |
| 22 | }; | 21 | }; |
| 23 | return ( | 22 | return ( |
| 24 | <div className="flex w-full flex-col justify-between p-3"> | 23 | <div className="flex w-full flex-col p-3 not-md:absolute"> |
| 25 | <input | 24 | <input |
| 26 | ref={searchbarRef} | 25 | ref={searchbarRef} |
| 27 | type="text" | 26 | type="text" |