diff --git a/src/shared/components/app/app.tsx b/src/shared/components/app/app.tsx index 5709f766..bcdf14f5 100644 --- a/src/shared/components/app/app.tsx +++ b/src/shared/components/app/app.tsx @@ -51,7 +51,7 @@ export class App extends Component { {siteView && ( <> - + )} diff --git a/src/shared/components/app/code-theme.tsx b/src/shared/components/app/code-theme.tsx index 492fbefc..9cc016ef 100644 --- a/src/shared/components/app/code-theme.tsx +++ b/src/shared/components/app/code-theme.tsx @@ -1,22 +1,35 @@ +import { dataBsTheme } from "@utils/browser"; import { Component } from "inferno"; +import { Helmet } from "inferno-helmet"; +import { UserService } from "../../services"; -export class CodeTheme extends Component { +interface CodeThemeProps { + defaultTheme: string; +} + +export class CodeTheme extends Component { render() { + const user = UserService.Instance.myUserInfo; + const userTheme = user?.local_user_view.local_user.theme; + const theme = + user && userTheme !== "browser" ? userTheme : this.props.defaultTheme; + return ( - <> - - - + + {dataBsTheme(theme) === "dark" ? ( + + ) : ( + + )} + ); } }