Skip to content

Commit 86ec44a

Browse files
committed
Merge branch 'postgrest-scroll-group' of https://github.com/UW-Macrostrat/web-components into post-group
2 parents b611b28 + 86b952c commit 86ec44a

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

packages/ui-components/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Changelog
22

33
## [4.4.4] - 2025-07-18
4+
45
For PostgRESTInfiniteScrollView
56

67
- Custom group panel component

packages/ui-components/src/infinite-scroll.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ function InfiniteScrollView<T>(props: InfiniteScrollProps<T>) {
292292

293293
const data = state.items;
294294
const isLoading = state.isLoadingPage != null;
295-
const isEmpty = data.length === 0 && !isLoading || hideData;
295+
const isEmpty = (data.length === 0 && !isLoading) || hideData;
296296
const isFinished = !state.hasMore && !isLoading;
297297
const totalCount = props.totalCount ?? state.count;
298298

packages/ui-components/src/postgrest-infinite-scroll.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ export function PostgRESTInfiniteScrollView(
312312
initialItems: newInitialItems,
313313
hasMore: hasMore ?? defaultHasMore,
314314
key: newKey,
315-
hideData
315+
hideData,
316316
}),
317317
]);
318318
}
@@ -392,14 +392,24 @@ function Grouping(props: GroupingProps) {
392392
getNextParams,
393393
hasMore,
394394
...rest,
395-
GroupingComponent
395+
GroupingComponent,
396396
});
397397
}),
398398
]);
399399
}
400400

401401
function GroupPanel(props) {
402-
const { group, route, params, getNextParams, hasMore, key, hideData, GroupingComponent, ...rest } = props;
402+
const {
403+
group,
404+
route,
405+
params,
406+
getNextParams,
407+
hasMore,
408+
key,
409+
hideData,
410+
GroupingComponent,
411+
...rest
412+
} = props;
403413

404414
const data = useAPIResult(route, {
405415
...params,

packages/ui-components/stories/postgrest-infinite-scroll.stories.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,4 @@ Grouping.args = {
8181
icon: "search",
8282
className: "no-results",
8383
},
84-
};
84+
};

0 commit comments

Comments
 (0)