mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 23:15:43 +01:00
remove unnecessary buttongroup
This commit is contained in:
@@ -1,10 +1,9 @@
|
|||||||
//@flow
|
//@flow
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { Link } from "react-router-dom";
|
import {Link} from "react-router-dom";
|
||||||
import type { Branch, Repository } from "@scm-manager/ui-types";
|
import type {Branch, Repository} from "@scm-manager/ui-types";
|
||||||
import injectSheet from "react-jss";
|
import injectSheet from "react-jss";
|
||||||
import { ExtensionPoint, binder } from "@scm-manager/ui-extensions";
|
import {binder, ExtensionPoint} from "@scm-manager/ui-extensions";
|
||||||
import {ButtonGroup} from "./buttons";
|
|
||||||
import classNames from "classnames";
|
import classNames from "classnames";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
@@ -64,33 +63,48 @@ class Breadcrumb extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { classes, baseUrl, branch, defaultBranch, branches, revision, path, repository } = this.props;
|
const {
|
||||||
|
classes,
|
||||||
|
baseUrl,
|
||||||
|
branch,
|
||||||
|
defaultBranch,
|
||||||
|
branches,
|
||||||
|
revision,
|
||||||
|
path,
|
||||||
|
repository
|
||||||
|
} = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className={classes.flexRow}>
|
<div className={classes.flexRow}>
|
||||||
<nav className={classNames(classes.flexStart, "breadcrumb sources-breadcrumb")} aria-label="breadcrumbs">
|
<nav
|
||||||
|
className={classNames(
|
||||||
|
classes.flexStart,
|
||||||
|
"breadcrumb sources-breadcrumb"
|
||||||
|
)}
|
||||||
|
aria-label="breadcrumbs"
|
||||||
|
>
|
||||||
<ul>{this.renderPath()}</ul>
|
<ul>{this.renderPath()}</ul>
|
||||||
</nav>
|
</nav>
|
||||||
{
|
{binder.hasExtension("repos.sources.actionbar") && (
|
||||||
binder.hasExtension("repos.sources.actionbar") &&
|
|
||||||
<div className={classes.buttonGroup}>
|
<div className={classes.buttonGroup}>
|
||||||
<ButtonGroup>
|
|
||||||
<ExtensionPoint
|
<ExtensionPoint
|
||||||
name="repos.sources.actionbar"
|
name="repos.sources.actionbar"
|
||||||
props={{
|
props={{
|
||||||
baseUrl,
|
baseUrl,
|
||||||
branch: branch ? branch : defaultBranch,
|
branch: branch ? branch : defaultBranch,
|
||||||
path,
|
path,
|
||||||
isBranchUrl: branches &&
|
isBranchUrl:
|
||||||
branches.filter(b => b.name.replace("/", "%2F") === revision).length > 0,
|
branches &&
|
||||||
|
branches.filter(
|
||||||
|
b => b.name.replace("/", "%2F") === revision
|
||||||
|
).length > 0,
|
||||||
repository
|
repository
|
||||||
}}
|
}}
|
||||||
renderAll={true}
|
renderAll={true}
|
||||||
/>
|
/>
|
||||||
</ButtonGroup>
|
|
||||||
</div>
|
</div>
|
||||||
}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<hr className={classes.noMargin} />
|
<hr className={classes.noMargin} />
|
||||||
</>
|
</>
|
||||||
|
|||||||
Reference in New Issue
Block a user