-
- {months.map((m) => (
-
- {m}
-
- ))}
-
-
-
- {memoizedGraphValues.map((day, idx) => (
-
+ ) : null}
+ <>
+
+ {condition ? null : (
+
+ {days.map((d) => (
+
+ {d}
+
))}
+
+ )}
+
+ {allPrs.length === 0 &&
+ allIssues.length === 0 ? null : (
+
+ {months.map((m) => (
+
+ {m}
+
+ ))}
+
+ )}
+
+
+ {memoizedGraphValues.map((day, idx) => (
+
+ ))}
+
-
-
+ {condition ? null : (
+
+ )}
+ >
)
}
diff --git a/src/app/result/page.tsx b/src/app/result/page.tsx
index 2077384..97aa13d 100644
--- a/src/app/result/page.tsx
+++ b/src/app/result/page.tsx
@@ -26,7 +26,9 @@ const Page = () => {
handleYearlyFilter,
memoizedGraphValues,
onClickToolTip,
- goBack
+ goBack,
+ allPrs,
+ allIssues
} = useGithubIssues()
const { years } = useGetYears()
@@ -65,6 +67,9 @@ const Page = () => {
memoizedGraphValues={memoizedGraphValues}
onClickToolTip={onClickToolTip}
loading={loading}
+ allPrs={allPrs}
+ allIssues={allIssues}
+ username={username!}
/>
comment.issue.author.login === username
+ (comment) => comment.issue.author?.login === username
)
const comments: Comment[] = rawComments?.map((comment) => {
@@ -43,7 +43,7 @@ export const getOthersComments = ({
data = data ?? []
const rawComments = data?.filter(
- (comment) => comment.issue.author.login !== username
+ (comment) => comment.issue.author?.login !== username
)
const comments: Comment[] = rawComments?.map((comment) => {
diff --git a/src/hooks/useGithubIssues.ts b/src/hooks/useGithubIssues.ts
index 6c89fb3..abc7c35 100644
--- a/src/hooks/useGithubIssues.ts
+++ b/src/hooks/useGithubIssues.ts
@@ -6,7 +6,7 @@ import {
getOwnComments
} from "@/helpers/get-comments"
import { getPullRequests } from "@/helpers/get-pull-requests"
-import { Project, PRsObject } from "@/types/pull_requests"
+import { PrNodes, Project, PRsObject } from "@/types/pull_requests"
import { useRouter, useSearchParams } from "next/navigation"
import {
createGridSet,
@@ -15,7 +15,7 @@ import {
getOrganisations,
getYearlyContributions
} from "@/helpers/utils"
-import { IssuesObject } from "@/types/comments"
+import { IssueCommentNodes, IssuesObject } from "@/types/comments"
import { Contribution } from "@/types"
export const useGithubIssues = () => {
@@ -33,6 +33,8 @@ export const useGithubIssues = () => {
const [toggleFilter, setToggleFilter] = useState("")
const [yearlyFilter, setYearlyFilter] = useState(currentYear)
const [toolTipKey, setToolTipKey] = useState("")
+ const [allPrs, setAllPrs] = useState([])
+ const [allIssues, setAllIssues] = useState([])
const [issuesObject, setIssuesObject] = useState({
ownIssueComments: [],
longIssueComments: [],
@@ -116,6 +118,8 @@ export const useGithubIssues = () => {
setLoading(false)
return
}
+ setAllIssues(rangedIssuesData)
+ setAllPrs(rangedPrsData)
const issue = getOwnComments({
data: rangedIssuesData,
@@ -204,7 +208,7 @@ export const useGithubIssues = () => {
}
}
- const goBack = () => Router.back()
+ const goBack = () => Router.push("/")
return {
projects,
@@ -218,6 +222,8 @@ export const useGithubIssues = () => {
handleYearlyFilter,
memoizedGraphValues,
onClickToolTip,
- goBack
+ goBack,
+ allPrs,
+ allIssues
}
}