2019-03-20 21:22:31 -04:00
|
|
|
import { render, Component } from 'inferno';
|
2019-08-09 20:14:43 -04:00
|
|
|
import { BrowserRouter, Route, Switch } from 'inferno-router';
|
|
|
|
import { Provider } from 'inferno-i18next';
|
2019-04-28 20:19:04 -04:00
|
|
|
import { Main } from './components/main';
|
2019-03-20 21:22:31 -04:00
|
|
|
import { Navbar } from './components/navbar';
|
2019-04-16 19:04:23 -04:00
|
|
|
import { Footer } from './components/footer';
|
2019-03-20 21:22:31 -04:00
|
|
|
import { Login } from './components/login';
|
2019-03-22 21:42:57 -04:00
|
|
|
import { CreatePost } from './components/create-post';
|
|
|
|
import { CreateCommunity } from './components/create-community';
|
2019-11-02 02:41:57 -04:00
|
|
|
import { PasswordChange } from './components/password_change';
|
2019-03-26 14:00:18 -04:00
|
|
|
import { Post } from './components/post';
|
|
|
|
import { Community } from './components/community';
|
2019-04-04 16:00:19 -04:00
|
|
|
import { Communities } from './components/communities';
|
2019-04-08 01:19:02 -04:00
|
|
|
import { User } from './components/user';
|
2019-04-15 19:12:06 -04:00
|
|
|
import { Modlog } from './components/modlog';
|
2019-04-16 19:04:23 -04:00
|
|
|
import { Setup } from './components/setup';
|
2019-04-20 14:17:00 -04:00
|
|
|
import { Inbox } from './components/inbox';
|
2019-04-23 18:05:50 -04:00
|
|
|
import { Search } from './components/search';
|
2019-04-23 23:17:02 -04:00
|
|
|
import { Sponsors } from './components/sponsors';
|
2019-04-08 17:46:09 -04:00
|
|
|
import { Symbols } from './components/symbols';
|
2019-08-09 20:14:43 -04:00
|
|
|
import { i18n } from './i18next';
|
2019-03-20 21:22:31 -04:00
|
|
|
|
2019-03-22 21:42:57 -04:00
|
|
|
import { WebSocketService, UserService } from './services';
|
2019-03-20 21:22:31 -04:00
|
|
|
|
|
|
|
const container = document.getElementById('app');
|
|
|
|
|
|
|
|
class Index extends Component<any, any> {
|
2019-04-08 01:19:02 -04:00
|
|
|
constructor(props: any, context: any) {
|
2019-03-20 21:22:31 -04:00
|
|
|
super(props, context);
|
|
|
|
WebSocketService.Instance;
|
2019-03-22 21:42:57 -04:00
|
|
|
UserService.Instance;
|
2019-03-20 21:22:31 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
2019-08-09 20:14:43 -04:00
|
|
|
<Provider i18next={i18n}>
|
|
|
|
<BrowserRouter>
|
|
|
|
<Navbar />
|
2020-01-15 20:24:47 -05:00
|
|
|
<div class="mt-4 p-0 fl-1">
|
2019-08-09 20:14:43 -04:00
|
|
|
<Switch>
|
2019-12-12 00:28:33 -05:00
|
|
|
<Route exact path={`/`} component={Main} />
|
2019-10-18 20:20:27 -04:00
|
|
|
<Route
|
|
|
|
path={`/home/type/:type/sort/:sort/page/:page`}
|
|
|
|
component={Main}
|
|
|
|
/>
|
2019-08-09 20:14:43 -04:00
|
|
|
<Route path={`/login`} component={Login} />
|
|
|
|
<Route path={`/create_post`} component={CreatePost} />
|
|
|
|
<Route path={`/create_community`} component={CreateCommunity} />
|
|
|
|
<Route path={`/communities/page/:page`} component={Communities} />
|
|
|
|
<Route path={`/communities`} component={Communities} />
|
|
|
|
<Route path={`/post/:id/comment/:comment_id`} component={Post} />
|
|
|
|
<Route path={`/post/:id`} component={Post} />
|
2019-10-18 20:20:27 -04:00
|
|
|
<Route
|
|
|
|
path={`/c/:name/sort/:sort/page/:page`}
|
|
|
|
component={Community}
|
|
|
|
/>
|
2019-08-09 20:14:43 -04:00
|
|
|
<Route path={`/community/:id`} component={Community} />
|
|
|
|
<Route path={`/c/:name`} component={Community} />
|
2019-10-18 20:20:27 -04:00
|
|
|
<Route
|
|
|
|
path={`/u/:username/view/:view/sort/:sort/page/:page`}
|
|
|
|
component={User}
|
|
|
|
/>
|
2019-08-09 20:14:43 -04:00
|
|
|
<Route path={`/user/:id`} component={User} />
|
|
|
|
<Route path={`/u/:username`} component={User} />
|
|
|
|
<Route path={`/inbox`} component={Inbox} />
|
2019-10-18 20:20:27 -04:00
|
|
|
<Route
|
|
|
|
path={`/modlog/community/:community_id`}
|
|
|
|
component={Modlog}
|
|
|
|
/>
|
2019-08-09 20:14:43 -04:00
|
|
|
<Route path={`/modlog`} component={Modlog} />
|
|
|
|
<Route path={`/setup`} component={Setup} />
|
2019-10-18 20:20:27 -04:00
|
|
|
<Route
|
|
|
|
path={`/search/q/:q/type/:type/sort/:sort/page/:page`}
|
|
|
|
component={Search}
|
|
|
|
/>
|
2019-08-09 20:14:43 -04:00
|
|
|
<Route path={`/search`} component={Search} />
|
|
|
|
<Route path={`/sponsors`} component={Sponsors} />
|
2019-11-02 02:41:57 -04:00
|
|
|
<Route
|
|
|
|
path={`/password_change/:token`}
|
|
|
|
component={PasswordChange}
|
|
|
|
/>
|
2019-08-09 20:14:43 -04:00
|
|
|
</Switch>
|
|
|
|
<Symbols />
|
|
|
|
</div>
|
|
|
|
<Footer />
|
|
|
|
</BrowserRouter>
|
|
|
|
</Provider>
|
2019-03-20 21:22:31 -04:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
render(<Index />, container);
|