1 import { Component } from "inferno";
2 import { Helmet } from "inferno-helmet";
3 import { Provider } from "inferno-i18next-dess";
4 import { Route, Switch } from "inferno-router";
5 import { GetSiteResponse } from "lemmy-js-client";
6 import { i18n } from "../../i18next";
7 import { routes } from "../../routes";
8 import { favIconPngUrl, favIconUrl } from "../../utils";
9 import { Footer } from "./footer";
10 import { Navbar } from "./navbar";
11 import { NoMatch } from "./no-match";
12 import "./styles.scss";
13 import { Theme } from "./theme";
15 export interface AppProps {
16 siteRes: GetSiteResponse;
19 export class App extends Component<AppProps, any> {
20 constructor(props: any, context: any) {
21 super(props, context);
24 let siteRes = this.props.siteRes;
27 <Provider i18next={i18n}>
30 myUserInfo={siteRes.my_user}
31 defaultTheme={siteRes.site_view.site.default_theme}
35 this.props.siteRes.site_view.site.icon && (
41 href={this.props.siteRes.site_view.site.icon || favIconUrl}
44 rel="apple-touch-icon"
46 this.props.siteRes.site_view.site.icon || favIconPngUrl
51 <Navbar site_res={this.props.siteRes} />
52 <div class="mt-4 p-0 fl-1">
54 {routes.map(({ path, exact, component: C, ...rest }) => (
59 render={props => <C {...props} {...rest} />}
62 <Route render={props => <NoMatch {...props} />} />
65 <Footer site={this.props.siteRes} />