1 import { Component } from "inferno";
2 import { Route, Switch } from "inferno-router";
3 import { Provider } from "inferno-i18next";
4 import { Helmet } from "inferno-helmet";
5 import { i18n } from "../i18next";
6 import { routes } from "../routes";
7 import { Navbar } from "./navbar";
8 import { Footer } from "./footer";
9 import { NoMatch } from "./no-match";
10 import { Theme } from "./theme";
11 import { GetSiteResponse } from "lemmy-js-client";
12 import "./styles.scss";
13 import { favIconPngUrl, favIconUrl } from "../utils";
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}>
29 <Theme localUserView={siteRes.my_user} />
32 this.props.siteRes.site_view.site.icon && (
38 href={this.props.siteRes.site_view.site.icon || favIconUrl}
41 rel="apple-touch-icon"
43 this.props.siteRes.site_view.site.icon || favIconPngUrl
48 <Navbar site_res={this.props.siteRes} />
49 <div class="mt-4 p-0 fl-1">
51 {routes.map(({ path, exact, component: C, ...rest }) => (
56 render={props => <C {...props} {...rest} />}
59 <Route render={props => <NoMatch {...props} />} />
62 <Footer site={this.props.siteRes} />