Skip to content

Commit

Permalink
merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
Rocio De Santiago authored and Rocio De Santiago committed Jul 30, 2024
2 parents 9acc18a + 5af6073 commit 598922e
Show file tree
Hide file tree
Showing 6 changed files with 306 additions and 1 deletion.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
9 changes: 8 additions & 1 deletion services/ui-src/src/components/app/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import { useContext } from "react";
import { Routes, Route } from "react-router-dom";
import { Container, Divider, Flex, Heading, Stack } from "@chakra-ui/react";
import { Header, LoginCognito, LoginIDM, PostLogoutRedirect } from "components";
import {
Header,
LoginCognito,
LoginIDM,
PostLogoutRedirect,
Footer,
} from "components";
import { makeMediaQueryClasses, UserContext, useStore } from "utils";

export const App = () => {
Expand All @@ -28,6 +34,7 @@ export const App = () => {
{user && (
<Flex data-testid="app-container" sx={sx.appLayout}>
<Header handleLogout={logout} />
<Footer />
</Flex>
)}
{!user && showLocalLogins && (
Expand Down
1 change: 1 addition & 0 deletions services/ui-src/src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export { Error } from "./app/Error";
// layout
export { Header } from "./layout/Header";
export { PageTemplate } from "./layout/PageTemplate";
export { Footer } from "./layout/Footer";
// logins
export { LoginCognito } from "./logins/LoginCognito";
export { LoginIDM } from "./logins/LoginIDM";
Expand Down
41 changes: 41 additions & 0 deletions services/ui-src/src/components/layout/Footer.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { render, screen } from "@testing-library/react";
import { axe } from "jest-axe";
import { RouterWrappedComponent } from "utils/testing/setupJest";
import { Footer } from "components";

const footerComponent = (
<RouterWrappedComponent>
<Footer />
</RouterWrappedComponent>
);

describe("Test Footer", () => {
beforeEach(() => {
render(footerComponent);
});

test("Footer is visible", () => {
const footer = screen.getByRole("contentinfo");
expect(footer).toBeVisible();
});

test("Logo is visible", () => {
expect(screen.getByAltText("HCBS logo")).toBeVisible();
});

test("Help link is visible", () => {
expect(screen.getByText("Contact Us")).toBeVisible();
});

test("Accessibility statement link is visible", () => {
expect(screen.getByText("Accessibility Statement")).toBeVisible();
});
});

describe("Test Footer accessibility", () => {
it("Should not have basic accessibility issues", async () => {
const { container } = render(footerComponent);
const results = await axe(container);
expect(results).toHaveNoViolations();
});
});
256 changes: 256 additions & 0 deletions services/ui-src/src/components/layout/Footer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,256 @@
import { Link as RouterLink } from "react-router-dom";
import { Box, Container, Flex, Image, Link, Text } from "@chakra-ui/react";
import { useBreakpoint } from "utils";
import hhsLogo from "assets/logos/logo_hhs.png";
import medicaidLogo from "assets/logos/logo_medicaid.svg";
import hcbsLogo from "assets/logos/logo_mdct_hcbs_footer.png";

export const Footer = () => {
const { isDesktop } = useBreakpoint();
return (
<Box sx={sx.root} id="footer" role="contentinfo">
<Box sx={sx.footerTop}>
<Container sx={sx.footerTopContainer}>
<Flex sx={sx.footerTopFlex}>
<Box sx={sx.footerTopLeftContainer}>
<Image src={hcbsLogo} alt="HCBS logo" sx={sx.hcbsLogo} />
</Box>
<Box sx={sx.footerTopRightContainer}>
<Flex sx={sx.footerTopRightTopFlex}>
<Box sx={sx.footerCMSBrandingLeft}>
<Box sx={sx.hhsLogo}>
<Image
src={hhsLogo}
alt="Department of Health and Human Services, USA"
/>
</Box>

{!isDesktop && (
<Box sx={sx.hhsMedicaidLogoMobile}>
<Image
src={medicaidLogo}
alt="Medicaid.gov: Keeping America Healthy"
/>
</Box>
)}
</Box>
<Box sx={sx.footerCMSBrandingRight}>
<Text sx={sx.hhsCopyText}>
A federal government website managed and paid for by the
U.S. Centers for Medicare and Medicaid Services and part of
the MDCT suite.
</Text>
</Box>
</Flex>
{isDesktop && (
<Flex sx={sx.footerCMSMedicaid}>
<Box sx={sx.medicaidLogo}>
<Image
src={medicaidLogo}
alt="Medicaid.gov: Keeping America Healthy"
/>
</Box>
</Flex>
)}
</Box>
</Flex>
</Container>
</Box>
<Box sx={sx.footerBottom}>
<Container sx={sx.footerBottomContainer}>
<Flex sx={sx.footerBottomFlex}>
<Flex sx={sx.footerBottomLinkFlex}>
<Link as={RouterLink} to="/help" variant="inverse" sx={sx.link}>
Contact Us
</Link>
<Link
href="https://www.cms.gov/About-CMS/Agency-Information/Aboutwebsite/CMSNondiscriminationNotice"
target="_blank"
variant="inverse"
sx={sx.link}
>
Accessibility Statement
</Link>
</Flex>
<Flex>
<Text sx={sx.address}>
7500 Security Boulevard Baltimore, MD 21244
</Text>
</Flex>
</Flex>
</Container>
</Box>
</Box>
);
};

const sx = {
root: {
flexShrink: "0",
".desktop &": {
position: "sticky",
zIndex: "sticky",
},
"@media print": {
display: "none",
},
},
footerTop: {
bg: "palette.gray_lightest",
minHeight: "7rem",
padding: "2rem 0",
},
footerTopContainer: {
maxW: "appMax",
".desktop &": {
padding: "0 2rem",
},
},
footerTopFlex: {
flexWrap: "wrap",
},
footerTopLeftContainer: {
flex: "0 0 50%",
maxWidth: "100%",
minWidth: "100%",
marginBottom: "1em",
".desktop &": {
marginBottom: 0,
maxWidth: "50%",
minWidth: "auto",
},
},
footerTopRightContainer: {
flex: "0 0 50%",
maxWidth: "100%",
minWidth: "100%",
".desktop &": {
minWidth: "auto",
},
},
footerTopRightTopFlex: {
justifyContent: "center",
flexDirection: "column",
alignItems: "center",
".desktop &": {
justifyContent: "flex-end",
flexDirection: "row",
},
},
footerCMSBrandingLeft: {
display: "flex",
justifyContent: "center",
alignItems: "center",
maxWidth: "100%",
padding: "0 1rem",
minWidth: "100%",
marginBottom: "1rem",
".desktop &": {
marginBottom: 0,
display: "block",
width: "auto",
maxWidth: "auto",
minWidth: "auto",
},
},
footerCMSBrandingRight: {
flex: "0 0 75%",
maxWidth: "25rem",
},

hcbsLogo: {
maxHeight: "4.875rem",
margin: "0 auto",
".desktop &": {
margin: 0,
},
},
hhsLogo: {
display: "inline-block",
width: "4.375rem",
},
hhsMedicaidLogoMobile: {
maxWidth: "12.5rem",
marginLeft: "1.25rem",
},
hhsCopyText: {
display: "inline-block",
textAlign: "left",
verticalAlign: "top",
fontSize: "sm",
lineHeight: "21px",
marginTop: 0,
},
footerCMSMedicaid: {
justifyContent: "flex-end",
},
medicaidLogo: {
flex: "0 0 75%",
maxWidth: "75%",
marginTop: ".25rem",
".desktop &": {
maxWidth: "25rem",
},
},

footerText: {
maxW: "20rem",
fontSize: "0.875rem",
".mobile &": {
maxW: "100%",
marginX: "1rem",
},
},
footerBottom: {
minHeight: "3rem",
bg: "palette.primary_darkest",
fontSize: 14,
},
footerBottomContainer: {
maxW: "appMax",
".desktop &": {
padding: "0 2rem",
},
},
footerBottomFlex: {
paddingY: "1rem",
justifyContent: "space-between",
alignItems: "normal",
flexDirection: "column",
".desktop &": {
alignItems: "initial",
flexDirection: "row",
},
},
footerBottomLinkFlex: {
flexDirection: "column",
".desktop &": {
flexDirection: "row",
},
"a:first-of-type > p": {
marginLeft: 0,
},
},
link: {
margin: "0.5rem 0",
".desktop &": {
"&:first-of-type": {
paddingRight: ".5rem",
borderRight: "1px solid",
borderColor: "palette.white",
},
"&:last-child": {
paddingLeft: ".5rem",
},
},
},
address: {
color: "palette.white",
fontWeight: "bold",
alignSelf: "center",
margin: "2.25rem 0 0",
".desktop &": {
margin: 0,
},
},
};

0 comments on commit 598922e

Please sign in to comment.