File tree Expand file tree Collapse file tree 6 files changed +692
-10
lines changed Expand file tree Collapse file tree 6 files changed +692
-10
lines changed Original file line number Diff line number Diff line change 1818 "next" : " 13.5.4" ,
1919 "next-auth" : " ^4.24.4" ,
2020 "react" : " ^18" ,
21- "react-dom" : " ^18"
21+ "react-dom" : " ^18" ,
22+ "react-markdown" : " ^9.0.1"
2223 },
2324 "devDependencies" : {
2425 "@types/node" : " ^20" ,
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import {
1212 contentHeading ,
1313 getIssueNumber
1414} from "@/helpers/utils"
15+ import { MarkdownWrapper } from "../../wrapper/MarkdownWrapper"
1516
1617type CollapsibleIssueProps = {
1718 issues : Comment [ ]
@@ -89,9 +90,10 @@ const CollaspsibleIssue = ({
8990 { issue . url }
9091 </ Link >
9192 </ section >
92- < p className = "text-sm text-black" >
93- { issue . body }
94- </ p >
93+ < MarkdownWrapper
94+ summary = { issue . body }
95+ className = "text-sm text-black"
96+ />
9597
9698 < div className = "flex flex-row w-full gap-3 items-center text-xs text-black" >
9799 < section className = "flex items-center w-max gap-2" >
Original file line number Diff line number Diff line change 1+ import React from "react"
2+ import ReactMarkdown from "react-markdown"
3+ import "../../globals.css"
4+
5+ export const MarkdownWrapper = ( {
6+ summary,
7+ className
8+ } : {
9+ summary : string
10+ className ?: string | null | undefined
11+ } ) => {
12+ return (
13+ < ReactMarkdown className = { `markdownStyles ${ className } ` } >
14+ { summary }
15+ </ ReactMarkdown >
16+ )
17+ }
Original file line number Diff line number Diff line change @@ -40,3 +40,15 @@ body {
4040.arrowLeftIcon : hover {
4141 background-color : # eeeeee ;
4242}
43+
44+ .markdownStyles p {
45+ margin : 16px 0px ;
46+ }
47+
48+ .summaryTags p {
49+ margin : 0px 0px ;
50+ }
51+
52+ .markdownStyles a {
53+ text-decoration : underline;
54+ }
Original file line number Diff line number Diff line change @@ -74,11 +74,17 @@ export async function getIssueCommentsData({
7474
7575 const data = await res . json ( )
7676 const jsonData : IssueCommentDataType = data . data . user
77+ const {
78+ startCursor,
79+ hasNextPage : pageHasNextPage ,
80+ endCursor : pageEndCursor
81+ } = jsonData ?. issueComments ?. pageInfo
7782
7883 const nodes_data = jsonData ?. issueComments ?. nodes
79- const start_cursor = jsonData ?. issueComments ?. pageInfo ?. startCursor
80- const isNextPage = jsonData ?. issueComments ?. pageInfo ?. hasNextPage
81- const end_cursor = jsonData ?. issueComments ?. pageInfo ?. endCursor
84+ const start_cursor = startCursor
85+ const isNextPage = pageHasNextPage
86+ const end_cursor =
87+ nodes_data . length >= 100 ? pageEndCursor : startCursor
8288
8389 // get previous year from start date of query
8490 const prevYear = Number ( getYearFromDate ) - 1
You can’t perform that action at this time.
0 commit comments