File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
packages/view/src/components/FilteredAuthors Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 6
6
width : 100% ;
7
7
padding : 4px 6px ;
8
8
box-sizing : border-box ;
9
+ align-items : center ;
10
+ }
11
+
12
+ .selected-length {
13
+ font-size : 10px ;
14
+ margin-left : 20px ;
9
15
}
Original file line number Diff line number Diff line change @@ -9,11 +9,13 @@ const FilteredAuthors = () => {
9
9
const { selectedData } = useGlobalData ( ) ;
10
10
const authSrcMap = usePreLoadAuthorImg ( ) ;
11
11
const selectedClusters = getInitData ( selectedData ) ;
12
+ const filteredSelectedData = selectedClusters . reverse ( ) . slice ( 0 , 9 ) ;
13
+ const selectedClustersLength = selectedClusters . slice ( 9 ) ;
12
14
13
15
return (
14
16
< div className = "selected-container" >
15
17
{ authSrcMap &&
16
- selectedClusters . map ( ( selectedCluster ) => {
18
+ filteredSelectedData . reverse ( ) . map ( ( selectedCluster ) => {
17
19
return selectedCluster . summary . authorNames . map ( ( authorArray : string [ ] ) => {
18
20
return authorArray . map ( ( authorName : string ) => (
19
21
< Author
@@ -24,6 +26,9 @@ const FilteredAuthors = () => {
24
26
) ) ;
25
27
} ) ;
26
28
} ) }
29
+ < div className = "selected-length" >
30
+ { selectedClusters . length > 9 ? `+ ${ selectedClustersLength . length } more` : null }
31
+ </ div >
27
32
</ div >
28
33
) ;
29
34
} ;
You can’t perform that action at this time.
0 commit comments