diff --git a/app/soapbox/features/groups/index.tsx b/app/soapbox/features/groups/index.tsx index 0407ff8e0..7528989f6 100644 --- a/app/soapbox/features/groups/index.tsx +++ b/app/soapbox/features/groups/index.tsx @@ -30,12 +30,16 @@ const Groups: React.FC = () => { const [searchValue, setSearchValue] = useState(''); const debouncedValue = debounce(searchValue, 300); - const { groups, isLoading } = useGroups(debouncedValue); + const { groups, isLoading, hasNextPage, fetchNextPage } = useGroups(debouncedValue); - const createGroup = () => { - dispatch(openModal('CREATE_GROUP')); + const handleLoadMore = () => { + if (hasNextPage) { + fetchNextPage(); + } }; + const createGroup = () => dispatch(openModal('CREATE_GROUP')); + const renderBlankslate = () => ( @@ -104,6 +108,8 @@ const Groups: React.FC = () => { showLoading={isLoading && groups.length === 0} placeholderComponent={PlaceholderGroupCard} placeholderCount={3} + onLoadMore={handleLoadMore} + hasMore={hasNextPage} > {groups.map((group) => (