-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
created page router id for Mentor and shape mentor id on GRQL
- Loading branch information
1 parent
107cedf
commit 9a6f1fe
Showing
8 changed files
with
98 additions
and
22 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
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { Card, SkeletonCards } from "codac-ui"; | ||
|
||
import { useGetMentor } from "#/graphql/hooks"; | ||
|
||
export const Mentor = ({ id }: { id: string }) => { | ||
const { mentor, loading, error } = useGetMentor(id); | ||
console.log(mentor); | ||
|
||
return ( | ||
<div className="space-y-12"> | ||
{loading && <SkeletonCards number={3} isLoading={loading} />} | ||
{error && <div>something is wrong</div>} | ||
<div className="grid grid-cols-4 gap-4"> | ||
{mentor && ( | ||
<div key={mentor.id}> | ||
{mentor.attributes && ( | ||
<div className="relative"> | ||
<Card | ||
image={mentor.attributes.user?.data.attributes.avatar?.data.attributes.url ?? ""} | ||
title={mentor.attributes.user?.data.attributes.username} | ||
/> | ||
</div> | ||
)} | ||
</div> | ||
)} | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
import React from "react"; | ||
import Students from "#/components/community/Students"; | ||
import { useRouter } from "next/router"; | ||
import React from "react"; | ||
|
||
export default function Cohort() { | ||
import ListStudent from "#/components/community/ListStudent"; | ||
|
||
export default function Cohort() { | ||
const router = useRouter(); | ||
const { id } = router.query; | ||
|
||
|
||
return <Students cohortName={id} /> | ||
return <ListStudent cohortName={id} />; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
import { useRouter } from "next/router"; | ||
|
||
import { Mentor } from "#/components/community/Mentor"; | ||
|
||
export default function mentor() { | ||
const router = useRouter(); | ||
const { id } = router.query; | ||
|
||
return <Mentor id={id} />; | ||
} | ||
|
||
|