added placeholder buttonGroup, first attempt on fetchingbranch, last correction of regex

This commit is contained in:
Florian Scholdei
2019-03-29 13:52:19 +01:00
parent 7ea2a06b1e
commit 3ac82e4021
7 changed files with 131 additions and 14 deletions

View File

@@ -0,0 +1,45 @@
//@flow
import React from "react";
import type { Repository, Branch } from "@scm-manager/ui-types";
import { ButtonGroup, Button } from "@scm-manager/ui-components";
import { translate } from "react-i18next";
type Props = {
repository: Repository,
branch: Branch,
// context props
t: string => string
};
class BranchButtonGroup extends React.Component<Props> {
render() {
const { repository, branch, t } = this.props;
const changesetLink = "";
const sourcesLink = "";
return (
<ButtonGroup>
<Button link={changesetLink}>
<span className="icon">
<i className="fas fa-exchange-alt" />
</span>
<span className="is-hidden-mobile is-hidden-tablet-only">
{t("branch.commits")}
</span>
</Button>
<Button link={sourcesLink}>
<span className="icon">
<i className="fas fa-code" />
</span>
<span className="is-hidden-mobile is-hidden-tablet-only">
{t("branch.sources")}
</span>
</Button>
</ButtonGroup>
);
}
}
export default translate("repos")(BranchButtonGroup);

View File

@@ -2,6 +2,7 @@
import React from "react";
import type { Repository, Branch } from "@scm-manager/ui-types";
import { translate } from "react-i18next";
import BranchButtonGroup from "./BranchButtonGroup";
type Props = {
repository: Repository,
@@ -26,6 +27,12 @@ class BranchDetailTable extends React.Component<Props> {
</td>
<td>{repository.name}</td>
</tr>
<tr>
<td className="has-text-weight-semibold">
{t("branch.actions")}
</td>
<td><BranchButtonGroup repository={repository} branch={branch} /></td>
</tr>
</tbody>
</table>
);