add search section to home
This commit is contained in:
@@ -11,7 +11,6 @@ import { listCategories } from "@/api/categories";
|
||||
import { FormControl, FormControlLabel } from "@/components/ui/form-control";
|
||||
import { Input, InputField } from "@/components/ui/input";
|
||||
import { HStack } from "@/components/ui/hstack";
|
||||
|
||||
import {
|
||||
Actionsheet,
|
||||
ActionsheetContent,
|
||||
@@ -95,8 +94,16 @@ export default function Notices() {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
if (params.search) {
|
||||
const searchTerm = params.search.toLowerCase();
|
||||
result = result.filter(notice =>{
|
||||
return notice.title.toLowerCase().includes(searchTerm);
|
||||
});
|
||||
}
|
||||
|
||||
setFilteredNotices(result);
|
||||
}, [notices, params.category, params.sort, params.priceFrom, params.priceTo]);
|
||||
}, );
|
||||
|
||||
|
||||
let filterActive = !!params.category || params.sort === "latest";
|
||||
|
||||
Reference in New Issue
Block a user