diff --git a/src/App.tsx b/src/App.tsx index 66a07c0..26476ae 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -8,6 +8,7 @@ import { import ButtonTestRoute from "@/routes/ButtonTestRoute"; import ProfilePictureTest from "./routes/ProfilePictureTestRoute"; import Test from "./routes/Test"; +import SearchBarTest from "./routes/SearchBarTestRoute"; import DropdownItem from "@/components/DropdownItem"; import SortDropdownListTestRoute from "@/routes/SortDropdownListTestRoute"; import NavigationTest from "@/routes/NavigationTest"; @@ -23,6 +24,10 @@ const router = createBrowserRouter([ path: "/test", element: , }, + { + path:"/SearchBarTestRoute", + element: + }, { path: "/testButton", element: , diff --git a/src/components/SearchBar.tsx b/src/components/SearchBar.tsx new file mode 100644 index 0000000..d317464 --- /dev/null +++ b/src/components/SearchBar.tsx @@ -0,0 +1,34 @@ +import {useState, useRef} from "react"; +import { MagnifyingGlass } from "@phosphor-icons/react"; + +export interface SearchBarProps { + target: string; + } + + + function SearchBar({ target }: SearchBarProps) { + // const input = useRef(null); + const [query,setQuery] = useState("") + + + const handleClick = () => { + //handle query + //redirect to results + console.log(query) + } + + return
+ setQuery(e.target.value)} + /> + +
; + } + + export default SearchBar; + \ No newline at end of file diff --git a/src/routes/SearchBarTestRoute.tsx b/src/routes/SearchBarTestRoute.tsx new file mode 100644 index 0000000..8daeca4 --- /dev/null +++ b/src/routes/SearchBarTestRoute.tsx @@ -0,0 +1,12 @@ +import SearchBar from "../components/SearchBar"; + +function SearchBarTest() { + return ( +
+ + +
+ ); +} + +export default SearchBarTest;