File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,14 +40,14 @@ const TagsDiv = (props: {
4040 return accum ;
4141 } , [ ] ) ;
4242 } ;
43-
44- const baseTags = props . tags
45- // Sort tags so that externalJS and archived tags come first
46- . sort ( ( a ) =>
47- a === t ( "grid.externalJS" ) || a === t ( "grid.archived" ) ? - 1 : 1 ,
48- )
49- . slice ( 0 , MAX_TAGS ) ;
50- const extraTags = props . tags . slice ( MAX_TAGS ) ;
43+ // Sort tags so that externalJS and archived tags come first
44+ let baseTags = props . tags . sort ( ( a ) => a === t ( "grid.externalJS" ) || a === t ( "grid.archived" ) ? - 1 : 1 ) ;
45+ let extraTags : string [ ] = [ ] ;
46+ // If there are more than one extra tags, slice them and add an expand button
47+ if ( baseTags . length - MAX_TAGS > 1 ) {
48+ extraTags = props . tags . slice ( MAX_TAGS ) ;
49+ baseTags = baseTags . slice ( 0 , MAX_TAGS ) ;
50+ }
5151
5252 // Render the tags list and add expand button if there are more tags
5353 return (
You can’t perform that action at this time.
0 commit comments