]> Untitled Git - lemmy.git/blob - ui/src/index.tsx
Adding forum / community page
[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 import { CreatePost } from './components/create-post';
8 import { CreateCommunity } from './components/create-community';
9 import { Post } from './components/post';
10 import { Community } from './components/community';
11 import { Communities } from './components/communities';
12
13 import './main.css';
14
15 import { WebSocketService, UserService } from './services';
16
17 const container = document.getElementById('app');
18
19 class Index extends Component<any, any> {
20
21   constructor(props, context) {
22     super(props, context);
23     WebSocketService.Instance;
24     UserService.Instance;
25   }
26
27   render() {
28     return (
29       <HashRouter>
30         <Navbar />
31         <div class="mt-3 p-0">
32           <Switch>
33             <Route exact path="/" component={Home} />
34             <Route path={`/login`} component={Login} />
35             <Route path={`/create_post`} component={CreatePost} />
36             <Route path={`/create_community`} component={CreateCommunity} />
37             <Route path={`/communities`} component={Communities} />
38             <Route path={`/post/:id`} component={Post} />
39             <Route path={`/community/:id`} component={Community} />
40           </Switch>
41         </div>
42       </HashRouter>
43     );
44   }
45 }
46
47 render(<Index />, container);