Skip to content

Commit

Permalink
Merge pull request #105 from NYPL/DR-2894/prelaunch-a11y
Browse files Browse the repository at this point in the history
DR-2894: Quick pre-launch a11y fixes
  • Loading branch information
7emansell authored Apr 9, 2024
2 parents c5c6ec9 + 51edfc2 commit 75373e5
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 15 deletions.
8 changes: 0 additions & 8 deletions src/components/featuredContent/featuredContent.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ describe("Featured Content component renders with expected props", () => {
"src",
"/pd_banner.png"
);
expect(within(component).getByRole("img")).toHaveAttribute(
"alt",
"Public Domain banner"
);

const button = within(component).getByTestId("featured-learn-more");
expect(button).toHaveAttribute("href", "https://publicdomain.nypl.org");
Expand All @@ -34,10 +30,6 @@ describe("Featured Content component renders with expected props", () => {
"src",
"/service-artehouse.jpg"
);
expect(within(component).getByRole("img")).toHaveAttribute(
"alt",
"Service Artehouse banner"
);

const button = within(component).getByTestId("featured-visit-store");
expect(button).toHaveAttribute(
Expand Down
4 changes: 2 additions & 2 deletions src/components/featuredContent/featuredContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ const FeaturedContentComponent = ({ randomNumber }) => {
data-testid={data.buttonId}
isUnderlined={false}
target="_blank"
aria-label={data.ariaLabel}
aria-label={`${data.buttonText}, ${data.heading}`}
type="buttonPrimary"
>
{data.buttonText}
</Link>
</Box>
}
imageProps={{
alt: data.imgAlt,
alt: "",
width: "oneHalf",
position: "end",
src: data.imgSrc,
Expand Down
9 changes: 8 additions & 1 deletion src/components/hero/campaignHeroSubText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,14 @@ const CampaignHeroSubText = ({ featuredItem }: any) => {
</Text>
<HorizontalRule />
<Box>
<Text color="ui.typography.body" mb="0px" noOfLines={2}>
<Text
color="ui.typography.body"
mb="0px"
noOfLines={2}
__css={{
":focus-within": { overflow: "visible" },
}}
>
Featured Image:{" "}
<DSLink
color="var(--nypl-colors-ui-link-primary) !important"
Expand Down
6 changes: 4 additions & 2 deletions src/pages/_document.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Html, Head, Main, NextScript } from "next/document";
import Script from "next/script";

export default function Document() {
return (
Expand All @@ -8,10 +9,11 @@ export default function Document() {
<Main />
<NextScript />
<div id="nypl-footer"></div>
<script
<Script
src="https://ds-header.nypl.org/footer.min.js?containerId=nypl-footer"
async
></script>
strategy="beforeInteractive"
></Script>
</body>
</Html>
);
Expand Down
12 changes: 10 additions & 2 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import CampaignHero from "../components/hero/campaignHero";
import { TemplateAppContainer } from "@nypl/design-system-react-components";
import {
SkipNavigation,
TemplateAppContainer,
} from "@nypl/design-system-react-components";
import Header from "@/components/header/header";
import HomePageMainContent from "@/components/homePageMainContent/homePageMainContent";
import ExploreFurther from "@/components/exploreFurther/exploreFurther";
Expand All @@ -8,13 +11,18 @@ import NotificationBanner from "@/components/notificationBanner/notificationBann
export default function Home(props: any = {}) {
return (
<>
<SkipNavigation target="#hero" />
{/**
* * @TODO: Header will need to be pulled into a reusable Layout component (DC Facelift phase 2)
* * Let this be @7emansell 's problem if possible **/}
<NotificationBanner />
<Header />
<TemplateAppContainer
breakout={<CampaignHero imageID={props.imageID} />}
breakout={
<div id="hero">
<CampaignHero imageID={props.imageID} />
</div>
}
contentPrimary={<HomePageMainContent />}
/>
<ExploreFurther />
Expand Down

0 comments on commit 75373e5

Please sign in to comment.