mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-14 17:26:22 +01:00
24 lines
695 B
JavaScript
24 lines
695 B
JavaScript
//@flow
|
|
import React from "react";
|
|
import { NavLink } from "../../components/navigation";
|
|
import { translate } from "react-i18next";
|
|
import type { Repository } from "../types/Repositories";
|
|
|
|
type Props = { permissionUrl: string, t: string => string, repository: Repository };
|
|
|
|
class PermissionsNavLink extends React.Component<Props> {
|
|
hasPermissionsLink = () => {
|
|
return this.props.repository._links.permissions;
|
|
};
|
|
render() {
|
|
if (!this.hasPermissionsLink()) {
|
|
return null;
|
|
}
|
|
const { permissionUrl, t } = this.props;
|
|
return <NavLink to={permissionUrl} label={t("repository-root.permissions")}
|
|
/>;
|
|
}
|
|
}
|
|
|
|
export default translate("repos")(PermissionsNavLink);
|