mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-14 09:25:43 +01:00
added create button
This commit is contained in:
@@ -12,6 +12,7 @@ import { compose } from "redux";
|
||||
import { translate } from "react-i18next";
|
||||
import {Link, withRouter} from "react-router-dom";
|
||||
import {
|
||||
CreateButton,
|
||||
ErrorNotification,
|
||||
Loading,
|
||||
Subtitle
|
||||
@@ -24,6 +25,7 @@ type Props = {
|
||||
branches: Branch[],
|
||||
|
||||
// dispatch props
|
||||
showCreateButton: boolean,
|
||||
fetchBranches: Repository => void,
|
||||
|
||||
// Context props
|
||||
@@ -60,6 +62,7 @@ class BranchesOverview extends React.Component<Props> {
|
||||
</thead>
|
||||
<tbody>{this.renderBranches()}</tbody>
|
||||
</table>
|
||||
{this.renderCreateButton()}
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -84,6 +87,16 @@ class BranchesOverview extends React.Component<Props> {
|
||||
}
|
||||
return branchesList;
|
||||
}
|
||||
|
||||
renderCreateButton() {
|
||||
const { showCreateButton, t } = this.props;
|
||||
if (showCreateButton || true ) { // TODO
|
||||
return (
|
||||
<CreateButton label={t("branchesOverview.createButton")} link="/create" />
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
const mapStateToProps = (state, ownProps) => {
|
||||
|
||||
Reference in New Issue
Block a user