Show displayName of realm on welcome page (#26562)

Closes #25897

Signed-off-by: dipeshsingh253 <sinhdipesh@gmail.com>
This commit is contained in:
Dipesh Singh 2024-01-29 23:53:08 +05:30 committed by GitHub
parent ed96b13312
commit 7e021730c7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -54,7 +54,10 @@ import helpUrls from "../help-urls";
const EmptyDashboard = () => {
const { t } = useTranslation();
const { realm } = useRealm();
const [realmInfo, setRealmInfo] = useState<RealmRepresentation>();
const brandImage = environment.logo ? environment.logo : "/icon.svg";
useFetch(() => adminClient.realms.findOne({ realm }), setRealmInfo, []);
const realmDisplayInfo = realmInfo?.displayName || realm;
return (
<PageSection variant="light">
@ -68,7 +71,7 @@ const EmptyDashboard = () => {
{t("welcome")}
</Title>
<Title headingLevel="h1" size="4xl">
{realm}
{realmDisplayInfo}
</Title>
<EmptyStateBody>{t("introduction")}</EmptyStateBody>
</EmptyState>
@ -130,7 +133,7 @@ const Dashboard = () => {
useFetch(() => adminClient.realms.findOne({ realm }), setRealmInfo, []);
const realmDisplayInfo = realmInfo?.displayName ?? realm;
const realmDisplayInfo = realmInfo?.displayName || realm;
const welcomeTab = useTab("welcome");
const infoTab = useTab("info");