Skip to content

Commit

Permalink
Banners
Browse files Browse the repository at this point in the history
Signed-off-by: Václav Muzikář <[email protected]>
  • Loading branch information
vmuzikar committed Jul 3, 2024
1 parent 2e6506c commit f40a72d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions js/apps/admin-ui/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { WhoAmIContextProvider } from "./context/whoami/WhoAmI";
import type { Environment } from "./environment";
import { SubGroups } from "./groups/SubGroupsContext";
import { AuthWall } from "./root/AuthWall";
import { Banners } from "./Banner";

const AppContexts = ({ children }: PropsWithChildren) => (
<ErrorBoundaryProvider>
Expand Down Expand Up @@ -71,6 +72,7 @@ export const App = () => {
<ErrorBoundaryFallback fallback={ErrorRenderer}>
<Suspense fallback={<KeycloakSpinner />}>
<AuthWall>
<Banners />
<Outlet />
</AuthWall>
</Suspense>
Expand Down
19 changes: 19 additions & 0 deletions js/apps/admin-ui/src/Banner.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Banner, Flex, FlexItem } from "@patternfly/react-core";
import { ExclamationTriangleIcon } from "@patternfly/react-icons";

const WarnBanner = (text: string) => {
return (
<Banner screenReaderText={text} variant="gold" isSticky>
<Flex spaceItems={{ default: "spaceItemsSm" }}>
<FlexItem>
<ExclamationTriangleIcon />
</FlexItem>
<FlexItem>{text}</FlexItem>
</Flex>
</Banner>
);
};

export const Banners = () => {
return WarnBanner("This is a warning");
};

0 comments on commit f40a72d

Please sign in to comment.