mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 07:25:44 +01:00
vcentered default branch label + more spacing
This commit is contained in:
@@ -2,13 +2,23 @@
|
||||
import React from "react";
|
||||
import type { Repository, Branch } from "@scm-manager/ui-types";
|
||||
import { translate } from "react-i18next";
|
||||
import injectSheet from "react-jss";
|
||||
import classNames from "classnames";
|
||||
import BranchButtonGroup from "./BranchButtonGroup";
|
||||
|
||||
type Props = {
|
||||
repository: Repository,
|
||||
branch: Branch,
|
||||
// context props
|
||||
t: string => string
|
||||
t: string => string,
|
||||
classes: any
|
||||
};
|
||||
|
||||
const styles = {
|
||||
tag: {
|
||||
marginLeft: "0.75rem",
|
||||
verticalAlign: "inherit"
|
||||
}
|
||||
};
|
||||
|
||||
class BranchDetailTable extends React.Component<Props> {
|
||||
@@ -25,9 +35,7 @@ class BranchDetailTable extends React.Component<Props> {
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
{t("branch.repository")}
|
||||
</th>
|
||||
<th>{t("branch.repository")}</th>
|
||||
<td>{repository.name}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -42,14 +50,16 @@ class BranchDetailTable extends React.Component<Props> {
|
||||
}
|
||||
|
||||
renderDefaultBranch() {
|
||||
const { branch } = this.props;
|
||||
const { branch, classes } = this.props;
|
||||
|
||||
let defaultLabel = null;
|
||||
if (branch.defaultBranch) {
|
||||
defaultLabel = <span className="tag is-dark">Default</span>;
|
||||
defaultLabel = (
|
||||
<span className={classNames("tag is-dark", classes.tag)}>Default</span>
|
||||
);
|
||||
}
|
||||
return defaultLabel;
|
||||
}
|
||||
}
|
||||
|
||||
export default translate("repos")(BranchDetailTable);
|
||||
export default injectSheet(styles)(translate("repos")(BranchDetailTable));
|
||||
|
||||
@@ -2,17 +2,29 @@
|
||||
import React from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import type { Branch } from "@scm-manager/ui-types";
|
||||
import injectSheet from "react-jss";
|
||||
import classNames from "classnames";
|
||||
|
||||
type Props = {
|
||||
baseUrl: string,
|
||||
branch: Branch
|
||||
branch: Branch,
|
||||
classes: any
|
||||
};
|
||||
|
||||
export default class BranchRow extends React.Component<Props> {
|
||||
const styles = {
|
||||
tag: {
|
||||
marginLeft: "0.75rem",
|
||||
verticalAlign: "inherit"
|
||||
}
|
||||
};
|
||||
|
||||
class BranchRow extends React.Component<Props> {
|
||||
renderLink(to: string, label: string, defaultBranch: boolean) {
|
||||
const { classes } = this.props;
|
||||
|
||||
let showLabel = null;
|
||||
if (defaultBranch) {
|
||||
showLabel = <span className="tag is-dark">Default</span>;
|
||||
showLabel = <span className={classNames("tag is-dark", classes.tag)}>Default</span>;
|
||||
}
|
||||
return (
|
||||
<Link to={to}>
|
||||
@@ -31,3 +43,5 @@ export default class BranchRow extends React.Component<Props> {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default injectSheet(styles)(BranchRow);
|
||||
|
||||
@@ -8,7 +8,6 @@ import { apiClient } from "@scm-manager/ui-components";
|
||||
import type {
|
||||
Action,
|
||||
Branch,
|
||||
Changeset,
|
||||
Repository
|
||||
} from "@scm-manager/ui-types";
|
||||
import { isPending } from "../../modules/pending";
|
||||
|
||||
Reference in New Issue
Block a user