diff --git a/apps/member-profile/app/routes/_profile.directory.tsx b/apps/member-profile/app/routes/_profile.directory.tsx index 2f259bf07..98f4df1fd 100644 --- a/apps/member-profile/app/routes/_profile.directory.tsx +++ b/apps/member-profile/app/routes/_profile.directory.tsx @@ -187,7 +187,11 @@ async function getAppliedFilters( : undefined, }, { name: 'Location', param: keys.location, value: searchParams.location }, - { name: 'School', param: keys.school, value: school }, + { + name: 'School', + param: keys.school, + value: school, + }, ].filter((item) => { return !!item.value; }); @@ -204,9 +208,10 @@ export default function DirectoryPage() { - + + - + @@ -240,7 +245,7 @@ function DirectoryPagination() { const DIRECTORY_FILTER_KEYS = Object.values(DirectoryFilterKey); -function FilterDirectoryDropdown() { +function FilterDirectoryDropdown({ filter }: { filter: string }) { const [open, setOpen] = useState(false); function onClose() { @@ -253,47 +258,96 @@ function FilterDirectoryDropdown() { return ( - } - onClick={onClick} - shape="square" - /> - - {open && ( + {filter === 'general' ? ( + } + onClick={onClick} + shape="square" + /> + ) : ( + {toTitleCase(filter)} + )} + + {open && filter == 'general' && ( Add Filter - setOpen(false)} /> + setOpen(false)} /> )} + + {open && filter != 'general' && ( + + )} ); } -function FilterForm({ close }: { close: VoidFunction }) { +function CompanyDropdown() { + return ( + + + Company + + + Add Filter + + + + ); +} + +function SchoolDropdown() { + return ( + + + School + + + Add Filter + + + + ); +} + +function FilterForm({ + close, + filter, +}: { + close: VoidFunction; + filter: string; +}) { const [filterKey, setFilterKey] = useState(null); const [searchParams] = useSearchParams(DirectorySearchParams); return ( - { - setFilterKey((e.currentTarget.value || null) as DirectoryFilterKey); - }} - > - {DIRECTORY_FILTER_KEYS.map((key) => { - return ( - - {toTitleCase(key)} - - ); - })} - + {filter == 'general' && ( + { + setFilterKey((e.currentTarget.value || null) as DirectoryFilterKey); + }} + > + {DIRECTORY_FILTER_KEYS.filter( + (key) => key != 'company' && key != 'school' + ).map((key) => { + return ( + + {toTitleCase(key)} + + ); + })} + + )} + + {filter == 'company' && } + {filter == 'school' && } {!!filterKey && ( diff --git a/config/tsconfig/remix.json b/config/tsconfig/remix.json index 2c55ffde3..5db3307ca 100644 --- a/config/tsconfig/remix.json +++ b/config/tsconfig/remix.json @@ -10,6 +10,6 @@ "moduleResolution": "Bundler", "noEmit": true, "resolveJsonModule": true, - "target": "ESNext", - }, + "target": "ESNext" + } }