diff --git a/js/apps/admin-ui/src/App.tsx b/js/apps/admin-ui/src/App.tsx index c3ba39f1f2..081aa4f1b1 100644 --- a/js/apps/admin-ui/src/App.tsx +++ b/js/apps/admin-ui/src/App.tsx @@ -7,16 +7,17 @@ import { Page } from "@patternfly/react-core"; import { PropsWithChildren, Suspense, useEffect, useState } from "react"; import { Outlet } from "react-router-dom"; +import { + ErrorBoundaryFallback, + ErrorBoundaryProvider, + KeycloakSpinner, +} from "@keycloak/keycloak-ui-shared"; +import { Banners } from "./Banners"; import { Header } from "./PageHeader"; import { PageNav } from "./PageNav"; import { AdminClientContext, initAdminClient } from "./admin-client"; import { PageBreadCrumbs } from "./components/bread-crumb/PageBreadCrumbs"; import { ErrorRenderer } from "./components/error/ErrorRenderer"; -import { KeycloakSpinner } from "@keycloak/keycloak-ui-shared"; -import { - ErrorBoundaryFallback, - ErrorBoundaryProvider, -} from "@keycloak/keycloak-ui-shared"; import { RecentRealmsProvider } from "./context/RecentRealms"; import { AccessContextProvider } from "./context/access/Access"; import { RealmContextProvider } from "./context/realm-context/RealmContext"; @@ -25,7 +26,6 @@ import { WhoAmIContextProvider } from "./context/whoami/WhoAmI"; import type { Environment } from "./environment"; import { SubGroups } from "./groups/SubGroupsContext"; import { AuthWall } from "./root/AuthWall"; -import { Banners } from "./Banners"; const AppContexts = ({ children }: PropsWithChildren) => ( @@ -59,6 +59,7 @@ export const App = () => { return ( + } isManagedSidebar @@ -66,7 +67,6 @@ export const App = () => { breadcrumb={} mainContainerId={mainPageContentId} > - }> diff --git a/js/apps/admin-ui/src/Banners.tsx b/js/apps/admin-ui/src/Banners.tsx index 9ec4c914b1..acd2f88936 100644 --- a/js/apps/admin-ui/src/Banners.tsx +++ b/js/apps/admin-ui/src/Banners.tsx @@ -3,7 +3,11 @@ import { ExclamationTriangleIcon } from "@patternfly/react-icons"; import { useWhoAmI } from "./context/whoami/WhoAmI"; import { useTranslation } from "react-i18next"; -const WarnBanner = (msg: string) => { +type WarnBannerProps = { + msg: string; +}; + +const WarnBanner = ({ msg }: WarnBannerProps) => { const { t } = useTranslation(); return ( @@ -21,6 +25,5 @@ const WarnBanner = (msg: string) => { export const Banners = () => { const { whoAmI } = useWhoAmI(); - if (whoAmI.isTemporary()) return WarnBanner("loggedInAsTempAdminUser"); - // more banners in the future? + if (whoAmI.isTemporary()) return ; };