From dfa11a4764c4eef4a404c78c2d9bcef0dd3d3dcd Mon Sep 17 00:00:00 2001
From: Emma Mansell <73774046+7emansell@users.noreply.github.com>
Date: Wed, 25 Oct 2023 14:21:12 -0400
Subject: [PATCH 1/6] Template for homepage
---
src/pages/index.tsx | 35 ++++++++++++++++++++++++++++++++++-
1 file changed, 34 insertions(+), 1 deletion(-)
diff --git a/src/pages/index.tsx b/src/pages/index.tsx
index 9c100538..d93f77af 100644
--- a/src/pages/index.tsx
+++ b/src/pages/index.tsx
@@ -1,5 +1,38 @@
import CampaignHero from "../components/hero/campaignHero";
+import {
+ SkipNavigation,
+ Template,
+ TemplateAboveHeader,
+ TemplateBreakout,
+ TemplateContent,
+ TemplateFooter,
+ TemplateHeader,
+} from "@nypl/design-system-react-components";
export default function Home() {
- return ;
+ return (
+ <>
+
+
+
+
+ Notification banner
+
+
+ Header
+
+
+
+
+ First swim lane
+ Featured Content
+ Rest of swim lanes
+ Explore further and links
+
+
+ Footer
+
+
+ >
+ );
}
From 307f21c0384df4b0548983e3654766ecf678ce7d Mon Sep 17 00:00:00 2001
From: Emma Mansell <73774046+7emansell@users.noreply.github.com>
Date: Wed, 25 Oct 2023 14:37:59 -0400
Subject: [PATCH 2/6] Tests and other fixes
---
README.md | 1 -
__tests__/{ => api}/featureditems.test.tsx | 0
__tests__/homepage.test.tsx | 51 ++++++++++++++++++++++
3 files changed, 51 insertions(+), 1 deletion(-)
rename __tests__/{ => api}/featureditems.test.tsx (100%)
diff --git a/README.md b/README.md
index 7db937c4..0b4fc24b 100644
--- a/README.md
+++ b/README.md
@@ -53,7 +53,6 @@ The following endpoints are currently available at http://localhost:3000/api/lan
- [/photographs](http://localhost:3000/api/lanes/photographs)
- [/prints-and-drawings](http://localhost:3000/api/lanes/prints-and-drawings)
- [/recently-digitized-collections](http://localhost:3000/api/lanes/recently-digitized-collections)
-- [/items](http://localhost:3000/api/lanes/items)
### Individual Lane - GET /api/lanes/[...slug]
diff --git a/__tests__/featureditems.test.tsx b/__tests__/api/featureditems.test.tsx
similarity index 100%
rename from __tests__/featureditems.test.tsx
rename to __tests__/api/featureditems.test.tsx
diff --git a/__tests__/homepage.test.tsx b/__tests__/homepage.test.tsx
index b692d158..86023ac7 100644
--- a/__tests__/homepage.test.tsx
+++ b/__tests__/homepage.test.tsx
@@ -17,4 +17,55 @@ describe("Home", () => {
});
expect(header).toBeInTheDocument();
});
+
+ it("renders SkipNavigation", () => {
+ const { getByText } = render();
+ expect(getByText("SkipNavigation")).toBeInTheDocument();
+ });
+
+ it("renders Template", () => {
+ const { getByText } = render();
+ expect(getByText("Template")).toBeInTheDocument();
+ });
+
+ it("renders TemplateBreakout", () => {
+ const { getByText } = render();
+ expect(getByText("TemplateBreakout")).toBeInTheDocument();
+ });
+
+ it("renders TemplateAboveHeader", () => {
+ const { getByText } = render();
+ expect(getByText("TemplateAboveHeader")).toBeInTheDocument();
+ });
+
+ it("renders TemplateHeader", () => {
+ const { getByText } = render();
+ expect(getByText("TemplateHeader")).toBeInTheDocument();
+ });
+
+ it("renders CampaignHero", () => {
+ const { getByText } = render();
+ expect(getByText("CampaignHero")).toBeInTheDocument();
+ });
+
+ it("renders TemplateContent", () => {
+ const { getByText } = render();
+ expect(getByText("TemplateContent")).toBeInTheDocument();
+ });
+
+ it("renders TemplateFooter", () => {
+ const { getByText } = render();
+ expect(getByText("TemplateFooter")).toBeInTheDocument();
+ });
+
+ it("renders the expected text content", () => {
+ const { getByText } = render();
+ expect(getByText("Notification banner")).toBeInTheDocument();
+ expect(getByText("Header")).toBeInTheDocument();
+ expect(getByText("First swim lane")).toBeInTheDocument();
+ expect(getByText("Featured Content")).toBeInTheDocument();
+ expect(getByText("Rest of swim lanes")).toBeInTheDocument();
+ expect(getByText("Explore further and links")).toBeInTheDocument();
+ expect(getByText("Footer")).toBeInTheDocument();
+ });
});
From 46049359d64b744df9379506863072b0398ba3ec Mon Sep 17 00:00:00 2001
From: Emma Mansell <73774046+7emansell@users.noreply.github.com>
Date: Wed, 25 Oct 2023 14:47:28 -0400
Subject: [PATCH 3/6] tests
---
__tests__/homepage.test.tsx | 40 -------------------------------------
1 file changed, 40 deletions(-)
diff --git a/__tests__/homepage.test.tsx b/__tests__/homepage.test.tsx
index 86023ac7..36646169 100644
--- a/__tests__/homepage.test.tsx
+++ b/__tests__/homepage.test.tsx
@@ -18,46 +18,6 @@ describe("Home", () => {
expect(header).toBeInTheDocument();
});
- it("renders SkipNavigation", () => {
- const { getByText } = render();
- expect(getByText("SkipNavigation")).toBeInTheDocument();
- });
-
- it("renders Template", () => {
- const { getByText } = render();
- expect(getByText("Template")).toBeInTheDocument();
- });
-
- it("renders TemplateBreakout", () => {
- const { getByText } = render();
- expect(getByText("TemplateBreakout")).toBeInTheDocument();
- });
-
- it("renders TemplateAboveHeader", () => {
- const { getByText } = render();
- expect(getByText("TemplateAboveHeader")).toBeInTheDocument();
- });
-
- it("renders TemplateHeader", () => {
- const { getByText } = render();
- expect(getByText("TemplateHeader")).toBeInTheDocument();
- });
-
- it("renders CampaignHero", () => {
- const { getByText } = render();
- expect(getByText("CampaignHero")).toBeInTheDocument();
- });
-
- it("renders TemplateContent", () => {
- const { getByText } = render();
- expect(getByText("TemplateContent")).toBeInTheDocument();
- });
-
- it("renders TemplateFooter", () => {
- const { getByText } = render();
- expect(getByText("TemplateFooter")).toBeInTheDocument();
- });
-
it("renders the expected text content", () => {
const { getByText } = render();
expect(getByText("Notification banner")).toBeInTheDocument();
From e5a1089a0b10e1b6bf4c082d825f7c606d88b3f0 Mon Sep 17 00:00:00 2001
From: Emma Mansell <73774046+7emansell@users.noreply.github.com>
Date: Wed, 25 Oct 2023 14:53:16 -0400
Subject: [PATCH 4/6] update language
---
__tests__/homepage.test.tsx | 2 +-
src/pages/index.tsx | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/__tests__/homepage.test.tsx b/__tests__/homepage.test.tsx
index 36646169..6781579c 100644
--- a/__tests__/homepage.test.tsx
+++ b/__tests__/homepage.test.tsx
@@ -25,7 +25,7 @@ describe("Home", () => {
expect(getByText("First swim lane")).toBeInTheDocument();
expect(getByText("Featured Content")).toBeInTheDocument();
expect(getByText("Rest of swim lanes")).toBeInTheDocument();
- expect(getByText("Explore further and links")).toBeInTheDocument();
+ expect(getByText("Explore further links")).toBeInTheDocument();
expect(getByText("Footer")).toBeInTheDocument();
});
});
diff --git a/src/pages/index.tsx b/src/pages/index.tsx
index d93f77af..16229eb1 100644
--- a/src/pages/index.tsx
+++ b/src/pages/index.tsx
@@ -27,7 +27,7 @@ export default function Home() {
First swim lane
Featured Content
Rest of swim lanes
- Explore further and links
+ Explore further links
Footer
From 08b1bbeadb0dcdf7abe4159463169925a5e3d16b Mon Sep 17 00:00:00 2001
From: Emma Mansell <73774046+7emansell@users.noreply.github.com>
Date: Wed, 25 Oct 2023 15:50:22 -0400
Subject: [PATCH 5/6] With TemplateAppContainer
---
src/pages/index.tsx | 36 +++++++++++-------------------------
1 file changed, 11 insertions(+), 25 deletions(-)
diff --git a/src/pages/index.tsx b/src/pages/index.tsx
index 16229eb1..b3aada65 100644
--- a/src/pages/index.tsx
+++ b/src/pages/index.tsx
@@ -1,38 +1,24 @@
import CampaignHero from "../components/hero/campaignHero";
import {
SkipNavigation,
- Template,
- TemplateAboveHeader,
- TemplateBreakout,
- TemplateContent,
- TemplateFooter,
- TemplateHeader,
+ TemplateAppContainer,
} from "@nypl/design-system-react-components";
export default function Home() {
return (
- <>
-
-
-
-
- Notification banner
-
-
- Header
-
-
-
-
+ Notification banner }
+ header={ Header
}
+ breakout={}
+ contentPrimary={
+ <>
First swim lane
Featured Content
Rest of swim lanes
Explore further links
-
-
- Footer
-
-
- >
+ >
+ }
+ renderSkipNavigation={true}
+ />
);
}
From 8ad6ebe2dd5960573387a8b6ea756686601b8c08 Mon Sep 17 00:00:00 2001
From: Emma Mansell <73774046+7emansell@users.noreply.github.com>
Date: Wed, 25 Oct 2023 15:52:24 -0400
Subject: [PATCH 6/6] Updated test
---
__tests__/homepage.test.tsx | 1 -
1 file changed, 1 deletion(-)
diff --git a/__tests__/homepage.test.tsx b/__tests__/homepage.test.tsx
index 6781579c..f5955f38 100644
--- a/__tests__/homepage.test.tsx
+++ b/__tests__/homepage.test.tsx
@@ -26,6 +26,5 @@ describe("Home", () => {
expect(getByText("Featured Content")).toBeInTheDocument();
expect(getByText("Rest of swim lanes")).toBeInTheDocument();
expect(getByText("Explore further links")).toBeInTheDocument();
- expect(getByText("Footer")).toBeInTheDocument();
});
});