Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinlog committed Dec 26, 2019
1 parent e76c7e0 commit 9561018
Showing 1 changed file with 22 additions and 11 deletions.
33 changes: 22 additions & 11 deletions x-pack/plugins/endpoint/public/applications/endpoint/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import { Route, Router, Switch } from 'react-router-dom';
export function renderApp(coreStart: CoreStart, { element }: AppMountParameters) {
coreStart.http.get('/api/endpoint/hello-world');

const history = createHashHistory()
ReactDOM.render(<AppRoot history={history}/>, element);
const history = createHashHistory();
ReactDOM.render(<AppRoot history={history} />, element);

return () => {
ReactDOM.unmountComponentAtNode(element);
Expand All @@ -29,22 +29,33 @@ interface RouterProps {
history: History;
}

const AppRoot: React.FC<RouterProps> = React.memo(({history}) => (
const AppRoot: React.FC<RouterProps> = React.memo(({ history }) => (
<I18nProvider>
<Router history={history}>
<Switch>
<Route exact path="/" render={() => (
<Router history={history}>
<Switch>
<Route
exact
path="/"
render={() => (
<h1 data-test-subj="welcomeTitle">
<FormattedMessage id="xpack.endpoint.welcomeTitle" defaultMessage="Hello World" />
</h1>
)} />
<Route path="/management" render={() => (
)}
/>
<Route
path="/management"
render={() => (
<h1 data-test-subj="management ">
<FormattedMessage id="xpack.endpoint.management" defaultMessage="Manage Endpoints" />
</h1>
)} />
<Route render={() => <FormattedMessage id="xpack.endpoint.notFound" defaultMessage="Page Not Found" />} />
</Switch>
)}
/>
<Route
render={() => (
<FormattedMessage id="xpack.endpoint.notFound" defaultMessage="Page Not Found" />
)}
/>
</Switch>
</Router>
</I18nProvider>
));

0 comments on commit 9561018

Please sign in to comment.