Save collapse status of secondary navigation

Pushed-by: Florian Scholdei<florian.scholdei@cloudogu.com>
Co-authored-by: Florian Scholdei<florian.scholdei@cloudogu.com>
Co-authored-by: Konstantin Schaper<konstantin.schaper@cloudogu.com>
Committed-by: Florian Scholdei<florian.scholdei@cloudogu.com>
This commit is contained in:
Florian Scholdei
2023-12-12 09:18:50 +01:00
parent 4f053028b9
commit 72886bd204
26 changed files with 675 additions and 594 deletions

View File

@@ -21,7 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
import React from "react";
import React, { FC } from "react";
import { Repository } from "@scm-manager/ui-types";
import { NavLink } from "@scm-manager/ui-components";
import { RouteProps } from "react-router-dom";
@@ -40,16 +40,12 @@ type Props = {
/**
* Component renders only if the repository contains the link with the given name.
*/
class RepositoryNavLink extends React.Component<Props> {
render() {
const { repository, linkName } = this.props;
if (!repository._links[linkName]) {
return null;
}
return <NavLink {...this.props} />;
const RepositoryNavLink: FC<Props> = ({ repository, linkName, ...props }) => {
if (!repository._links[linkName]) {
return null;
}
}
return <NavLink {...props} />;
};
export default RepositoryNavLink;