Skip to content

Commit

Permalink
Add throttle prop to CollectionList, ObjectList, and TemplateList com…
Browse files Browse the repository at this point in the history
…ponents
  • Loading branch information
jmetrikat committed Feb 14, 2025
1 parent 72b2056 commit 218315c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
1 change: 1 addition & 0 deletions src/components/CollectionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export default function CollectionList({ spaceId, listId }: CollectionListProps)
onSearchTextChange={setSearchText}
searchBarPlaceholder={"Search objects in list..."}
pagination={objectsPagination}
throttle={true}
>
{filteredObjects && filteredObjects.length > 0 ? (
<List.Section
Expand Down
20 changes: 10 additions & 10 deletions src/components/ObjectList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,19 +175,21 @@ export default function ObjectList({ spaceId }: ObjectListProps) {
};

const { processedPinned, processedRegular } = getCurrentItems();
const isLoading =
isLoadingObjects ||
isLoadingTypes ||
isLoadingMembers ||
isLoadingPinnedObjects ||
isLoadingPinnedTypes ||
isLoadingPinnedMembers;

return (
<List
isLoading={
isLoadingObjects ||
isLoadingTypes ||
isLoadingMembers ||
isLoadingPinnedObjects ||
isLoadingPinnedTypes ||
isLoadingPinnedMembers
}
isLoading={isLoading}
onSearchTextChange={setSearchText}
searchBarPlaceholder={`Search ${currentView}...`}
pagination={pagination}
throttle={true}
searchBarAccessory={
<List.Dropdown
tooltip="Choose View"
Expand All @@ -198,8 +200,6 @@ export default function ObjectList({ spaceId }: ObjectListProps) {
<List.Dropdown.Item title="Members" value="members" icon={Icon.PersonCircle} />
</List.Dropdown>
}
pagination={pagination}
throttle={true}
>
{processedPinned && processedPinned.length > 0 && (
<List.Section
Expand Down
1 change: 1 addition & 0 deletions src/components/TemplateList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export default function TemplateList({ spaceId, typeId, viewType, isGlobalSearch
onSearchTextChange={setSearchText}
searchBarPlaceholder="Search templates and objects..."
pagination={objectsPagination || templatesPagination}
throttle={true}
>
{filteredTemplates && filteredTemplates.length > 0 ? (
<List.Section
Expand Down

0 comments on commit 218315c

Please sign in to comment.