1 import { render, Component } from 'inferno';
2 import { BrowserRouter, Route, Switch } from 'inferno-router';
3 import { Provider } from 'inferno-i18next';
4 import { Main } from './components/main';
5 import { Navbar } from './components/navbar';
6 import { Footer } from './components/footer';
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 { Inbox } from './components/inbox';
17 import { Search } from './components/search';
18 import { Sponsors } from './components/sponsors';
19 import { Symbols } from './components/symbols';
20 import { i18n } from './i18next';
22 import { WebSocketService, UserService } from './services';
24 const container = document.getElementById('app');
26 class Index extends Component<any, any> {
28 constructor(props: any, context: any) {
29 super(props, context);
30 WebSocketService.Instance;
36 <Provider i18next={i18n}>
39 <div class="mt-4 p-0">
41 <Route path={`/home/type/:type/sort/:sort/page/:page`} component={Main} />
42 <Route exact path={`/`} component={Main} />
43 <Route path={`/login`} component={Login} />
44 <Route path={`/create_post`} component={CreatePost} />
45 <Route path={`/create_community`} component={CreateCommunity} />
46 <Route path={`/communities/page/:page`} component={Communities} />
47 <Route path={`/communities`} component={Communities} />
48 <Route path={`/post/:id/comment/:comment_id`} component={Post} />
49 <Route path={`/post/:id`} component={Post} />
50 <Route path={`/c/:name/sort/:sort/page/:page`} component={Community} />
51 <Route path={`/community/:id`} component={Community} />
52 <Route path={`/c/:name`} component={Community} />
53 <Route path={`/u/:username/view/:view/sort/:sort/page/:page`} component={User} />
54 <Route path={`/user/:id`} component={User} />
55 <Route path={`/u/:username`} component={User} />
56 <Route path={`/inbox`} component={Inbox} />
57 <Route path={`/modlog/community/:community_id`} component={Modlog} />
58 <Route path={`/modlog`} component={Modlog} />
59 <Route path={`/setup`} component={Setup} />
60 <Route path={`/search/q/:q/type/:type/sort/:sort/page/:page`} component={Search} />
61 <Route path={`/search`} component={Search} />
62 <Route path={`/sponsors`} component={Sponsors} />
74 render(<Index />, container);