-
-
-
- People Behind This Product!
-
-
props.modal()} className="cursor-pointer">
-
-
+
+
+
+ People Behind This Product!
+
+
props.modal()}
+ className="cursor-pointer"
+ >
+
+
- {app.map((contributors, index) => {
- return (
-
- )
- })}
-
-
- )
-}
\ No newline at end of file
+ sm:pr-0 pr-[8px]"
+ >
+ {contributors
+ ? contributors.map((contributor, index) => {
+ return (
+
+ );
+ })
+ : null}
+
+
+ );
+}
diff --git a/src/app/sections/Contributors.tsx b/src/app/sections/Contributors.tsx
index f1cd3ad..b7e47a8 100644
--- a/src/app/sections/Contributors.tsx
+++ b/src/app/sections/Contributors.tsx
@@ -1,79 +1,68 @@
+import { useEffect, useState } from "react";
import ContributorsCard from "../components/ContributorsCard";
+import { Contributors } from "../type";
-interface Contributors {
- url : string,
- name : string,
- role : string
-}
-
-export default function Contributors() {
-
- const contributors : Contributors[] = [
- {
- url:"/images/placeholder.png",
- name:"Tukang Ulas Kelas",
- role:"Designer"
- },
- {
- url:"/images/placeholder.png",
- name:"Tukang Ulas Kelas",
- role:"Designer"
- },
- {
- url:"/images/placeholder.png",
- name:"Tukang Ulas Kelas",
- role:"Designer"
- },
- {
- url:"/images/placeholder.png",
- name:"Tukang Ulas Kelas",
- role:"Designer"
- },
- {
- url:"/images/placeholder.png",
- name:"Tukang Ulas Kelas",
- role:"Designer"
- },
- {
- url:"/images/placeholder.png",
- name:"Tukang Ulas Kelas",
- role:"Designer"
- },
- {
- url:"/images/placeholder.png",
- name:"Tukang Ulas Kelas",
- role:"Designer"
- }
- ]
-
- return (
-
-
-
+export default function ContributorsPage() {
+ const [contributors, setContributors] = useState
(null);
-
-
-
- The Developers!
-
-
-
+ useEffect(() => {
+ const options: RequestInit = {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Authorization: `Bearer ${process.env.NEXT_PUBLIC_AUTH_TOKEN}`,
+ },
+ };
-
-
-
-
-
-
+ fetch(
+ `${process.env.NEXT_PUBLIC_GITHUB_API_URL}/repos/ristekoss/ristek-oss-frontend/contributors`,
+ options
+ )
+ .then((res) => res.json())
+ .then((resJson) => setContributors(resJson));
+ }, []);
-
- {contributors.map((contributors, index) => {
- return (
-
- )
- })}
-
+ return (
+
+
+
+
+
+ The Developers!
+
+
+
+
+
+
- )
-}
\ No newline at end of file
+
+
+
+ {contributors
+ ? contributors.map((contributors, index) => {
+ return (
+
+ );
+ })
+ : null}
+
+
+ );
+}
diff --git a/src/app/type.ts b/src/app/type.ts
new file mode 100644
index 0000000..1dae43f
--- /dev/null
+++ b/src/app/type.ts
@@ -0,0 +1,5 @@
+export interface Contributors {
+ login: string;
+ avatar_url: string;
+ html_url: string;
+}