]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-21234 Remove extra space at the bottom of projects list
authorAmbroise C <ambroise.christea@sonarsource.com>
Thu, 18 Jan 2024 15:09:54 +0000 (16:09 +0100)
committersonartech <sonartech@sonarsource.com>
Thu, 18 Jan 2024 20:03:23 +0000 (20:03 +0000)
server/sonar-web/src/main/js/apps/projects/components/ProjectsList.tsx

index 9d61328036cbe53a6231d424ad66b4383acd0dbc..43fea64f1e36187ea45a828166e9bf51fc81a79c 100644 (file)
@@ -33,6 +33,7 @@ import ProjectCard from './project-card/ProjectCard';
 
 const PROJECT_CARD_HEIGHT = 181;
 const PROJECT_CARD_MARGIN = 20;
+const PROJECT_LIST_FOOTER_HEIGHT = 90;
 
 interface Props {
   cardType?: string;
@@ -100,7 +101,11 @@ export default class ProjectsList extends React.PureComponent<Props> {
             height={height}
             overscanRowCount={2}
             rowCount={this.props.projects.length + 1}
-            rowHeight={PROJECT_CARD_HEIGHT + PROJECT_CARD_MARGIN}
+            rowHeight={({ index }) =>
+              index === this.props.projects.length
+                ? PROJECT_LIST_FOOTER_HEIGHT
+                : PROJECT_CARD_HEIGHT + PROJECT_CARD_MARGIN
+            }
             rowRenderer={this.renderRow}
             style={{ outline: 'none' }}
             tabIndex={-1}