From 12d191c739f328dd52442409b13c490f8313fe1f Mon Sep 17 00:00:00 2001 From: Darya Umrikhina Date: Wed, 24 Jul 2024 17:55:44 +0400 Subject: [PATCH] Login:Components:GreetingCleateUserContainer: change getting host name --- .../GreetingCreateUserContainer.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/login/src/components/GreetingContainer/GreetingCreateUserContainer/GreetingCreateUserContainer.tsx b/packages/login/src/components/GreetingContainer/GreetingCreateUserContainer/GreetingCreateUserContainer.tsx index 317ddf3d99..297632c1d4 100644 --- a/packages/login/src/components/GreetingContainer/GreetingCreateUserContainer/GreetingCreateUserContainer.tsx +++ b/packages/login/src/components/GreetingContainer/GreetingCreateUserContainer/GreetingCreateUserContainer.tsx @@ -28,7 +28,7 @@ "use client"; -import { useContext } from "react"; +import { useContext, useEffect, useState } from "react"; import { Trans, useTranslation } from "react-i18next"; import { useTheme } from "styled-components"; @@ -46,14 +46,12 @@ type GreetingCleateUserContainerProps = { type: string; firstName?: string; lastName?: string; - hostName: string | null; }; export const GreetingCleateUserContainer = ({ type, firstName, lastName, - hostName, }: GreetingCleateUserContainerProps) => { const { t } = useTranslation(["Confirm", "Common"]); const theme = useTheme(); @@ -61,6 +59,14 @@ export const GreetingCleateUserContainer = ({ const logoUrl = getLogoUrl(WhiteLabelLogoType.LoginPage, !theme.isBase); + const [hostName, setHostName] = useState(""); + + useEffect(() => { + if (process) { + setHostName(window.location.host); + } + }, []); + return ( greeting-logo