2019-03-21 01:22:31 +00:00
|
|
|
import { render, Component } from 'inferno';
|
|
|
|
import { HashRouter, Route, Switch } from 'inferno-router';
|
|
|
|
|
|
|
|
import { Navbar } from './components/navbar';
|
|
|
|
import { Home } from './components/home';
|
|
|
|
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-03-21 01:22:31 +00:00
|
|
|
|
|
|
|
import './main.css';
|
|
|
|
|
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> {
|
|
|
|
|
|
|
|
constructor(props, context) {
|
|
|
|
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 (
|
|
|
|
<HashRouter>
|
|
|
|
<Navbar />
|
|
|
|
<div class="mt-3 p-0">
|
|
|
|
<Switch>
|
|
|
|
<Route exact path="/" component={Home} />
|
|
|
|
<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-03-26 18:00:18 +00:00
|
|
|
<Route path={`/post/:id`} component={Post} />
|
|
|
|
<Route path={`/community/:id`} component={Community} />
|
2019-03-21 01:22:31 +00:00
|
|
|
</Switch>
|
|
|
|
</div>
|
|
|
|
</HashRouter>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
render(<Index />, container);
|