2019-03-20 21:22:31 -04:00
|
|
|
import { render, Component } from 'inferno';
|
|
|
|
import { HashRouter, Route, Switch } from 'inferno-router';
|
|
|
|
|
|
|
|
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 { Home } from './components/home';
|
|
|
|
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-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-08 17:46:09 -04:00
|
|
|
import { Symbols } from './components/symbols';
|
2019-03-20 21:22:31 -04:00
|
|
|
|
2019-04-20 00:06:25 -04:00
|
|
|
import './css/bootstrap.min.css';
|
|
|
|
import './css/main.css';
|
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 (
|
|
|
|
<HashRouter>
|
|
|
|
<Navbar />
|
|
|
|
<div class="mt-3 p-0">
|
|
|
|
<Switch>
|
|
|
|
<Route exact path="/" component={Home} />
|
|
|
|
<Route path={`/login`} component={Login} />
|
2019-03-22 21:42:57 -04:00
|
|
|
<Route path={`/create_post`} component={CreatePost} />
|
|
|
|
<Route path={`/create_community`} component={CreateCommunity} />
|
2019-04-04 16:00:19 -04:00
|
|
|
<Route path={`/communities`} component={Communities} />
|
2019-04-08 01:19:02 -04:00
|
|
|
<Route path={`/post/:id/comment/:comment_id`} component={Post} />
|
2019-03-26 14:00:18 -04:00
|
|
|
<Route path={`/post/:id`} component={Post} />
|
|
|
|
<Route path={`/community/:id`} component={Community} />
|
2019-04-08 01:19:02 -04:00
|
|
|
<Route path={`/user/:id/:heading`} component={User} />
|
|
|
|
<Route path={`/user/:id`} component={User} />
|
2019-04-16 19:04:23 -04:00
|
|
|
<Route path={`/modlog/community/:community_id`} component={Modlog} />
|
2019-04-15 19:12:06 -04:00
|
|
|
<Route path={`/modlog`} component={Modlog} />
|
2019-04-16 19:04:23 -04:00
|
|
|
<Route path={`/setup`} component={Setup} />
|
2019-03-20 21:22:31 -04:00
|
|
|
</Switch>
|
2019-04-08 17:46:09 -04:00
|
|
|
<Symbols />
|
2019-03-20 21:22:31 -04:00
|
|
|
</div>
|
2019-04-16 19:04:23 -04:00
|
|
|
<Footer />
|
2019-03-20 21:22:31 -04:00
|
|
|
</HashRouter>
|
|
|
|
);
|
|
|
|
}
|
2019-04-06 18:49:51 -04:00
|
|
|
|
2019-03-20 21:22:31 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
render(<Index />, container);
|