2017-10-09 22:09:42 -06:00
|
|
|
// import DevTools from "mobx-react-devtools";
|
2017-06-30 01:08:51 -06:00
|
|
|
import * as React from "react";
|
2019-07-20 18:06:07 -06:00
|
|
|
import { Redirect, Route, Switch, withRouter } from "react-router";
|
2017-09-10 21:38:07 -06:00
|
|
|
import { Container } from "semantic-ui-react";
|
2017-09-06 23:54:22 -06:00
|
|
|
|
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";
|
2017-06-20 08:45:25 -06:00
|
|
|
import "semantic-ui-css/semantic.css";
|
2018-08-07 21:21:26 +03:00
|
|
|
import "@client/styles/app";
|
2017-06-20 08:45:25 -06:00
|
|
|
|
2018-07-02 15:22:59 -06:00
|
|
|
function NavContainer() {
|
2018-09-02 02:57:55 -06:00
|
|
|
return (
|
|
|
|
<Container className="app">
|
|
|
|
<NavBar />
|
2018-07-02 15:22:59 -06:00
|
|
|
|
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-07-02 15:22:59 -06:00
|
|
|
|
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);
|