From: Orvar Segerström Date: Mon, 26 Oct 2020 18:42:07 +0000 (+0100) Subject: PR feedback X-Git-Url: http://these/git/%22https:/nerdica.net/static/%22%7B%7D/%7Bthis.props.imageSrc%7D?a=commitdiff_plain;h=397db2f1db5a069dcefc9a077040317894759b1a;p=lemmy-ui.git PR feedback --- diff --git a/src/shared/components/theme.tsx b/src/shared/components/theme.tsx index 558f9a8..a1e0a01 100644 --- a/src/shared/components/theme.tsx +++ b/src/shared/components/theme.tsx @@ -1,36 +1,43 @@ import { User } from 'lemmy-js-client'; import { Helmet } from 'inferno-helmet'; +import { Component } from 'inferno'; -export const Theme = (props: { user: User | undefined }) => { - const user = props.user; - const userTheme = user && user.theme && ( - - ); +interface Props { + user: User | undefined; +} - return ( - - {userTheme ?? ( - <> - - - - )} - - ); -}; +export class Theme extends Component { + render() { + const { user } = this.props; + const userTheme = user && user.theme && ( + + ); + + return ( + + {userTheme ?? ( + <> + + + + )} + + ); + } +} diff --git a/src/shared/initialize.ts b/src/shared/initialize.ts index 555da5e..de5762d 100644 --- a/src/shared/initialize.ts +++ b/src/shared/initialize.ts @@ -3,7 +3,7 @@ import { UserService } from './services'; import { i18n } from './i18next'; import { getLanguage } from './utils'; -export const initializeSite = (site: GetSiteResponse) => { +export function initializeSite(site: GetSiteResponse) { UserService.Instance.user = site.my_user; i18n.changeLanguage(getLanguage()); -}; +}