]> Untitled Git - lemmy.git/blob - ui/src/index.tsx
Merge branch 'moderation'
[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 { Footer } from './components/footer';
6 import { Home } from './components/home';
7 import { Login } from './components/login';
8 import { CreatePost } from './components/create-post';
9 import { CreateCommunity } from './components/create-community';
10 import { Post } from './components/post';
11 import { Community } from './components/community';
12 import { Communities } from './components/communities';
13 import { User } from './components/user';
14 import { Modlog } from './components/modlog';
15 import { Setup } from './components/setup';
16 import { Symbols } from './components/symbols';
17
18 import './main.css';
19
20 import { WebSocketService, UserService } from './services';
21
22 const container = document.getElementById('app');
23
24 class Index extends Component<any, any> {
25
26   constructor(props: any, context: any) {
27     super(props, context);
28     WebSocketService.Instance;
29     UserService.Instance;
30   }
31
32   render() {
33     return (
34       <HashRouter>
35         <Navbar />
36         <div class="mt-3 p-0">
37           <Switch>
38             <Route exact path="/" component={Home} />
39             <Route path={`/login`} component={Login} />
40             <Route path={`/create_post`} component={CreatePost} />
41             <Route path={`/create_community`} component={CreateCommunity} />
42             <Route path={`/communities`} component={Communities} />
43             <Route path={`/post/:id/comment/:comment_id`} component={Post} />
44             <Route path={`/post/:id`} component={Post} />
45             <Route path={`/community/:id`} component={Community} />
46             <Route path={`/user/:id/:heading`} component={User} />
47             <Route path={`/user/:id`} component={User} />
48             <Route path={`/modlog/community/:community_id`} component={Modlog} />
49             <Route path={`/modlog`} component={Modlog} />
50             <Route path={`/setup`} component={Setup} />
51           </Switch>
52           <Symbols />
53         </div>
54         <Footer />
55       </HashRouter>
56     );
57   }
58
59 }
60
61 render(<Index />, container);