pass links to the main.route extension point

This commit is contained in:
Sebastian Sdorra
2019-01-11 13:10:15 +01:00
parent b80f0572df
commit 3d853d2eaf
2 changed files with 6 additions and 4 deletions

View File

@@ -79,7 +79,7 @@ class App extends Component<Props> {
/> />
); );
} else { } else {
content = <Main authenticated={authenticated} />; content = <Main authenticated={authenticated} links={links} />;
} }
return ( return (
<div className="App"> <div className="App">

View File

@@ -2,6 +2,7 @@
import React from "react"; import React from "react";
import { Redirect, Route, Switch, withRouter } from "react-router-dom"; import { Redirect, Route, Switch, withRouter } from "react-router-dom";
import type {Links} from "@scm-manager/ui-types";
import Overview from "../repos/containers/Overview"; import Overview from "../repos/containers/Overview";
import Users from "../users/containers/Users"; import Users from "../users/containers/Users";
@@ -24,12 +25,13 @@ import Config from "../config/containers/Config";
import Profile from "./Profile"; import Profile from "./Profile";
type Props = { type Props = {
authenticated?: boolean authenticated?: boolean,
links: Links
}; };
class Main extends React.Component<Props> { class Main extends React.Component<Props> {
render() { render() {
const { authenticated } = this.props; const { authenticated, links } = this.props;
return ( return (
<div className="main"> <div className="main">
<Switch> <Switch>
@@ -118,7 +120,7 @@ class Main extends React.Component<Props> {
<ExtensionPoint <ExtensionPoint
name="main.route" name="main.route"
renderAll={true} renderAll={true}
props={{authenticated}} props={{authenticated, links}}
/> />
</Switch> </Switch>
</div> </div>