Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(fuselage): Add renderItem prop to the PaginatedMultiSelect component #1203

Merged
merged 5 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/twelve-yaks-study.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/fuselage": minor
---

feat(fuselage): Add `renderItem` prop to the `PaginatedMultiSelect` component
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import Chip from '../Chip';
import Flex from '../Flex';
import { Icon } from '../Icon';
import Margins from '../Margins';
import Option from '../Option';
import { useVisible } from '../Options/useVisible';
import { OptionsPaginated } from '../OptionsPaginated';
import Position from '../Position';
Expand All @@ -41,6 +42,7 @@ type PaginatedMultiSelectProps = Omit<
renderOptions?: (
props: ComponentProps<typeof OptionsPaginated>
) => ReactElement | null;
renderItem?: (props: ComponentProps<typeof Option>) => ReactElement | null;
anchor?: any;
};

Expand All @@ -55,6 +57,7 @@ const PaginatedMultiSelect = ({
onChange = () => {},
placeholder,
renderOptions: OptionsComponent = OptionsPaginated,
renderItem = Option,
endReached,
...props
}: PaginatedMultiSelectProps) => {
Expand Down Expand Up @@ -191,6 +194,7 @@ const PaginatedMultiSelect = ({
options={options}
cursor={-1}
endReached={endReached}
renderItem={renderItem}
onSelect={([value]) => {
toggleOption(value);
}}
Expand Down
Loading