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 { PasswordChange } from './components/password_change';
11 import { Post } from './components/post';
12 import { Community } from './components/community';
13 import { Communities } from './components/communities';
14 import { User } from './components/user';
15 import { Modlog } from './components/modlog';
16 import { Setup } from './components/setup';
17 import { Inbox } from './components/inbox';
18 import { Search } from './components/search';
19 import { Sponsors } from './components/sponsors';
20 import { Symbols } from './components/symbols';
21 import { i18n } from './i18next';
23 import { WebSocketService, UserService } from './services';
25 const container = document.getElementById('app');
27 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">
42 path={`/home/type/:type/sort/:sort/page/:page`}
45 <Route exact path={`/`} component={Main} />
46 <Route path={`/login`} component={Login} />
47 <Route path={`/create_post`} component={CreatePost} />
48 <Route path={`/create_community`} component={CreateCommunity} />
49 <Route path={`/communities/page/:page`} component={Communities} />
50 <Route path={`/communities`} component={Communities} />
51 <Route path={`/post/:id/comment/:comment_id`} component={Post} />
52 <Route path={`/post/:id`} component={Post} />
54 path={`/c/:name/sort/:sort/page/:page`}
57 <Route path={`/community/:id`} component={Community} />
58 <Route path={`/c/:name`} component={Community} />
60 path={`/u/:username/view/:view/sort/:sort/page/:page`}
63 <Route path={`/user/:id`} component={User} />
64 <Route path={`/u/:username`} component={User} />
65 <Route path={`/inbox`} component={Inbox} />
67 path={`/modlog/community/:community_id`}
70 <Route path={`/modlog`} component={Modlog} />
71 <Route path={`/setup`} component={Setup} />
73 path={`/search/q/:q/type/:type/sort/:sort/page/:page`}
76 <Route path={`/search`} component={Search} />
77 <Route path={`/sponsors`} component={Sponsors} />
79 path={`/password_change/:token`}
80 component={PasswordChange}
92 render(<Index />, container);