44 lines
1.2 KiB
TypeScript
Raw Permalink Normal View History

2017-10-09 22:09:42 -06:00
// import DevTools from "mobx-react-devtools";
import * as React from "react";
2019-07-20 18:06:07 -06:00
import { Redirect, Route, Switch, withRouter } from "react-router";
import { Container } from "semantic-ui-react";
2018-08-07 21:21:26 +03:00
import { MessagesView, NavBar } from "@client/components";
import * as p from "@client/pages";
2018-08-11 19:59:20 +03:00
import * as route from "@client/routePaths";
2017-08-29 23:21:36 -06:00
2018-06-26 11:53:22 -06:00
// tslint:disable:ordered-imports
2017-08-29 23:21:36 -06:00
import "font-awesome/css/font-awesome.css";
import "semantic-ui-css/semantic.css";
2018-08-07 21:21:26 +03:00
import "@client/styles/app";
function NavContainer() {
2018-09-02 02:57:55 -06:00
return (
<Container className="app">
<NavBar />
2018-09-02 02:57:55 -06:00
<Switch>
<Route path={route.device(":deviceId")} component={p.DevicePage} />
<Route path={route.device()} component={p.DevicesPage} />
<Route path={route.messagesTest} component={p.MessageTest} />
<Redirect from="/" to={route.device()} />
<Redirect to="/" />
</Switch>
2018-09-02 02:57:55 -06:00
<MessagesView />
</Container>
);
2018-06-25 13:37:37 -06:00
}
2019-07-20 18:06:07 -06:00
function App() {
2018-09-02 02:57:55 -06:00
return (
<Switch>
<Route path={route.login} component={p.LoginPage} />
<Route path={route.logout} component={p.LogoutPage} />
<NavContainer />
</Switch>
);
2018-06-25 13:37:37 -06:00
}
2019-07-20 18:06:07 -06:00
export default withRouter(App);