Skip to content

Commit 491a4fc

Browse files
authored
Merge pull request #374 from CivicDataLab/feat/search-page
feat/Search page
2 parents ae1b7a5 + 45df063 commit 491a4fc

6 files changed

Lines changed: 688 additions & 521 deletions

File tree

app/[locale]/(user)/components/Content.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export const Content = () => {
3636

3737
const handleSearch = (value: string) => {
3838
if (value) {
39-
router.push(`/datasets?query=${encodeURIComponent(value)}`);
39+
router.push(`/search?query=${encodeURIComponent(value)}`);
4040
}
4141
};
4242
const Metrics = [

app/[locale]/(user)/datasets/components/FIlter/Filter.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ const Filter: React.FC<FilterProps> = ({
8989
value={category}
9090
className=" border-surfaceDefault"
9191
>
92-
<AccordionTrigger className="flex w-full flex-wrap items-center gap-2 rounded-1 bg-[#1F5F8D1A] py-[10px] px-3 hover:no-underline">
92+
<AccordionTrigger className="flex w-full flex-wrap items-center gap-2 rounded-1 bg-[#1F5F8D1A] px-3 py-[10px] hover:no-underline">
9393
<Text fontWeight="medium">{toTitleCase(category)}</Text>
9494
</AccordionTrigger>
9595
<AccordionContent
@@ -103,18 +103,22 @@ const Filter: React.FC<FilterProps> = ({
103103
name={category}
104104
options={data.map((option) => ({
105105
...option,
106-
disabled: lockedFilters[category]?.includes(option.value) || false,
106+
disabled:
107+
lockedFilters[category]?.includes(option.value) ||
108+
false,
107109
}))}
108110
title={undefined}
109111
value={selectedOptions[category] || []}
110112
onChange={(values) => {
111113
// Prevent unselecting locked filters
112114
const locked = lockedFilters[category] || [];
113115
const newValues = values as string[];
114-
116+
115117
// Ensure all locked values remain selected
116-
const finalValues = Array.from(new Set([...locked, ...newValues]));
117-
118+
const finalValues = Array.from(
119+
new Set([...locked, ...newValues])
120+
);
121+
118122
setSelectedOptions(category, finalValues);
119123
}}
120124
/>

app/[locale]/(user)/datasets/dataset.module.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.Search {
22
input {
33
width: 80%;
4-
height: 36px;
4+
height: 46px;
55
}
66
/* In your global CSS/SCSS file */
77
div[class*='Input-module_Backdrop'] {
@@ -18,3 +18,7 @@
1818
max-width: 120px;
1919
}
2020
}
21+
22+
// .Select {
23+
// height: 100%;
24+
// }

0 commit comments

Comments
 (0)