Skip to content

Commit aefe6eb

Browse files
authored
add contributors page
1 parent a4b57ee commit aefe6eb

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

src/pages/contributors.js

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import Head from 'next/head';
2+
import styles from '../styles/contributors.module.css';
3+
4+
export const getStaticProps = async () => {
5+
const res = await fetch('https://api.github.com/repos/WebXDAO/webXDAO.github.io/contributors');
6+
const data = await res.json();
7+
8+
return {
9+
props: {
10+
data,
11+
},
12+
};
13+
};
14+
15+
const contributors = ({ data }) => {
16+
return (
17+
<>
18+
<Head>
19+
<title>Contributors | WebXDAO</title>
20+
</Head>
21+
22+
<div className={styles.body}>
23+
<section className={styles.section}>
24+
<div className={styles.container}>
25+
26+
{data.map((curElem) => {
27+
return (
28+
<div className={styles.card}>
29+
<div className={styles.content}>
30+
<div className={styles.imgBx}><a href={curElem.html_url}><img src={curElem.avatar_url} className={styles.img} /></a></div>
31+
<div className={styles.contentBx}>
32+
<a href={curElem.html_url}><h3 className={styles.h3}>{curElem.login}</h3></a>
33+
<h5 className={styles.h5} class="rounded px-10 bg-success">
34+
{curElem.contributions}
35+
<svg className={styles.svg} aria-hidden="true" focusable="false" data-prefix="fas" data-icon="hands-helping" class="svg-inline--fa fa-hands-helping fa-w-20 " role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512">
36+
<path fill="currentColor" d="M488 192H336v56c0 39.7-32.3 72-72 72s-72-32.3-72-72V126.4l-64.9 39C107.8 176.9 96 197.8 96 220.2v47.3l-80 46.2C.7 322.5-4.6 342.1 4.3 357.4l80 138.6c8.8 15.3 28.4 20.5 43.7 11.7L231.4 448H368c35.3 0 64-28.7 64-64h16c17.7 0 32-14.3 32-32v-64h8c13.3 0 24-10.7 24-24v-48c0-13.3-10.7-24-24-24zm147.7-37.4L555.7 16C546.9.7 527.3-4.5 512 4.3L408.6 64H306.4c-12 0-23.7 3.4-33.9 9.7L239 94.6c-9.4 5.8-15 16.1-15 27.1V248c0 22.1 17.9 40 40 40s40-17.9 40-40v-88h184c30.9 0 56 25.1 56 56v28.5l80-46.2c15.3-8.9 20.5-28.4 11.7-43.7z">
37+
</path>
38+
</svg>
39+
</h5>
40+
</div>
41+
</div>
42+
</div>
43+
44+
45+
);
46+
})}
47+
48+
</div>
49+
</section>
50+
</div>
51+
52+
53+
</>
54+
55+
);
56+
};
57+
58+
export default contributors;
59+
60+

0 commit comments

Comments
 (0)