X-Git-Url: http://these/git/?a=blobdiff_plain;f=src%2Fshared%2Fcomponents%2Fapp%2Fapp.tsx;h=3452f9627c3159d672b676b98b75e3a8c0d166f8;hb=b1292b958af008763028df9591f5778be9d117f5;hp=96bf10168e8e47aa9729e3f59390eb06d9ddc11f;hpb=175d43d067ac452eb84fce697c20861090172e77;p=lemmy-ui.git diff --git a/src/shared/components/app/app.tsx b/src/shared/components/app/app.tsx index 96bf101..3452f96 100644 --- a/src/shared/components/app/app.tsx +++ b/src/shared/components/app/app.tsx @@ -1,10 +1,11 @@ import { isAuthPath, setIsoData } from "@utils/app"; +import { dataBsTheme } from "@utils/browser"; 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 { FirstLoadService, I18NextService, UserService } from "../../services"; import AuthGuard from "../common/auth-guard"; import ErrorGuard from "../common/error-guard"; import { ErrorPage } from "./error-page"; @@ -25,6 +26,13 @@ export class App extends Component { event.preventDefault(); this.mainContentRef.current?.focus(); } + + user = UserService.Instance.myUserInfo; + + componentDidMount() { + this.setState({ bsTheme: dataBsTheme(this.user) }); + } + render() { const siteRes = this.isoData.site_res; const siteView = siteRes?.site_view; @@ -32,13 +40,18 @@ export class App extends Component { return ( <> -
- + {siteView && ( )} @@ -58,7 +71,7 @@ export class App extends Component { return ( -
+
{RouteComponent && (isAuthPath(path ?? "") ? ( @@ -67,7 +80,7 @@ export class App extends Component { ) : ( ))} -
+
); }}