]> Untitled Git - lemmy.git/blob - ui/src/index.tsx
Adding a sponsors page.
[lemmy.git] / ui / src / index.tsx
1 import { render, Component } from 'inferno';
2 import { HashRouter, Route, Switch } from 'inferno-router';
3
4 import { Navbar } from './components/navbar';
5 import { Footer } from './components/footer';
6 import { Home } from './components/home';
7 import { Login } from './components/login';
8 import { CreatePost } from './components/create-post';
9 import { CreateCommunity } from './components/create-community';
10 import { Post } from './components/post';
11 import { Community } from './components/community';
12 import { Communities } from './components/communities';
13 import { User } from './components/user';
14 import { Modlog } from './components/modlog';
15 import { Setup } from './components/setup';
16 import { Inbox } from './components/inbox';
17 import { Search } from './components/search';
18 import { Sponsors } from './components/sponsors';
19 import { Symbols } from './components/symbols';
20
21 import './css/bootstrap.min.css';
22 import './css/main.css';
23
24 import { WebSocketService, UserService } from './services';
25
26 const container = document.getElementById('app');
27
28 class Index extends Component<any, any> {
29
30   constructor(props: any, context: any) {
31     super(props, context);
32     WebSocketService.Instance;
33     UserService.Instance;
34   }
35
36   render() {
37     return (
38       <HashRouter>
39         <Navbar />
40         <div class="mt-3 p-0">
41           <Switch>
42             <Route exact path="/all" component={Home} />
43             <Route exact path="/" component={Home} />
44             <Route path={`/login`} component={Login} />
45             <Route path={`/create_post`} component={CreatePost} />
46             <Route path={`/create_community`} component={CreateCommunity} />
47             <Route path={`/communities`} component={Communities} />
48             <Route path={`/post/:id/comment/:comment_id`} component={Post} />
49             <Route path={`/post/:id`} component={Post} />
50             <Route path={`/community/:id`} component={Community} />
51             <Route path={`/user/:id/:heading`} component={User} />
52             <Route path={`/user/:id`} component={User} />
53             <Route path={`/inbox`} component={Inbox} />
54             <Route path={`/modlog/community/:community_id`} component={Modlog} />
55             <Route path={`/modlog`} component={Modlog} />
56             <Route path={`/setup`} component={Setup} />
57             <Route path={`/search`} component={Search} />
58             <Route path={`/sponsors`} component={Sponsors} />
59           </Switch>
60           <Symbols />
61         </div>
62         <Footer />
63       </HashRouter>
64     );
65   }
66
67 }
68
69 render(<Index />, container);