Login:Components:GreetingCleateUserContainer: change getting host name

This commit is contained in:
Darya Umrikhina 2024-07-24 17:55:44 +04:00
parent 8e0fbd8470
commit 12d191c739

View File

@ -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 (
<GreetingContainer>
<img src={logoUrl} className="portal-logo" alt="greeting-logo" />