pass all properties of RepositoryNavLink to NavLink

This commit is contained in:
Sebastian Sdorra
2018-10-24 10:12:07 +02:00
parent 05a872f9b6
commit 9b210fd212

View File

@@ -8,6 +8,7 @@ type Props = {
to: string,
label: string,
linkName: string,
activeWhenMatch?: (route: any) => boolean,
activeOnlyWhenExact: boolean
};
@@ -16,19 +17,13 @@ type Props = {
*/
class RepositoryNavLink extends React.Component<Props> {
render() {
const { linkName, to, label, repository, activeOnlyWhenExact } = this.props;
const { repository, linkName } = this.props;
if (!repository._links[linkName]) {
return null;
}
return (
<NavLink
to={to}
label={label}
activeOnlyWhenExact={activeOnlyWhenExact}
/>
);
return <NavLink {...this.props} />;
}
}