File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
src/app/(public)/repos/[language]/_components Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,10 @@ import { ReportButton } from './report-button';
5
5
6
6
const MAX_DESCRIPTION_LENGTH = 100 ;
7
7
const MAX_TOPICS_DISPLAY = 3 ;
8
+ const numberFormatter = new Intl . NumberFormat ( 'en-US' , {
9
+ notation : 'compact' ,
10
+ compactDisplay : 'short'
11
+ } ) ;
8
12
9
13
interface RepoCardProps {
10
14
repo : RepoItem ;
@@ -17,7 +21,7 @@ export function RepoCard({ repo }: RepoCardProps) {
17
21
: repo . description ;
18
22
19
23
// Ensure 'hacktoberfest' topic appears first
20
- const sortedTopics = [ ... repo . topics ] . sort ( ( a , b ) => {
24
+ const sortedTopics = repo . topics . toSorted ( ( a , b ) => {
21
25
if ( a === 'hacktoberfest' ) return - 1 ;
22
26
if ( b === 'hacktoberfest' ) return 1 ;
23
27
return 0 ;
@@ -26,11 +30,6 @@ export function RepoCard({ repo }: RepoCardProps) {
26
30
const displayedTopics = sortedTopics . slice ( 0 , MAX_TOPICS_DISPLAY ) ;
27
31
const hasMoreTopics = sortedTopics . length > MAX_TOPICS_DISPLAY ;
28
32
29
- const numberFormatter = new Intl . NumberFormat ( 'en-US' , {
30
- notation : 'compact' ,
31
- compactDisplay : 'short'
32
- } ) ;
33
-
34
33
return (
35
34
< section className = "transition duration-300 shadow-sm card bg-hacktoberfest-black ring-1 ring-hacktoberfest-light-pink hover:scale-105 hover:shadow-2xl hover:shadow-hacktoberfest-deep-pink h-96" >
36
35
< div className = "relative p-6 card-body" >
You can’t perform that action at this time.
0 commit comments