fixed wrong icons and added missing translation

This commit is contained in:
Sebastian Sdorra
2019-02-07 10:33:58 +01:00
parent 0bf7a6f168
commit cbfa751a05
4 changed files with 20 additions and 9 deletions

View File

@@ -4,16 +4,20 @@ import type { Changeset, Repository } from "@scm-manager/ui-types";
import ButtonGroup from "../../buttons/ButtonGroup"; import ButtonGroup from "../../buttons/ButtonGroup";
import Button from "../../buttons/Button"; import Button from "../../buttons/Button";
import { createChangesetLink, createSourcesLink } from "./changesets"; import { createChangesetLink, createSourcesLink } from "./changesets";
import { translate } from "react-i18next";
type Props = { type Props = {
repository: Repository, repository: Repository,
changeset: Changeset changeset: Changeset,
// context props
t: (string) => string
} }
class ChangesetButtonGroup extends React.Component<Props> { class ChangesetButtonGroup extends React.Component<Props> {
render() { render() {
const { repository, changeset } = this.props; const { repository, changeset, t } = this.props;
const changesetLink = createChangesetLink(repository, changeset); const changesetLink = createChangesetLink(repository, changeset);
const sourcesLink = createSourcesLink(repository, changeset); const sourcesLink = createSourcesLink(repository, changeset);
@@ -22,18 +26,18 @@ class ChangesetButtonGroup extends React.Component<Props> {
<ButtonGroup className="is-pulled-right"> <ButtonGroup className="is-pulled-right">
<Button link={changesetLink}> <Button link={changesetLink}>
<span className="icon"> <span className="icon">
<i className="fas fa-code"></i> <i className="fas fa-code-branch"></i>
</span> </span>
<span className="is-hidden-mobile is-hidden-tablet-only"> <span className="is-hidden-mobile is-hidden-tablet-only">
Details {t("changesets.buttons.details")}
</span> </span>
</Button> </Button>
<Button link={sourcesLink}> <Button link={sourcesLink}>
<span className="icon"> <span className="icon">
<i className="fas fa-history"></i> <i className="fas fa-code"></i>
</span> </span>
<span className="is-hidden-mobile is-hidden-tablet-only"> <span className="is-hidden-mobile is-hidden-tablet-only">
Sources {t("changesets.buttons.sources")}
</span> </span>
</Button> </Button>
</ButtonGroup> </ButtonGroup>
@@ -42,4 +46,4 @@ class ChangesetButtonGroup extends React.Component<Props> {
} }
export default ChangesetButtonGroup; export default translate("repos")(ChangesetButtonGroup);

View File

@@ -11,4 +11,3 @@ export { default as ChangesetRow } from "./ChangesetRow";
export { default as ChangesetTag } from "./ChangesetTag"; export { default as ChangesetTag } from "./ChangesetTag";
export { default as ChangesetTags } from "./ChangesetTags"; export { default as ChangesetTags } from "./ChangesetTags";
export { default as ChangesetTagsCollapsed } from "./ChangesetTagsCollapsed"; export { default as ChangesetTagsCollapsed } from "./ChangesetTagsCollapsed";
export { default as ChangesetDiff } from "./ChangesetDiff";

View File

@@ -84,7 +84,11 @@
"name": "Autor", "name": "Autor",
"mail": "Mail", "mail": "Mail",
"prefix": "Verfasst von", "prefix": "Verfasst von",
"mailto": "E-Mail senden an" "mailto": "Mail senden an"
},
"buttons": {
"details": "Details",
"sources": "Sources"
} }
}, },
"branch-selector": { "branch-selector": {

View File

@@ -85,6 +85,10 @@
"mail": "Mail", "mail": "Mail",
"prefix": "Authored by", "prefix": "Authored by",
"mailto": "Send mail to" "mailto": "Send mail to"
},
"buttons": {
"details": "Details",
"sources": "Sources"
} }
}, },
"branch-selector": { "branch-selector": {