lemmy/ui/src/index.tsx

93 lines
3.5 KiB
TypeScript
Raw Normal View History

import { render, Component } from 'inferno';
import { BrowserRouter, Route, Switch } from 'inferno-router';
import { Provider } from 'inferno-i18next';
import { Main } from './components/main';
import { Navbar } from './components/navbar';
2019-04-16 23:04:23 +00:00
import { Footer } from './components/footer';
import { Login } from './components/login';
import { CreatePost } from './components/create-post';
import { CreateCommunity } from './components/create-community';
2019-11-02 06:41:57 +00:00
import { PasswordChange } from './components/password_change';
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';
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';
import { Symbols } from './components/symbols';
import { i18n } from './i18next';
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 (
<Provider i18next={i18n}>
<BrowserRouter>
<Navbar />
2020-01-16 01:24:47 +00:00
<div class="mt-4 p-0 fl-1">
<Switch>
<Route exact path={`/`} component={Main} />
<Route
path={`/home/type/:type/sort/:sort/page/:page`}
component={Main}
/>
<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} />
<Route
path={`/c/:name/sort/:sort/page/:page`}
component={Community}
/>
<Route path={`/community/:id`} component={Community} />
<Route path={`/c/:name`} component={Community} />
<Route
path={`/u/:username/view/:view/sort/:sort/page/:page`}
component={User}
/>
<Route path={`/user/:id`} component={User} />
<Route path={`/u/:username`} component={User} />
<Route path={`/inbox`} component={Inbox} />
<Route
path={`/modlog/community/:community_id`}
component={Modlog}
/>
<Route path={`/modlog`} component={Modlog} />
<Route path={`/setup`} component={Setup} />
<Route
path={`/search/q/:q/type/:type/sort/:sort/page/:page`}
component={Search}
/>
<Route path={`/search`} component={Search} />
<Route path={`/sponsors`} component={Sponsors} />
2019-11-02 06:41:57 +00:00
<Route
path={`/password_change/:token`}
component={PasswordChange}
/>
</Switch>
<Symbols />
</div>
<Footer />
</BrowserRouter>
</Provider>
);
}
}
render(<Index />, container);