From 3d303333096352a76160f6378010b8da14f5c92b Mon Sep 17 00:00:00 2001 From: lonkaars Date: Sun, 25 Apr 2021 22:39:48 +0200 Subject: added github issues to the home page instead of fixing them --- components/issues.tsx | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 components/issues.tsx (limited to 'components') diff --git a/components/issues.tsx b/components/issues.tsx new file mode 100644 index 0000000..a9eaa8f --- /dev/null +++ b/components/issues.tsx @@ -0,0 +1,42 @@ +import axios from 'axios'; +import { CSSProperties, useEffect, useState } from 'react'; + +function IssueTag(props: { data: any; }) { + return
+ {props.data.name} +
; +} + +function Issue(props: { data: any; }) { + return +

+ #{props.data.number} + {props.data.title} +

+
+ {props.data.labels.map((label: any) => )} +
+
; +} + +export function IssueList() { + var [githubIssues, setGithubIssues] = useState(); + + useEffect(() => { + (async () => { + var githubIssuesRequest = await axios.request({ + url: 'https://api.github.com/repos/lonkaars/connect-4/issues?state=open', + }); + setGithubIssues(githubIssuesRequest.data.filter((issue: any) => issue.milestone?.id == 6663987)); + })(); + }, []); + + return
+ {githubIssues?.map(issue => )} +
; +} -- cgit v1.2.3