Skip to content

Commit 21f38d5

Browse files
committed
add button logic to page controls
1 parent 59a33b8 commit 21f38d5

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

src/containers/repositories/repository-list.tsx

+19-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { t } from '@lingui/macro';
22
import * as React from 'react';
3-
4-
import { withRouter, RouteComponentProps } from 'react-router-dom';
3+
import { withRouter, RouteComponentProps, Link } from 'react-router-dom';
54

65
import {
76
BaseHeader,
@@ -24,6 +23,8 @@ import {
2423
DistributionType,
2524
} from 'src/api';
2625
import { AppContext } from 'src/loaders/app-context';
26+
import { Button, ToolbarItem } from '@patternfly/react-core';
27+
import { Paths } from 'src/paths';
2728

2829
export class Repository {
2930
name: string;
@@ -159,7 +160,10 @@ class RepositoryList extends React.Component<RouteComponentProps, IState> {
159160
}
160161
/>
161162
)}
162-
<BaseHeader title={t`Repo Management`}>
163+
<BaseHeader
164+
title={t`Repo Management`}
165+
pageControls={this.renderControls()}
166+
>
163167
{DEPLOYMENT_MODE === Constants.STANDALONE_DEPLOYMENT_MODE &&
164168
!loading &&
165169
!unauthorised ? (
@@ -285,6 +289,18 @@ class RepositoryList extends React.Component<RouteComponentProps, IState> {
285289
});
286290
};
287291

292+
private renderControls() {
293+
if (this.state.params.tab == 'local') {
294+
return (
295+
<ToolbarItem>
296+
<Link to={Paths.token}>
297+
<Button>{t`Get token`}</Button>
298+
</Link>
299+
</ToolbarItem>
300+
);
301+
}
302+
}
303+
288304
private get updateParams() {
289305
return ParamHelper.updateParamsMixin(this.nonQueryStringParams);
290306
}

0 commit comments

Comments
 (0)