diff --git a/react-app/src/components/Banner/MMDLSpaBanner.tsx b/react-app/src/components/Banner/MMDLSpaBanner.tsx new file mode 100644 index 0000000000..9916be1bf9 --- /dev/null +++ b/react-app/src/components/Banner/MMDLSpaBanner.tsx @@ -0,0 +1,44 @@ +import { useState } from "react"; +import { Cross2Icon } from "@radix-ui/react-icons"; +import { InfoCircledIcon } from "@radix-ui/react-icons"; +const MMDLAlertBanner = () => { + const [isVisible, setIsVisible] = useState(true); + const handleDismiss = () => { + setIsVisible(false); + }; + if (!isVisible) return null; + return ( +
+
+ ); +}; +export default MMDLAlertBanner; diff --git a/react-app/src/components/Layout/index.test.tsx b/react-app/src/components/Layout/index.test.tsx index 96d2e41372..af52b70377 100644 --- a/react-app/src/components/Layout/index.test.tsx +++ b/react-app/src/components/Layout/index.test.tsx @@ -105,7 +105,7 @@ const setupUserDropdownTest = async (viewMode: ViewMode = VIEW_MODES.DESKTOP) => await setupTest(viewMode); if (!viewMode.desktop) { - await user.click(screen.getByRole("button")); + await user.click(screen.getByTestId("mobile-menu-button")); } const myAccountButton = screen.getByText("My Account"); @@ -242,7 +242,7 @@ describe("Layout", () => { expect(screen.queryByText("Home")).not.toBeInTheDocument(); // Open the menu - const menuButton = screen.getByRole("button"); + const menuButton = screen.getByTestId("mobile-menu-button"); await user.click(menuButton); expect(screen.getByText("Home")).toBeInTheDocument(); diff --git a/react-app/src/components/Layout/index.tsx b/react-app/src/components/Layout/index.tsx index c253710e27..0e978547c5 100644 --- a/react-app/src/components/Layout/index.tsx +++ b/react-app/src/components/Layout/index.tsx @@ -11,6 +11,7 @@ import * as DropdownMenu from "@radix-ui/react-dropdown-menu"; import config from "@/config"; import { ScrollToTop, SimplePageContainer, UserPrompt, Banner } from "@/components"; import { isFaqPage, isProd } from "@/utils"; +import MMDLAlertBanner from "@/components/Banner/MMDLSpaBanner"; /** * Custom hook that generates a list of navigation links based on the user's status and whether the current page is the FAQ page. @@ -152,10 +153,11 @@ export const Layout = () => {
+ {user?.user && !isFaqPage && }