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