From d8a33e0fc219117e7ad39ddf5b21cd83dcfbc19c Mon Sep 17 00:00:00 2001 From: Florian Scholdei Date: Mon, 1 Apr 2019 15:58:07 +0200 Subject: [PATCH] vcentered default branch label + more spacing --- .../branches/components/BranchDetailTable.js | 24 +++++++++++++------ .../repos/branches/components/BranchRow.js | 20 +++++++++++++--- scm-ui/src/repos/modules/branches.js | 1 - 3 files changed, 34 insertions(+), 11 deletions(-) diff --git a/scm-ui/src/repos/branches/components/BranchDetailTable.js b/scm-ui/src/repos/branches/components/BranchDetailTable.js index 53718c5b6d..27c4907a53 100644 --- a/scm-ui/src/repos/branches/components/BranchDetailTable.js +++ b/scm-ui/src/repos/branches/components/BranchDetailTable.js @@ -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 { @@ -25,9 +35,7 @@ class BranchDetailTable extends React.Component { - - {t("branch.repository")} - + {t("branch.repository")} {repository.name} @@ -42,14 +50,16 @@ class BranchDetailTable extends React.Component { } renderDefaultBranch() { - const { branch } = this.props; + const { branch, classes } = this.props; let defaultLabel = null; if (branch.defaultBranch) { - defaultLabel = Default; + defaultLabel = ( + Default + ); } return defaultLabel; } } -export default translate("repos")(BranchDetailTable); +export default injectSheet(styles)(translate("repos")(BranchDetailTable)); diff --git a/scm-ui/src/repos/branches/components/BranchRow.js b/scm-ui/src/repos/branches/components/BranchRow.js index 873bc066c7..06cb52c268 100644 --- a/scm-ui/src/repos/branches/components/BranchRow.js +++ b/scm-ui/src/repos/branches/components/BranchRow.js @@ -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 { +const styles = { + tag: { + marginLeft: "0.75rem", + verticalAlign: "inherit" + } +}; + +class BranchRow extends React.Component { renderLink(to: string, label: string, defaultBranch: boolean) { + const { classes } = this.props; + let showLabel = null; if (defaultBranch) { - showLabel = Default; + showLabel = Default; } return ( @@ -31,3 +43,5 @@ export default class BranchRow extends React.Component { ); } } + +export default injectSheet(styles)(BranchRow); diff --git a/scm-ui/src/repos/modules/branches.js b/scm-ui/src/repos/modules/branches.js index 62299801d6..9468443fea 100644 --- a/scm-ui/src/repos/modules/branches.js +++ b/scm-ui/src/repos/modules/branches.js @@ -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";