Skip to content

Commit 765bac3

Browse files
vi0let-byteAaryan1203
authored andcommitted
modified the SearchBar component to include a placeholder parameter, allowing customizable placholder text
1 parent a0092e8 commit 765bac3

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

apps/searchneu/components/catalog/MobileWrapper.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export function MobileWrapper(props: {
8383
</DrawerContent>
8484
</Drawer>
8585

86-
<SearchBar />
86+
<SearchBar placeholder="Search by course or phrase..." />
8787
</div>
8888
<div className="flex h-full min-h-0 w-full min-w-0">
8989
<div

apps/searchneu/components/catalog/search/SearchBar.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Input } from "@/components/ui/input";
66
import { SearchIcon } from "lucide-react";
77
import { track } from "@vercel/analytics";
88

9-
export function SearchBar() {
9+
export function SearchBar({ placeholder }: { placeholder: string }) {
1010
const searchParams = useSearchParams();
1111
const pathname = usePathname();
1212
const { course } = useParams();
@@ -92,15 +92,15 @@ export function SearchBar() {
9292
<Input
9393
ref={searchInputRef}
9494
className="bg-neu1 focus:border-neu3 visible border pl-10 md:hidden"
95-
placeholder="Search by course or phrase..."
95+
placeholder={placeholder}
9696
value={inputValue}
9797
onChange={(e) => setInputValue(e.target.value)}
9898
onKeyDown={(e) => e.key === "Enter" && handleSubmit()}
9999
/>
100100
<Input
101101
ref={searchInputRef}
102102
className="bg-neu1 focus:border-neu3 hidden border pl-10 md:block"
103-
placeholder="Search by course or phrase..."
103+
placeholder={placeholder}
104104
value={inputValue}
105105
onChange={(e) => {
106106
setInputValue(e.target.value);

0 commit comments

Comments
 (0)