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 { i18n } from "../../i18next";
6 import { routes } from "../../routes";
7 import { favIconPngUrl, favIconUrl, setIsoData } from "../../utils";
8 import { Footer } from "./footer";
9 import { Navbar } from "./navbar";
10 import { NoMatch } from "./no-match";
11 import "./styles.scss";
12 import { Theme } from "./theme";
14 export class App extends Component<any, any> {
15 private isoData = setIsoData(this.context);
16 constructor(props: any, context: any) {
17 super(props, context);
20 let siteRes = this.isoData.site_res;
21 let siteView = siteRes.site_view;
25 <Provider i18next={i18n}>
27 <Theme defaultTheme={siteView.map(s => s.site.default_theme)} />
29 .andThen(s => s.site.icon)
37 href={icon || favIconUrl}
39 <link rel="apple-touch-icon" href={icon || favIconPngUrl} />
44 <Navbar siteRes={siteRes} />
45 <div class="mt-4 p-0 fl-1">
47 {routes.map(({ path, exact, component: C, ...rest }) => (
52 render={props => <C {...props} {...rest} />}
55 <Route render={props => <NoMatch {...props} />} />
58 <Footer site={siteRes} />