@@ -10,6 +10,19 @@ const { data } = await getEntry('i18n', lang);
1010const authorLink = ` https://github.com/tomalaforge/angular-challenges/pulls?q=label%3A${challengeNumber }+label%3A"answer+author" ` ;
1111const communityLink = ` https://github.com/tomalaforge/angular-challenges/pulls?q=label%3A${challengeNumber }+label%3Aanswer+sort%3Areactions-%2B1-desc ` ;
1212const npxCommand = ` npx nx serve ${command } ` ;
13+
14+ const response = await fetch (` https://api.github.com/search/issues?q=repo:tomalaforge/angular-challenges+is:pr+label:%22${challengeNumber }%22+label:%22answer%22 ` );
15+ const { total_count, items } = await response .json ();
16+
17+ let count = 1 ;
18+ while (total_count > count * 30 ) {
19+ const response = await fetch (` https://api.github.com/search/issues?q=repo:tomalaforge/angular-challenges+is:pr+label:%22${challengeNumber }%22+label:%22answer%22&page=${count } ` );
20+ const { items : new_items } = await response .json ();
21+ if (new_items && new_items .length === 0 ) break ;
22+ items .push (... new_items );
23+ count ++ ;
24+ }
25+
1326---
1427
1528<div class =" separator" ></div >
@@ -49,7 +62,7 @@ const npxCommand = `npx nx serve ${command}`;
4962<div class = " article-footer" >
5063 <a
5164 href = { communityLink } >
52- ❖ { data [' challenge.footer.communityAnswers' ]} *
65+ ❖ { total_count } { data [' challenge.footer.communityAnswers' ]} *
5366 </a >
5467 <a
5568 href = { authorLink } >
@@ -70,6 +83,20 @@ const npxCommand = `npx nx serve ${command}`;
7083 <VideoButton { ... videoLink } { ... Astro .props } />}
7184</div >
7285
86+ <div class = " solution-container" >
87+ <div >Answered by</div >
88+ { (items ?? []).map ((item ) => (
89+ <img
90+ loading = " lazy"
91+ src = { item .user .avatar_url }
92+ width = " 30"
93+ height = " 30"
94+ alt = " "
95+ class = " avatar"
96+ />
97+ ))}
98+ </div >
99+
73100<div class = " footer-note" >
74101 * { data [' challenge.footer.upvoteAnswer' ]}
75102</div >
@@ -93,5 +120,17 @@ const npxCommand = `npx nx serve ${command}`;
93120 gap : 0.25rem ;
94121 margin - top : 3rem ;
95122 }
123+
124+
125+ .solution-container {
126+ margin - top : 3rem ;
127+ display : flex ;
128+ flex - wrap : wrap ;
129+ gap : 0.5rem ;
130+
131+ img {
132+ border-radius: 50 % ;
133+ }
134+ }
96135</style >
97136
0 commit comments