From b7af6334b968efd92ac7d6b9c19cc8dab55d0e29 Mon Sep 17 00:00:00 2001 From: Daphne Gold Date: Thu, 17 Aug 2023 11:17:18 -0700 Subject: [PATCH] [ISSUE 359] Implement Hero for static site (#376) --- frontend/public/locales/en/common.json | 5 ++++ frontend/src/components/Hero.tsx | 27 ++++++++++++++++++++ frontend/src/components/Layout.tsx | 2 ++ frontend/src/styles/_uswds-theme.scss | 4 +++ frontend/stories/components/Hero.stories.tsx | 18 +++++++++++++ frontend/tests/components/Hero.test.tsx | 11 ++++++++ 6 files changed, 67 insertions(+) create mode 100644 frontend/src/components/Hero.tsx create mode 100644 frontend/stories/components/Hero.stories.tsx create mode 100644 frontend/tests/components/Hero.test.tsx diff --git a/frontend/public/locales/en/common.json b/frontend/public/locales/en/common.json index fb1210b0b..489be07ce 100644 --- a/frontend/public/locales/en/common.json +++ b/frontend/public/locales/en/common.json @@ -17,6 +17,11 @@ "nav_menu_toggle": "Menu", "title": "Grants.gov" }, + "Hero": { + "title": "We're building a new Grants.gov!", + "beta": "BETA!", + "content": "This new website will be your go-to resource to follow our progress on improving funding opportunity announcements and the application experience." + }, "Footer": { "agency_name": "Agency name", "return_to_top": "Return to top" diff --git a/frontend/src/components/Hero.tsx b/frontend/src/components/Hero.tsx new file mode 100644 index 000000000..3435871ac --- /dev/null +++ b/frontend/src/components/Hero.tsx @@ -0,0 +1,27 @@ +import { useTranslation } from "next-i18next"; +import { GridContainer } from "@trussworks/react-uswds"; + +const Hero = () => { + const { t } = useTranslation("common", { + keyPrefix: "Hero", + }); + + return ( +
+ +

+ {t("title")} +

+

+ {t("beta")}  + {t("content")} +

+
+
+ ); +}; + +export default Hero; diff --git a/frontend/src/components/Layout.tsx b/frontend/src/components/Layout.tsx index fd706dd95..5e1ffd414 100644 --- a/frontend/src/components/Layout.tsx +++ b/frontend/src/components/Layout.tsx @@ -2,6 +2,7 @@ import { useTranslation } from "next-i18next"; import Footer from "./Footer"; import Header from "./Header"; +import Hero from "./Hero"; type Props = { children: React.ReactNode; @@ -19,6 +20,7 @@ const Layout = ({ children }: Props) => { {t("skip_to_main")}
+
{children}