-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #155 from Real-Dev-Squad/yash/members-components
integreate api to get all members list and paginate non members data
- Loading branch information
Showing
5 changed files
with
150 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,31 @@ | ||
import { Avatar, Box } from '@chakra-ui/react'; | ||
import { useGetUserWithLoadMore } from '@/src/services/serverApi'; | ||
import NewMemberSectionPresentation from './Presentation'; | ||
import { useGetUsers } from '@/src/services/serverApi'; | ||
import { Button } from '@chakra-ui/react'; | ||
import styles from './newMemberSection.module.css' | ||
|
||
export default function NewMemberSection() { | ||
// we will make the api call here | ||
const { data, isLoading, isFetching } = useGetUsers(); | ||
const { data, isLoading, isFetching, loadMore, links } = useGetUserWithLoadMore() | ||
|
||
return ( | ||
<NewMemberSectionPresentation | ||
data={data} | ||
isLoading={isLoading || isFetching} | ||
/> | ||
<div> | ||
<NewMemberSectionPresentation | ||
data={data} | ||
isLoading={isLoading} | ||
/> | ||
|
||
{links?.next && links.next.length && | ||
<div className={styles.newMemberSectionLoadMore__container}> | ||
|
||
<Button | ||
onClick={loadMore} | ||
isLoading={isFetching} | ||
loadingText="Loading..." | ||
className={styles.newMemberSectionLoadMore__button} | ||
> | ||
Load More | ||
</Button> | ||
</div> | ||
} | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters