]> Untitled Git - lemmy.git/blob - ui/src/index.tsx
Adding initial UI and Websocket server.
[lemmy.git] / ui / src / index.tsx
1 import { render, Component } from 'inferno';
2 import { HashRouter, Route, Switch } from 'inferno-router';
3
4 import { Navbar } from './components/navbar';
5 import { Home } from './components/home';
6 import { Login } from './components/login';
7
8 import './main.css';
9
10 import { WebSocketService } from './services';
11
12 const container = document.getElementById('app');
13
14 class Index extends Component<any, any> {
15
16   constructor(props, context) {
17     super(props, context);
18     WebSocketService.Instance;
19   }
20
21   render() {
22     return (
23       <HashRouter>
24         <Navbar />
25         <div class="mt-3 p-0">
26           <Switch>
27             <Route exact path="/" component={Home} />
28             <Route path={`/login`} component={Login} />
29             {/*
30             <Route path={`/search/:type_/:q/:page`} component={Search} />
31             <Route path={`/submit`} component={Submit} />
32             <Route path={`/user/:id`} component={Login} />
33             <Route path={`/community/:id`} component={Login} /> 
34             */}
35           </Switch>
36         </div>
37       </HashRouter>
38     );
39   }
40 }
41
42 render(<Index />, container);