@@ -145,7 +145,6 @@ export default function CommunitiesPage() {
145
145
clearValue = { ( ) => setSearchValue ( "" ) }
146
146
leftIcon = { < FontAwesomeIcon icon = { faSearch } /> }
147
147
csColor = "cyber-green"
148
- rootClasses = { searchAndOrderStyles . searchInput }
149
148
id = "communitiesSearchInput"
150
149
/>
151
150
</ div >
@@ -171,38 +170,9 @@ export default function CommunitiesPage() {
171
170
) ;
172
171
}
173
172
174
- function comparePackageCount ( a : Community , b : Community ) {
175
- if ( a . total_package_count < b . total_package_count ) {
176
- return 1 ;
177
- }
178
- if ( a . total_package_count > b . total_package_count ) {
179
- return - 1 ;
180
- }
181
- return 0 ;
182
- }
183
-
184
173
function CommunitiesList ( props : { communitiesData : Communities } ) {
185
174
const { communitiesData } = props ;
186
175
187
- const topDogs : Community [ ] = [ ] ;
188
- communitiesData . results . reduce ( ( prevCommunity , currentCommunity ) => {
189
- if ( topDogs . length > 4 ) {
190
- topDogs . sort ( comparePackageCount ) ;
191
- const lastDog = topDogs . at ( - 1 ) ;
192
- if (
193
- ( lastDog ? lastDog . total_package_count : 0 ) <
194
- currentCommunity . total_package_count
195
- ) {
196
- topDogs . pop ( ) ;
197
- topDogs . push ( currentCommunity ) ;
198
- }
199
- } else {
200
- topDogs . push ( currentCommunity ) ;
201
- }
202
- return topDogs ;
203
- } , topDogs ) ;
204
- const flatDogs = topDogs . map ( ( community ) => community . identifier ) ;
205
-
206
176
if ( communitiesData . results . length > 0 ) {
207
177
return (
208
178
< div className = { communitiesListStyles . root } >
0 commit comments