-
-
+
+
+
);
-}
+};
+
+Footer.defaultProps = {
+ contactLink: "https://www.canada.ca/en/contact.html",
+ withMainBand: true,
+};
Footer.propTypes = {
/**
- * array of objects containing the link text and link
+ * id of this component
*/
- footerBoxLinks: PropTypes.arrayOf(
- PropTypes.shape({
- footerBoxlink: PropTypes.string.isRequired,
- footerBoxLinkText: PropTypes.string.isRequired,
- })
- ),
+ id: PropTypes.string.isRequired,
+ /**
+ * Add the path Link to the top of your page for the "to the Top" button in mobile
+ */
+ btnLink: PropTypes.string.isRequired,
+
/**
- * array of objects containing the link text and link
+ * If true will display the error page version of the footer component
*/
- links: PropTypes.arrayOf(
+ error: PropTypes.bool,
+
+ /**
+ * Allow user to pass in their own contact link
+ */
+ contactLink: PropTypes.string,
+
+ /**
+ * List of links to display on the footer
+ */
+ brandLinks: PropTypes.arrayOf(
PropTypes.shape({
- link: PropTypes.string.isRequired,
- linkText: PropTypes.string.isRequired,
- })
+ id: PropTypes.string,
+ text: PropTypes.string,
+ href: PropTypes.string,
+ }).isRequired
),
/**
- * alt text for footer canada-ca logo
+ * Specifies where to open the linked document
*/
- footerLogoAltText: PropTypes.string.isRequired,
+ target: PropTypes.string,
/**
- * image path for footer logo
+ * Handle onclick on the footer media link
*/
- footerLogoImage: PropTypes.string.isRequired,
+ onClick: PropTypes.func,
+
+ /**
+ * List of menu items to display in dropdown with links
+ */
+ contextualBandLinks: PropTypes.arrayOf(
+ PropTypes.shape({
+ key: PropTypes.string,
+ text: PropTypes.string,
+ link: PropTypes.string,
+ })
+ ),
};
diff --git a/components/organisms/Footer.stories.js b/components/organisms/Footer.stories.js
index 6e60079d2d..80f971b856 100644
--- a/components/organisms/Footer.stories.js
+++ b/components/organisms/Footer.stories.js
@@ -1,5 +1,5 @@
+import React from "react";
import { Footer } from "./Footer";
-import logo from "../../public/wmms-blk.svg";
export default {
title: "Components/Organisms/Footer",
@@ -8,81 +8,9 @@ export default {
const Template = (args) =>
;
-export const Primary = Template.bind({});
-Primary.args = {
- links: [
- {
- link: "https://some-link-1.com",
- linkText: "some-link-1",
- },
- {
- link: "https://some-link-2.com",
- linkText: "some-lin-2",
- },
- {
- link: "https://some-link-3.com",
- linkText: "some-link-3",
- },
- {
- link: "https://some-link-4.com",
- linkText: "some-link-4",
- },
- {
- link: "https://some-link-5.com",
- linkText: "some-link-5",
- },
- {
- link: "https://some-link-6.com",
- linkText: "some-link-6",
- },
- {
- link: "https://some-link-7.com",
- linkText: "some-link-7",
- },
- {
- link: "https://some-link-8.com",
- linkText: "some-link-8",
- },
- ],
-
- footerBoxLinks: [
- {
- footerBoxlink: "https://some-link-11.com",
- footerBoxLinkText: "some-link-11",
- },
- {
- footerBoxlink: "https://some-link-22.com",
- footerBoxLinkText: "some-lin-22",
- },
- {
- footerBoxlink: "https://some-link-33.com",
- footerBoxLinkText: "some-link-33",
- },
- {
- footerBoxlink: "https://some-link-44.com",
- footerBoxLinkText: "some-link-44",
- },
- {
- footerBoxlink: "https://some-link-55.com",
- footerBoxLinkText: "some-link-55",
- },
- {
- footerBoxlink: "https://some-link-66.com",
- footerBoxLinkText: "some-link-66",
- },
- {
- footerBoxlink: "https://some-link-77.com",
- footerBoxLinkText: "some-link-77",
- },
- {
- footerBoxlink: "https://some-link-88.com",
- footerBoxLinkText: "some-link-88",
- },
- ],
-
- footerLogoAltText: "Symbol of the Government of Canada",
- footerLogoImage: logo,
- reportBtnText: "Report a problem",
- reportDescription:
- "Experiencing an issue with this product or have you spotted an error?",
+export const DefaultFooter = Template.bind({});
+DefaultFooter.args = {
+ id: "footer",
+ btnLink: "/",
+ target: "_blank",
};
diff --git a/components/organisms/Footer.test.js b/components/organisms/Footer.test.js
index 94ce3a9f94..ef13b16afa 100644
--- a/components/organisms/Footer.test.js
+++ b/components/organisms/Footer.test.js
@@ -1,23 +1,28 @@
-/**
- * @jest-environment jsdom
- */
import React from "react";
import { render, screen } from "@testing-library/react";
-import "@testing-library/jest-dom/extend-expect";
-import { Primary } from "./Footer.stories";
+import { Footer } from "./Footer";
+import { DefaultFooter } from "./Footer.stories.js";
+import { axe, toHaveNoViolations } from "jest-axe";
-it("renders Footer in its primary state", () => {
- render(
);
+expect.extend(toHaveNoViolations);
- expect(
- screen.getByAltText("Symbol of the Government of Canada")
- ).toBeTruthy();
-
- Primary.args.footerBoxLinks.forEach((value) => {
- screen.getByText(value.footerBoxLinkText);
+describe("Footer", () => {
+ test("renders Footer component with default props", async () => {
+ const { container } = render(
);
+ expect(screen.getByTestId("footer")).toBeInTheDocument();
+ expect(
+ screen.getByAltText("Symbol of the Government of Canada")
+ ).toBeInTheDocument();
+ const results = await axe(container);
+ expect(results).toHaveNoViolations();
});
- Primary.args.links.forEach((value) => {
- screen.getByText(value.linkText);
+ test("renders Footer component with custom brand links", async () => {
+ const { container } = render(
);
+ expect(screen.getByTestId("footer")).toBeInTheDocument();
+ expect(screen.getByText("Social media")).toBeInTheDocument();
+ expect(screen.getByText("Mobile applications")).toBeInTheDocument();
+ const results = await axe(container);
+ expect(results).toHaveNoViolations();
});
});
diff --git a/components/design-system/HelpIcon.jsx b/components/organisms/HelpIcon.js
similarity index 98%
rename from components/design-system/HelpIcon.jsx
rename to components/organisms/HelpIcon.js
index e5f33a0db2..150f8ba9c7 100644
--- a/components/design-system/HelpIcon.jsx
+++ b/components/organisms/HelpIcon.js
@@ -1,6 +1,6 @@
import { useState } from "react";
import { Modal } from "react-bootstrap";
-import { Button } from "./Button";
+import { DSButton } from "../atoms/DSButton";
export const HelpIcon = ({ title, body, lang }) => {
const [showModal, setShowModal] = useState(false);
@@ -61,7 +61,7 @@ export const HelpIcon = ({ title, body, lang }) => {
/>
-
-
+
);
};
diff --git a/jsconfig.json b/jsconfig.json
new file mode 100644
index 0000000000..69d0995242
--- /dev/null
+++ b/jsconfig.json
@@ -0,0 +1,9 @@
+{
+ "compilerOptions": {
+ "target": "ES6"
+ },
+ "exclude": [
+ "node_modules",
+ "**/node_modules/*"
+ ]
+}
\ No newline at end of file
diff --git a/pages/home.js b/pages/home.js
index e7e996a63d..704f7bf42f 100644
--- a/pages/home.js
+++ b/pages/home.js
@@ -4,8 +4,8 @@ import { Layout } from "../components/organisms/Layout";
import { useEffect } from "react";
import Card from "../components/molecules/Card";
import aemServiceInstance from "../services/aemServiceInstance";
-import { Heading } from "../components/design-system/Heading";
-import { ContextualAlert } from "../components/design-system/ContextualAlert";
+import { Heading } from "../components/molecules/Heading";
+import { ContextualAlert } from "../components/molecules/ContextualAlert";
export default function Home(props) {
const pageData = props.pageData?.item;
diff --git a/pages/projects/benefits-navigator/[id].js b/pages/projects/benefits-navigator/[id].js
index 787d0175f7..4865d704db 100644
--- a/pages/projects/benefits-navigator/[id].js
+++ b/pages/projects/benefits-navigator/[id].js
@@ -6,7 +6,7 @@ import aemServiceInstance from "../../../services/aemServiceInstance";
import { getAllUpdateIds } from "../../../lib/utils/getAllUpdateIds";
import { createBreadcrumbs } from "../../../lib/utils/createBreadcrumbs";
import FragmentRender from "../../../components/fragment_renderer/FragmentRender";
-import { Heading } from "../../../components/design-system/Heading";
+import { Heading } from "../../../components/molecules/Heading";
export default function DynamicBenefitNavigatorPage(props) {
const [pageData] = useState(props.pageData);
diff --git a/pages/projects/benefits-navigator/index.js b/pages/projects/benefits-navigator/index.js
index 5fed4ea491..cce21b05a7 100644
--- a/pages/projects/benefits-navigator/index.js
+++ b/pages/projects/benefits-navigator/index.js
@@ -6,8 +6,8 @@ import aemServiceInstance from "../../../services/aemServiceInstance";
import { ProjectInfo } from "../../../components/atoms/ProjectInfo";
import Card from "../../../components/molecules/Card";
import { createBreadcrumbs } from "../../../lib/utils/createBreadcrumbs";
-import { Heading } from "../../../components/design-system/Heading";
-import { Collapse } from "../../../components/design-system/Collapse";
+import { Heading } from "../../../components/molecules/Heading";
+import { Collapse } from "../../../components/molecules/Collapse";
export default function BenefitsNavigatorOverview(props) {
const [pageData] = useState(props.pageData.item);
diff --git a/pages/projects/dashboard/index.js b/pages/projects/dashboard/index.js
index e2d13b96ac..633ed37792 100644
--- a/pages/projects/dashboard/index.js
+++ b/pages/projects/dashboard/index.js
@@ -5,8 +5,8 @@ import { useEffect } from "react";
import aemServiceInstance from "../../../services/aemServiceInstance";
import { ProjectInfo } from "../../../components/atoms/ProjectInfo";
import { createBreadcrumbs } from "../../../lib/utils/createBreadcrumbs";
-import { Heading } from "../../../components/design-system/Heading";
-import { Collapse } from "../../../components/design-system/Collapse";
+import { Heading } from "../../../components/molecules/Heading";
+import { Collapse } from "../../../components/molecules/Collapse";
export default function MscaDashboard(props) {
const pageData = props.pageData?.item;
diff --git a/pages/projects/digital-standards-playbook/index.js b/pages/projects/digital-standards-playbook/index.js
index f19e692e4d..307f631abf 100644
--- a/pages/projects/digital-standards-playbook/index.js
+++ b/pages/projects/digital-standards-playbook/index.js
@@ -5,7 +5,7 @@ import { useEffect } from "react";
import aemServiceInstance from "../../../services/aemServiceInstance";
import { ProjectInfo } from "../../../components/atoms/ProjectInfo";
import { createBreadcrumbs } from "../../../lib/utils/createBreadcrumbs";
-import { Heading } from "../../../components/design-system/Heading";
+import { Heading } from "../../../components/molecules/Heading";
import { ActionButton } from "../../../components/atoms/ActionButton";
export default function DigitalStandardsPlaybookPage(props) {
diff --git a/pages/projects/oas-benefits-estimator/[id].js b/pages/projects/oas-benefits-estimator/[id].js
index 114d679889..43bde3eb4f 100644
--- a/pages/projects/oas-benefits-estimator/[id].js
+++ b/pages/projects/oas-benefits-estimator/[id].js
@@ -7,7 +7,7 @@ import aemServiceInstance from "../../../services/aemServiceInstance";
import { getAllUpdateIds } from "../../../lib/utils/getAllUpdateIds";
import { createBreadcrumbs } from "../../../lib/utils/createBreadcrumbs";
import FragmentRender from "../../../components/fragment_renderer/FragmentRender";
-import { Heading } from "../../../components/design-system/Heading";
+import { Heading } from "../../../components/molecules/Heading";
export default function OASUpdatePage(props) {
const { t } = useTranslation("common");
diff --git a/pages/projects/oas-benefits-estimator/index.js b/pages/projects/oas-benefits-estimator/index.js
index a5ff6a7367..2c44d3b500 100644
--- a/pages/projects/oas-benefits-estimator/index.js
+++ b/pages/projects/oas-benefits-estimator/index.js
@@ -7,8 +7,7 @@ import aemServiceInstance from "../../../services/aemServiceInstance";
import { ProjectInfo } from "../../../components/atoms/ProjectInfo";
import Card from "../../../components/molecules/Card";
import { createBreadcrumbs } from "../../../lib/utils/createBreadcrumbs";
-import { CTA } from "../../../components/design-system/CTA";
-import { Heading } from "../../../components/design-system/Heading";
+import { Heading } from "../../../components/molecules/Heading";
export default function OasBenefitsEstimator(props) {
const [pageData] = useState(props.pageData.item);
diff --git a/public/image1.png b/public/image1.png
new file mode 100644
index 0000000000..14c3e52257
Binary files /dev/null and b/public/image1.png differ
diff --git a/public/image2.png b/public/image2.png
new file mode 100644
index 0000000000..24f6de938c
Binary files /dev/null and b/public/image2.png differ
diff --git a/public/plus.svg b/public/plus.svg
new file mode 100644
index 0000000000..7d8292aad3
--- /dev/null
+++ b/public/plus.svg
@@ -0,0 +1,3 @@
+