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 { Symbols } from "./symbols";
12 import { GetSiteResponse } from "lemmy-js-client";
13 import "./styles.scss";
14 import { favIconPngUrl, favIconUrl } from "../utils";
16 export interface AppProps {
17 siteRes: GetSiteResponse;
20 export class App extends Component<AppProps, any> {
21 constructor(props: any, context: any) {
22 super(props, context);
25 let siteRes = this.props.siteRes;
28 <Provider i18next={i18n}>
30 <Theme localUserView={siteRes.my_user} />
33 this.props.siteRes.site_view.site.icon && (
39 href={this.props.siteRes.site_view.site.icon || favIconUrl}
42 rel="apple-touch-icon"
44 this.props.siteRes.site_view.site.icon || favIconPngUrl
49 <Navbar site_res={this.props.siteRes} />
50 <div class="mt-4 p-0 fl-1">
52 {routes.map(({ path, exact, component: C, ...rest }) => (
57 render={props => <C {...props} {...rest} />}
60 <Route render={props => <NoMatch {...props} />} />
64 <Footer site={this.props.siteRes} />