mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-12 08:25:44 +01:00
31 lines
658 B
JavaScript
31 lines
658 B
JavaScript
|
|
//@flow
|
||
|
|
import React from 'react';
|
||
|
|
import NavLink from "../../../components/navigation/NavLink";
|
||
|
|
import { translate } from "react-i18next";
|
||
|
|
import type { Group } from "../../types/Group";
|
||
|
|
|
||
|
|
type Props = {
|
||
|
|
t: string => string,
|
||
|
|
editUrl: string,
|
||
|
|
group: Group
|
||
|
|
}
|
||
|
|
|
||
|
|
type State = {
|
||
|
|
}
|
||
|
|
|
||
|
|
class EditGroupNavLink extends React.Component<Props, State> {
|
||
|
|
|
||
|
|
render() {
|
||
|
|
const { t, editUrl } = this.props;
|
||
|
|
if (!this.isEditable()) {
|
||
|
|
return null;
|
||
|
|
}
|
||
|
|
return <NavLink label={t("edit-group-button.label")} to={editUrl} />;
|
||
|
|
}
|
||
|
|
|
||
|
|
isEditable = () => {
|
||
|
|
return this.props.group._links.update;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
export default translate("groups")(EditGroupNavLink);
|