import { isAuthPath, setIsoData } from "@utils/app"; import { Component, RefObject, createRef, linkEvent } from "inferno"; import { Provider } from "inferno-i18next-dess"; import { Route, Switch } from "inferno-router"; import { IsoDataOptionalSite } from "../../interfaces"; import { routes } from "../../routes"; import { FirstLoadService, I18NextService } from "../../services"; import AuthGuard from "../common/auth-guard"; import ErrorGuard from "../common/error-guard"; import { ErrorPage } from "./error-page"; import { Footer } from "./footer"; import { Navbar } from "./navbar"; import "./styles.scss"; import { Theme } from "./theme"; export class App extends Component { private isoData: IsoDataOptionalSite = setIsoData(this.context); private readonly mainContentRef: RefObject; constructor(props: any, context: any) { super(props, context); this.mainContentRef = createRef(); } handleJumpToContent(event) { event.preventDefault(); this.mainContentRef.current?.focus(); } render() { const siteRes = this.isoData.site_res; const siteView = siteRes?.site_view; return ( <>
${I18NextService.i18n.t("jump_to_content", "Jump to content")} {siteView && ( )}
{routes.map( ({ path, component: RouteComponent, fetchInitialData }) => ( { if (!fetchInitialData) { FirstLoadService.falsify(); } return (
{RouteComponent && (isAuthPath(path ?? "") ? ( ) : ( ))}
); }} /> ) )}
); } }