mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-12 16:35:45 +01:00
unified langs + added deletegroup component + renamed editgroup to general
This commit is contained in:
29
scm-ui/src/groups/components/navLinks/GeneralGroupNavLink.js
Normal file
29
scm-ui/src/groups/components/navLinks/GeneralGroupNavLink.js
Normal file
@@ -0,0 +1,29 @@
|
||||
//@flow
|
||||
import React from "react";
|
||||
import { NavLink } from "@scm-manager/ui-components";
|
||||
import { translate } from "react-i18next";
|
||||
import type { Group } from "@scm-manager/ui-types";
|
||||
|
||||
type Props = {
|
||||
t: string => string,
|
||||
editUrl: string,
|
||||
group: Group
|
||||
};
|
||||
|
||||
type State = {};
|
||||
|
||||
class GeneralGroupNavLink extends React.Component<Props, State> {
|
||||
render() {
|
||||
const { t, editUrl } = this.props;
|
||||
if (!this.isEditable()) {
|
||||
return null;
|
||||
}
|
||||
return <NavLink label={t("singleGroup.menu.editNavLink")} to={editUrl} />;
|
||||
}
|
||||
|
||||
isEditable = () => {
|
||||
return this.props.group._links.update;
|
||||
};
|
||||
}
|
||||
|
||||
export default translate("groups")(GeneralGroupNavLink);
|
||||
Reference in New Issue
Block a user