upgrade IntegrationDetailActivity + switch to function component
-import { Button, ListView } from 'patternfly-react';
+import {
+ Button,
+ List
+} from '@patternfly/react-core';
import * as React from 'react';
import { Link } from 'react-router-dom';
import { Container, PageSection } from '../../Layout';
@@ -12,41 +15,39 @@ export interface IIntegrationDetailActivityProps {
onRefresh: () => void;
}
-export class IntegrationDetailActivity extends React.Component<
+export const IntegrationDetailActivity: React.FC<
IIntegrationDetailActivityProps
-> {
- public render() {
+> = ( props ) => {
return (
<PageSection>
<Container>
<div className="integration-detail-activity-toolbar pull-right">
- {this.props.linkToOpenShiftLog && (
+ {props.linkToOpenShiftLog && (
<>
<Link
data-testid={'integration-detail-activity-view-log-link'}
- to={this.props.linkToOpenShiftLog}
+ to={props.linkToOpenShiftLog}
>
- {this.props.i18nViewLogOpenShift}
+ {props.i18nViewLogOpenShift}
</Link>
&nbsp;|&nbsp;
</>
)}
<span className="integration-detail-activity-toolbar-last-refresh">
- {this.props.i18nLastRefresh}
+ {props.i18nLastRefresh}
</span>
&nbsp;&nbsp;
<Button
data-testid={'integration-detail-activity-refresh-button'}
- onClick={this.props.onRefresh}
+ onClick={props.onRefresh}
>
- {this.props.i18nBtnRefresh}
+ {props.i18nBtnRefresh}
</Button>
</div>
</Container>
- {this.props.children ? (
- <ListView>{this.props.children}</ListView>
+ {props.children ? (
+ <List>{props.children}</List>
) : null}
</PageSection>
);
- }
-}
+};
