2019-03-28 17:09:59 +01:00
|
|
|
//@flow
|
|
|
|
|
import React from "react";
|
|
|
|
|
import type { Repository, Branch } from "@scm-manager/ui-types";
|
|
|
|
|
import { translate } from "react-i18next";
|
2019-03-29 13:52:19 +01:00
|
|
|
import BranchButtonGroup from "./BranchButtonGroup";
|
2019-04-03 08:52:29 +02:00
|
|
|
import DefaultBranchTag from "./DefaultBranchTag";
|
2019-03-28 17:09:59 +01:00
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
|
repository: Repository,
|
|
|
|
|
branch: Branch,
|
|
|
|
|
// context props
|
2019-04-03 08:52:29 +02:00
|
|
|
t: string => string
|
2019-03-28 17:09:59 +01:00
|
|
|
};
|
|
|
|
|
|
2019-04-02 17:45:25 +02:00
|
|
|
class BranchDetail extends React.Component<Props> {
|
2019-03-28 17:09:59 +01:00
|
|
|
render() {
|
|
|
|
|
const { repository, branch, t } = this.props;
|
2019-04-01 13:47:41 +02:00
|
|
|
|
2019-03-28 17:09:59 +01:00
|
|
|
return (
|
2019-04-02 17:45:25 +02:00
|
|
|
<div className="media">
|
2019-04-03 08:52:29 +02:00
|
|
|
<div className="media-content subtitle">
|
|
|
|
|
<strong>{t("branch.name")}</strong> {branch.name}{" "}
|
|
|
|
|
<DefaultBranchTag defaultBranch={branch.defaultBranch} />
|
|
|
|
|
</div>
|
2019-04-02 17:45:25 +02:00
|
|
|
<div className="media-right">
|
|
|
|
|
<BranchButtonGroup repository={repository} branch={branch} />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2019-03-28 17:09:59 +01:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-04-03 08:52:29 +02:00
|
|
|
export default translate("repos")(BranchDetail);
|