aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/projects/components/PageHeader.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-web/src/main/js/apps/projects/components/PageHeader.js')
-rw-r--r--server/sonar-web/src/main/js/apps/projects/components/PageHeader.js44
1 files changed, 21 insertions, 23 deletions
diff --git a/server/sonar-web/src/main/js/apps/projects/components/PageHeader.js b/server/sonar-web/src/main/js/apps/projects/components/PageHeader.js
index ee2cb6cf6d0..61a9bba24ab 100644
--- a/server/sonar-web/src/main/js/apps/projects/components/PageHeader.js
+++ b/server/sonar-web/src/main/js/apps/projects/components/PageHeader.js
@@ -22,30 +22,28 @@ import React from 'react';
import ViewSelect from './ViewSelect';
import { translate } from '../../../helpers/l10n';
-export default class PageHeader extends React.Component {
- props: {
- loading: boolean,
- onViewChange: (string) => void,
- total?: number,
- view: string
- };
+type Props = {
+ loading: boolean,
+ onViewChange: (string) => void,
+ total?: number,
+ view: string
+};
- render() {
- return (
- <header className="page-header">
- <ViewSelect onChange={this.props.onViewChange} view={this.props.view} />
+export default function PageHeader(props: Props) {
+ return (
+ <header className="page-header">
+ <ViewSelect onChange={props.onViewChange} view={props.view} />
- <div className="page-actions projects-page-actions">
- {!!this.props.loading && <i className="spinner spacer-right" />}
+ <div className="page-actions projects-page-actions">
+ {!!props.loading && <i className="spinner spacer-right" />}
- {this.props.total != null &&
- <span>
- <strong id="projects-total">{this.props.total}</strong>
- {' '}
- {translate('projects._projects')}
- </span>}
- </div>
- </header>
- );
- }
+ {props.total != null &&
+ <span>
+ <strong id="projects-total">{props.total}</strong>
+ {' '}
+ {translate('projects._projects')}
+ </span>}
+ </div>
+ </header>
+ );
}