-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Issue 719] Add research intro component (#793)
* Add research intro component * Update common.json for 404 content
- Loading branch information
Showing
4 changed files
with
49 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}); | ||
}); |