Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NXT 479 Navigation breadcrumbs for category landing page #315

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe("CategoryLandingPage", () => {
).toBeInTheDocument();
});

xit("renders the Hero through the StoryblokComponent, if it's passed as block", () => {
it("renders the Hero through the StoryblokComponent, if it's passed as block", () => {
render(<CategoryLandingPage {...mockPropsWithHero} />);
expect(
screen.getByText(mockHeroData.header[0].component)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import { StoryblokComponent } from "@storyblok/react";

import { type Breadcrumb } from "@/types/Breadcrumb";
import { type CategoryLandingPageStoryblok } from "@/types/storyblok";

// import styles from "./CategoryLandingPage.module.scss";

export interface CategoryLandindPageBlokProps {
blok: CategoryLandingPageStoryblok;
breadcrumbs?: Breadcrumb[];
}

export const CategoryLandingPage = ({
blok,
breadcrumbs,
}: CategoryLandindPageBlokProps): React.ReactElement => {
return (
<>
Expand All @@ -19,9 +20,15 @@ export const CategoryLandingPage = ({
<StoryblokComponent blok={nestedBlok} key={nestedBlok._uid} />
))}
{blok.header &&
blok.header.map((nestedBlok) => (
<StoryblokComponent blok={nestedBlok} key={nestedBlok._uid} />
))}
blok.header.map((nestedBlok) => {
return (
<StoryblokComponent
blok={nestedBlok}
key={nestedBlok._uid}
breadcrumbs={breadcrumbs}
/>
);
})}
{/* {blok.content &&
blok.content.map((nestedBlok) => (
<StoryblokComponent blok={nestedBlok} key={nestedBlok._uid} />
Expand Down
13 changes: 0 additions & 13 deletions web/src/types/storyblok.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,17 +189,6 @@ export interface CategoryNavigationStoryblok {
[k: string]: any;
}

export interface FullWidthSectionStoryblok {
heading?: string;
lead?: RichtextStoryblok;
showHeading?: boolean;
theme: "subtle" | "impact" | "transparent";
content?: (ActionBannerStoryblok | CardGridStoryblok | PromoBoxStoryblok)[];
component: "fullWidthSection";
_uid: string;
[k: string]: any;
}

export interface GridStoryblok {
columns?: (
| AccordionStoryblok
Expand All @@ -214,7 +203,6 @@ export interface GridStoryblok {
| CardGridStoryblok
| CategoryLandingPageStoryblok
| CategoryNavigationStoryblok
| FullWidthSectionStoryblok
| GridStoryblok
| GridItemStoryblok
| GridSectionStoryblok
Expand Down Expand Up @@ -458,7 +446,6 @@ export interface PageStoryblok {
| CardGridStoryblok
| CategoryLandingPageStoryblok
| CategoryNavigationStoryblok
| FullWidthSectionStoryblok
| GridStoryblok
| GridItemStoryblok
| GridSectionStoryblok
Expand Down