summaryrefslogtreecommitdiffstats
path: root/ui/src/index.tsx
blob: b3b46904a6ee15d293ae9f5748485e7ac2ed8fc2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import { render, Component } from 'inferno';
import { HashRouter, Route, Switch } from 'inferno-router';

import { Navbar } from './components/navbar';
import { Footer } from './components/footer';
import { Home } from './components/home';
import { Login } from './components/login';
import { CreatePost } from './components/create-post';
import { CreateCommunity } from './components/create-community';
import { Post } from './components/post';
import { Community } from './components/community';
import { Communities } from './components/communities';
import { User } from './components/user';
import { Modlog } from './components/modlog';
import { Setup } from './components/setup';
import { Inbox } from './components/inbox';
import { Search } from './components/search';
import { Symbols } from './components/symbols';

import './css/bootstrap.min.css';
import './css/main.css';

import { WebSocketService, UserService } from './services';

const container = document.getElementById('app');

class Index extends Component<any, any> {

  constructor(props: any, context: any) {
    super(props, context);
    WebSocketService.Instance;
    UserService.Instance;
  }

  render() {
    return (
      <HashRouter>
        <Navbar />
        <div class="mt-3 p-0">
          <Switch>
            <Route exact path="/all" component={Home} />
            <Route exact path="/" component={Home} />
            <Route path={`/login`} component={Login} />
            <Route path={`/create_post`} component={CreatePost} />
            <Route path={`/create_community`} component={CreateCommunity} />
            <Route path={`/communities`} component={Communities} />
            <Route path={`/post/:id/comment/:comment_id`} component={Post} />
            <Route path={`/post/:id`} component={Post} />
            <Route path={`/community/:id`} component={Community} />
            <Route path={`/user/:id/:heading`} component={User} />
            <Route path={`/user/:id`} component={User} />
            <Route path={`/inbox`} component={Inbox} />
            <Route path={`/modlog/community/:community_id`} component={Modlog} />
            <Route path={`/modlog`} component={Modlog} />
            <Route path={`/setup`} component={Setup} />
            <Route path={`/search`} component={Search} />
          </Switch>
          <Symbols />
        </div>
        <Footer />
      </HashRouter>
    );
  }

}

render(<Index />, container);