Skip to content

Commit

Permalink
[Issue 719] Add research intro component (#793)
Browse files Browse the repository at this point in the history
* Add research intro component

* Update common.json for 404 content
  • Loading branch information
acouch authored Dec 4, 2023
1 parent 293b47b commit c050a66
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 4 deletions.
8 changes: 5 additions & 3 deletions frontend/public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
"page_title": "Research | Simpler Grants.gov",
"meta_description": "A one‑stop shop for all federal discretionary funding to make it easy for you to discover, understand, and apply for opportunities.",
"alert_title": "Simpler Grants.gov is a work in progress.",
"alert": "To search for funding opportunities and apply, go to <LinkToGrants>www.grants.gov</LinkToGrants>."
"alert": "To search for funding opportunities and apply, go to <LinkToGrants>www.grants.gov</LinkToGrants>.",
"intro_title": "Our existing research",
"intro_content": "We conducted extensive research in 2023 to gather insights from applicants, potential applicants, and grantmakers. We’re using these findings to guide our work. And your ongoing feedback will inform and inspire new features as we build a simpler Grants gov together."
},
"Process": {
"page_title": "Process | Simpler Grants.gov",
Expand All @@ -51,8 +53,8 @@
},
"ErrorPages": {
"page_not_found": {
"title": "Ooops! Page Not Found",
"message_content_1": "The page you have requested cannot be displayed because it does not exist, has been moved, or the server has been instrcuted not to let you view it. There is nothing to see here.",
"title": "Oops! Page Not Found",
"message_content_1": "The page you have requested cannot be displayed because it does not exist, has been moved, or the server has been instructed not to let you view it. There is nothing to see here.",
"visit_homepage_button": "Return Home"
}
},
Expand Down
27 changes: 27 additions & 0 deletions frontend/src/components/ResearchIntro.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { useTranslation } from "next-i18next";
import { Grid, GridContainer } from "@trussworks/react-uswds";

const ResearchIntro = () => {
const { t } = useTranslation("common", { keyPrefix: "Research" });

return (
<GridContainer className="padding-bottom-5 tablet:padding-top-0 desktop-lg:padding-top-0 border-bottom-2px border-base-lightest">
<h1 className="margin-0 tablet-lg:font-sans-xl desktop-lg:font-sans-2xl">
{t("intro_title")}
</h1>
<Grid row gap>
<Grid
tabletLg={{ col: 12 }}
desktop={{ col: 12 }}
desktopLg={{ col: 12 }}
>
<p className="tablet-lg:font-sans-xl line-height-sans-3 usa-intro margin-top-2">
{t("intro_content")}
</p>
</Grid>
</Grid>
</GridContainer>
);
};

export default ResearchIntro;
3 changes: 2 additions & 1 deletion frontend/src/pages/research.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { serverSideTranslations } from "next-i18next/serverSideTranslations";

import Breadcrumbs from "src/components/Breadcrumbs";
import PageSEO from "src/components/PageSEO";
import ResearchIntro from "src/components/ResearchIntro";
import FullWidthAlert from "../components/FullWidthAlert";

const Research: NextPage = () => {
Expand All @@ -31,7 +32,7 @@ const Research: NextPage = () => {
/>
</FullWidthAlert>
<Breadcrumbs breadcrumbList={RESEARCH_CRUMBS} />
Research Placeholder
<ResearchIntro />
</>
);
};
Expand Down
15 changes: 15 additions & 0 deletions frontend/tests/components/ResearchIntro.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { render, screen } from "@testing-library/react";

import ResearchIntro from "src/components/ResearchIntro";

describe("Research Content", () => {
it("Renders without errors", () => {
render(<ResearchIntro />);
const ProcessH1 = screen.getByRole("heading", {
level: 1,
name: /Our existing research/i,
});

expect(ProcessH1).toBeInTheDocument();
});
});

0 comments on commit c050a66

Please sign in to comment.