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"; "use client";
import { useContext } from "react"; import { useContext, useEffect, useState } from "react";
import { Trans, useTranslation } from "react-i18next"; import { Trans, useTranslation } from "react-i18next";
import { useTheme } from "styled-components"; import { useTheme } from "styled-components";
@ -46,14 +46,12 @@ type GreetingCleateUserContainerProps = {
type: string; type: string;
firstName?: string; firstName?: string;
lastName?: string; lastName?: string;
hostName: string | null;
}; };
export const GreetingCleateUserContainer = ({ export const GreetingCleateUserContainer = ({
type, type,
firstName, firstName,
lastName, lastName,
hostName,
}: GreetingCleateUserContainerProps) => { }: GreetingCleateUserContainerProps) => {
const { t } = useTranslation(["Confirm", "Common"]); const { t } = useTranslation(["Confirm", "Common"]);
const theme = useTheme(); const theme = useTheme();
@ -61,6 +59,14 @@ export const GreetingCleateUserContainer = ({
const logoUrl = getLogoUrl(WhiteLabelLogoType.LoginPage, !theme.isBase); const logoUrl = getLogoUrl(WhiteLabelLogoType.LoginPage, !theme.isBase);
const [hostName, setHostName] = useState("");
useEffect(() => {
if (process) {
setHostName(window.location.host);
}
}, []);
return ( return (
<GreetingContainer> <GreetingContainer>
<img src={logoUrl} className="portal-logo" alt="greeting-logo" /> <img src={logoUrl} className="portal-logo" alt="greeting-logo" />