Skip to content

Commit

Permalink
Update SearchBar.jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-priyanshu15 authored Dec 19, 2024
1 parent 626dc4f commit 771052e
Showing 1 changed file with 3 additions and 33 deletions.
36 changes: 3 additions & 33 deletions src/components/SearchBar.jsx
Original file line number Diff line number Diff line change
@@ -1,33 +1,3 @@
// import { useState } from "react";
// import { FaSearch } from "react-icons/fa";
// import { useNavigate } from "react-router-dom";

// export default function SearchBar() {
// const [query, setQuery] = useState("");
// const navigate = useNavigate();

// const handleSubmit = (e) => {
// e.preventDefault();
// if (query.trim()) {
// navigate(`/search/${query.trim()}`);
// }
// };

// return (
// <form onSubmit={handleSubmit} className="flex items-center gap-2">
// <input
// type="text"
// placeholder="Search"
// value={query}
// onChange={(e) => setQuery(e.target.value)}
// className="px-3 py-2 rounded-md focus:outline-none focus:ring focus:border-blue-600 flex-1"
// />
// <button type="submit" className="px-4 py-2 bg-blue-600 text-black rounded-md">
// <FaSearch />
// </button>
// </form>
// );
// }
import { useState } from "react";
import { FaSearch } from "react-icons/fa";
import { useNavigate } from "react-router-dom";
Expand All @@ -50,12 +20,12 @@ export default function SearchBar() {
placeholder="Search"
value={query}
onChange={(e) => setQuery(e.target.value)}
className="px-3 py-2 rounded-md focus:outline-none focus:ring focus:border-blue-600 flex-1 text-black bg-white" // Ensure text-black and bg-white
style={{ color: "black" }} // Inline style fallback for ensuring visibility
className="px-3 py-2 rounded-md focus:outline-none focus:ring focus:border-blue-600 flex-1"
/>
<button type="submit" className="px-4 py-2 bg-blue-600 text-white rounded-md">
<button type="submit" className="px-4 py-2 bg-blue-600 text-black rounded-md">
<FaSearch />
</button>
</form>
);
}

0 comments on commit 771052e

Please sign in to comment.