2019-03-21 01:22:31 +00:00
|
|
|
import { render, Component } from 'inferno';
|
2019-04-29 00:19:04 +00:00
|
|
|
import { HashRouter, BrowserRouter, Route, Switch } from 'inferno-router';
|
|
|
|
import { Main } from './components/main';
|
2019-03-21 01:22:31 +00:00
|
|
|
import { Navbar } from './components/navbar';
|
2019-04-16 23:04:23 +00:00
|
|
|
import { Footer } from './components/footer';
|
2019-03-21 01:22:31 +00:00
|
|
|
import { Login } from './components/login';
|
2019-03-23 01:42:57 +00:00
|
|
|
import { CreatePost } from './components/create-post';
|
|
|
|
import { CreateCommunity } from './components/create-community';
|
2019-03-26 18:00:18 +00:00
|
|
|
import { Post } from './components/post';
|
|
|
|
import { Community } from './components/community';
|
2019-04-04 20:00:19 +00:00
|
|
|
import { Communities } from './components/communities';
|
2019-04-08 05:19:02 +00:00
|
|
|
import { User } from './components/user';
|
2019-04-15 23:12:06 +00:00
|
|
|
import { Modlog } from './components/modlog';
|
2019-04-16 23:04:23 +00:00
|
|
|
import { Setup } from './components/setup';
|
2019-04-20 18:17:00 +00:00
|
|
|
import { Inbox } from './components/inbox';
|
2019-04-23 22:05:50 +00:00
|
|
|
import { Search } from './components/search';
|
2019-04-24 03:17:02 +00:00
|
|
|
import { Sponsors } from './components/sponsors';
|
2019-04-08 21:46:09 +00:00
|
|
|
import { Symbols } from './components/symbols';
|
2019-03-21 01:22:31 +00:00
|
|
|
|
2019-04-20 04:06:25 +00:00
|
|
|
import './css/bootstrap.min.css';
|
|
|
|
import './css/main.css';
|
2019-03-21 01:22:31 +00:00
|
|
|
|
2019-03-23 01:42:57 +00:00
|
|
|
import { WebSocketService, UserService } from './services';
|
2019-03-21 01:22:31 +00:00
|
|
|
|
|
|
|
const container = document.getElementById('app');
|
|
|
|
|
|
|
|
class Index extends Component<any, any> {
|
|
|
|
|
2019-04-08 05:19:02 +00:00
|
|
|
constructor(props: any, context: any) {
|
2019-03-21 01:22:31 +00:00
|
|
|
super(props, context);
|
|
|
|
WebSocketService.Instance;
|
2019-03-23 01:42:57 +00:00
|
|
|
UserService.Instance;
|
2019-03-21 01:22:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
2019-04-29 00:46:23 +00:00
|
|
|
<BrowserRouter>
|
2019-03-21 01:22:31 +00:00
|
|
|
<Navbar />
|
|
|
|
<div class="mt-3 p-0">
|
|
|
|
<Switch>
|
2019-04-29 00:41:24 +00:00
|
|
|
<Route path={`/home/type/:type/sort/:sort/page/:page`} component={Main} />
|
|
|
|
<Route exact path={`/`} component={Main} />
|
2019-03-21 01:22:31 +00:00
|
|
|
<Route path={`/login`} component={Login} />
|
2019-03-23 01:42:57 +00:00
|
|
|
<Route path={`/create_post`} component={CreatePost} />
|
|
|
|
<Route path={`/create_community`} component={CreateCommunity} />
|
2019-04-04 20:00:19 +00:00
|
|
|
<Route path={`/communities`} component={Communities} />
|
2019-04-08 05:19:02 +00:00
|
|
|
<Route path={`/post/:id/comment/:comment_id`} component={Post} />
|
2019-03-26 18:00:18 +00:00
|
|
|
<Route path={`/post/:id`} component={Post} />
|
2019-04-29 00:41:24 +00:00
|
|
|
<Route path={`/f/:name/sort/:sort/page/:page`} component={Community} />
|
2019-03-26 18:00:18 +00:00
|
|
|
<Route path={`/community/:id`} component={Community} />
|
2019-04-25 21:52:18 +00:00
|
|
|
<Route path={`/f/:name`} component={Community} />
|
2019-04-29 00:41:24 +00:00
|
|
|
<Route path={`/u/:username/view/:view/sort/:sort/page/:page`} component={User} />
|
2019-04-08 05:19:02 +00:00
|
|
|
<Route path={`/user/:id`} component={User} />
|
2019-04-25 21:52:18 +00:00
|
|
|
<Route path={`/u/:username`} component={User} />
|
2019-04-20 18:17:00 +00:00
|
|
|
<Route path={`/inbox`} component={Inbox} />
|
2019-04-16 23:04:23 +00:00
|
|
|
<Route path={`/modlog/community/:community_id`} component={Modlog} />
|
2019-04-15 23:12:06 +00:00
|
|
|
<Route path={`/modlog`} component={Modlog} />
|
2019-04-16 23:04:23 +00:00
|
|
|
<Route path={`/setup`} component={Setup} />
|
2019-04-23 22:05:50 +00:00
|
|
|
<Route path={`/search`} component={Search} />
|
2019-04-24 03:17:02 +00:00
|
|
|
<Route path={`/sponsors`} component={Sponsors} />
|
2019-03-21 01:22:31 +00:00
|
|
|
</Switch>
|
2019-04-08 21:46:09 +00:00
|
|
|
<Symbols />
|
2019-03-21 01:22:31 +00:00
|
|
|
</div>
|
2019-04-16 23:04:23 +00:00
|
|
|
<Footer />
|
2019-03-21 01:22:31 +00:00
|
|
|
</HashRouter>
|
|
|
|
);
|
|
|
|
}
|
2019-04-06 22:49:51 +00:00
|
|
|
|
2019-03-21 01:22:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
render(<Index />, container);
|