diff --git a/themes/src/main/resources/theme/keycloak.v2/account/src/app/App.tsx b/themes/src/main/resources/theme/keycloak.v2/account/src/app/App.tsx index 66aa20cfbe..fe0dd40ed6 100644 --- a/themes/src/main/resources/theme/keycloak.v2/account/src/app/App.tsx +++ b/themes/src/main/resources/theme/keycloak.v2/account/src/app/App.tsx @@ -33,7 +33,6 @@ import { KeycloakContext } from './keycloak-service/KeycloakContext'; declare function toggleReact(): void; declare function isWelcomePage(): boolean; -declare function loggedInUserName(): string; declare const brandImg: string; declare const brandUrl: string; @@ -57,10 +56,6 @@ export class App extends React.Component { this.context!.login(); } - const username = ( - {loggedInUserName()} - ); - const Header = ( } diff --git a/themes/src/main/resources/theme/keycloak.v2/account/src/app/PageHeaderTool.tsx b/themes/src/main/resources/theme/keycloak.v2/account/src/app/PageHeaderTool.tsx index 6451a59a92..df820a015d 100644 --- a/themes/src/main/resources/theme/keycloak.v2/account/src/app/PageHeaderTool.tsx +++ b/themes/src/main/resources/theme/keycloak.v2/account/src/app/PageHeaderTool.tsx @@ -5,11 +5,14 @@ import {ReferrerLink} from './widgets/ReferrerLink'; import {LogoutButton} from './widgets/Logout'; declare const referrerName: string; +declare function loggedInUserName(): string; export class PageHeaderTool extends React.Component { private hasReferrer: boolean = typeof referrerName !== 'undefined'; public render(): React.ReactNode { + const username = loggedInUserName(); + return ( {this.hasReferrer && @@ -21,6 +24,8 @@ export class PageHeaderTool extends React.Component {
+ + {username}
); }