Skip to content

Commit

Permalink
refactor: add spinner for grant-list
Browse files Browse the repository at this point in the history
  • Loading branch information
johnshift committed Aug 16, 2024
1 parent b6e8de6 commit 56fa14e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/grants/components/grant-list/grant-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import { useMemo } from 'react';

import { Spinner } from '@nextui-org/react';

import { VirtualWrapper } from '@/shared/components/virtual-wrapper';

import { GrantListItem } from './grant-list-item';
Expand All @@ -17,7 +19,11 @@ export const GrantList = () => {

if (!hasNextPage) return <p>No more grants available.</p>;

return <div ref={inViewRef}>Loading more...</div>;
return (
<div ref={inViewRef} className="flex w-full justify-center">
<Spinner color="white" />
</div>
);
}, [error, hasNextPage, inViewRef]);

if (isPending) return <p>Loading Grants ...</p>;
Expand Down

0 comments on commit 56fa14e

Please sign in to comment.