-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #598 from celestemods-com/mods-page-list-select-fi…
…lters Implement Filtering for Remaining Mods List Columns
- Loading branch information
Showing
6 changed files
with
53 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,25 @@ | ||
|
||
type ListSearchProps = { | ||
|
||
import type { Dispatch, SetStateAction } from "react"; | ||
import { MultiSelect } from "@mantine/core"; | ||
|
||
type ListSearchProps<T extends string> = { | ||
permittedStrings: T[]; | ||
selectedStrings: T[]; | ||
setSelectedStrings: Dispatch<SetStateAction<T[]>>; | ||
maxDropdownHeight?: number; | ||
}; | ||
|
||
|
||
|
||
|
||
const ListSearch = (props: ListSearchProps) => { | ||
|
||
|
||
export const ListSelect = <T extends string>({ permittedStrings, selectedStrings, setSelectedStrings, maxDropdownHeight=200 }: ListSearchProps<T>) => { | ||
return ( | ||
<> | ||
</> | ||
<MultiSelect | ||
data={permittedStrings} | ||
value={selectedStrings} | ||
onChange={setSelectedStrings as Dispatch<SetStateAction<string[]>>} //widen type to play nicely with library component | ||
placeholder="Pick values" | ||
clearable | ||
maxDropdownHeight={maxDropdownHeight} | ||
/> | ||
); | ||
}; | ||
|
||
|
||
export default ListSearch; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters