lemmy/ui/src/index.tsx

63 lines
2.1 KiB
TypeScript
Raw Normal View History

import { render, Component } from 'inferno';
import { HashRouter, Route, Switch } from 'inferno-router';
import { Navbar } from './components/navbar';
2019-04-16 23:04:23 +00:00
import { Footer } from './components/footer';
import { Home } from './components/home';
import { Login } from './components/login';
import { CreatePost } from './components/create-post';
import { CreateCommunity } from './components/create-community';
import { Post } from './components/post';
import { Community } from './components/community';
import { Communities } from './components/communities';
import { User } from './components/user';
import { Modlog } from './components/modlog';
2019-04-16 23:04:23 +00:00
import { Setup } from './components/setup';
import { Symbols } from './components/symbols';
import './css/bootstrap.min.css';
import './css/main.css';
import { WebSocketService, UserService } from './services';
const container = document.getElementById('app');
class Index extends Component<any, any> {
constructor(props: any, context: any) {
super(props, context);
WebSocketService.Instance;
UserService.Instance;
}
render() {
return (
<HashRouter>
<Navbar />
<div class="mt-3 p-0">
<Switch>
<Route exact path="/" component={Home} />
<Route path={`/login`} component={Login} />
<Route path={`/create_post`} component={CreatePost} />
<Route path={`/create_community`} component={CreateCommunity} />
<Route path={`/communities`} component={Communities} />
<Route path={`/post/:id/comment/:comment_id`} component={Post} />
<Route path={`/post/:id`} component={Post} />
<Route path={`/community/:id`} component={Community} />
<Route path={`/user/:id/:heading`} component={User} />
<Route path={`/user/:id`} component={User} />
2019-04-16 23:04:23 +00:00
<Route path={`/modlog/community/:community_id`} component={Modlog} />
<Route path={`/modlog`} component={Modlog} />
2019-04-16 23:04:23 +00:00
<Route path={`/setup`} component={Setup} />
</Switch>
<Symbols />
</div>
2019-04-16 23:04:23 +00:00
<Footer />
</HashRouter>
);
}
2019-04-06 22:49:51 +00:00
}
render(<Index />, container);