Skip to content

Commit 9fc9f5f

Browse files
authored
add carousel to bespoke pages (#57927)
1 parent 1c681bf commit 9fc9f5f

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/landings/components/bespoke/BespokeLanding.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ import { DefaultLayout } from '@/frame/components/DefaultLayout'
44
import { useLandingContext } from '@/landings/context/LandingContext'
55
import { LandingHero } from '@/landings/components/shared/LandingHero'
66
import { ArticleGrid } from '@/landings/components/shared/LandingArticleGridWithFilter'
7+
import { LandingCarousel } from '@/landings/components/shared/LandingCarousel'
78

89
import type { ArticleCardItems } from '@/landings/types'
910

1011
export const BespokeLanding = () => {
11-
const { title, intro, heroImage, introLinks, tocItems } = useLandingContext()
12+
const { title, intro, heroImage, introLinks, tocItems, recommended } = useLandingContext()
1213

1314
const flatArticles: ArticleCardItems = useMemo(
1415
() => tocItems.flatMap((item) => item.childTocItems || []),
@@ -21,6 +22,7 @@ export const BespokeLanding = () => {
2122
<LandingHero title={title} intro={intro} heroImage={heroImage} introLinks={introLinks} />
2223

2324
<div className="container-xl px-3 px-md-6 mt-6 mb-4">
25+
<LandingCarousel recommended={recommended} />
2426
<ArticleGrid flatArticles={flatArticles} />
2527
</div>
2628
</div>

src/landings/context/LandingContext.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export type LandingContextT = {
2121
currentLearningTrack?: LearningTrack
2222
currentLayout: string
2323
heroImage?: string
24-
// For discovery landing pages
24+
// For landing pages with carousels
2525
recommended?: Array<{ title: string; intro: string; href: string; category: string[] }> // Resolved article data
2626
introLinks?: Record<string, string>
2727
// For journey landing pages
@@ -51,7 +51,7 @@ export const getLandingContextFromRequest = async (
5151

5252
let recommended: Array<{ title: string; intro: string; href: string; category: string[] }> = []
5353

54-
if (landingType === 'discovery') {
54+
if (landingType === 'discovery' || landingType === 'bespoke') {
5555
// Use resolved recommended articles from the page after middleware processing
5656
if (page.recommended && Array.isArray(page.recommended) && page.recommended.length > 0) {
5757
recommended = page.recommended

0 commit comments

Comments
 (0)