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 { CreatePrivateMessage } from './components/create-private-message';
11 import { PasswordChange } from './components/password_change';
12 import { Post } from './components/post';
13 import { Community } from './components/community';
14 import { Communities } from './components/communities';
15 import { User } from './components/user';
16 import { Modlog } from './components/modlog';
17 import { Setup } from './components/setup';
18 import { Inbox } from './components/inbox';
19 import { Search } from './components/search';
20 import { Sponsors } from './components/sponsors';
21 import { Symbols } from './components/symbols';
22 import { i18n } from './i18next';
24 import { WebSocketService, UserService } from './services';
26 const container = document.getElementById('app');
28 class Index extends Component<any, any> {
29 constructor(props: any, context: any) {
30 super(props, context);
31 WebSocketService.Instance;
37 <Provider i18next={i18n}>
40 <div class="mt-4 p-0 fl-1">
42 <Route exact path={`/`} component={Main} />
44 path={`/home/type/:type/sort/:sort/page/:page`}
47 <Route path={`/login`} component={Login} />
48 <Route path={`/create_post`} component={CreatePost} />
49 <Route path={`/create_community`} component={CreateCommunity} />
51 path={`/create_private_message`}
52 component={CreatePrivateMessage}
54 <Route path={`/communities/page/:page`} component={Communities} />
55 <Route path={`/communities`} component={Communities} />
56 <Route path={`/post/:id/comment/:comment_id`} component={Post} />
57 <Route path={`/post/:id`} component={Post} />
59 path={`/c/:name/sort/:sort/page/:page`}
62 <Route path={`/community/:id`} component={Community} />
63 <Route path={`/c/:name`} component={Community} />
65 path={`/u/:username/view/:view/sort/:sort/page/:page`}
68 <Route path={`/user/:id`} component={User} />
69 <Route path={`/u/:username`} component={User} />
70 <Route path={`/inbox`} component={Inbox} />
72 path={`/modlog/community/:community_id`}
75 <Route path={`/modlog`} component={Modlog} />
76 <Route path={`/setup`} component={Setup} />
78 path={`/search/q/:q/type/:type/sort/:sort/page/:page`}
81 <Route path={`/search`} component={Search} />
82 <Route path={`/sponsors`} component={Sponsors} />
84 path={`/password_change/:token`}
85 component={PasswordChange}
97 render(<Index />, container);