refactor(SW-302)
This commit is contained in:
@@ -12,19 +12,16 @@ import type { CardProps } from "@/components/TempDesignSystem/Card/card"
|
|||||||
|
|
||||||
export default function ActivitiesCardGrid(activitiesCard: ActivityCard) {
|
export default function ActivitiesCardGrid(activitiesCard: ActivityCard) {
|
||||||
const lang = getLang()
|
const lang = getLang()
|
||||||
const hasImage = activitiesCard.background_image
|
const hasImage = activitiesCard.backgroundImage
|
||||||
|
|
||||||
const updatedCard: CardProps = {
|
const updatedCard: CardProps = {
|
||||||
|
...activitiesCard,
|
||||||
id: activities[lang],
|
id: activities[lang],
|
||||||
theme: hasImage ? "image" : "primaryDark",
|
theme: hasImage ? "image" : "primaryDark",
|
||||||
scriptedTopTitle: activitiesCard.scripted_title,
|
|
||||||
heading: activitiesCard.heading,
|
|
||||||
bodyText: activitiesCard.body_text,
|
|
||||||
backgroundImage: hasImage ? activitiesCard.background_image : undefined,
|
|
||||||
primaryButton: hasImage
|
primaryButton: hasImage
|
||||||
? {
|
? {
|
||||||
href: activitiesCard.contentPage.href,
|
href: activitiesCard.contentPage.href,
|
||||||
title: activitiesCard.cta_text,
|
title: activitiesCard.ctaText,
|
||||||
isExternal: false,
|
isExternal: false,
|
||||||
}
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
@@ -32,7 +29,7 @@ export default function ActivitiesCardGrid(activitiesCard: ActivityCard) {
|
|||||||
? undefined
|
? undefined
|
||||||
: {
|
: {
|
||||||
href: activitiesCard.contentPage.href,
|
href: activitiesCard.contentPage.href,
|
||||||
title: activitiesCard.cta_text,
|
title: activitiesCard.ctaText,
|
||||||
isExternal: false,
|
isExternal: false,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,13 +47,13 @@ export const activitiesCard = z.object({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
background_image: data.background_image,
|
backgroundImage: data.background_image,
|
||||||
body_text: data.body_text,
|
bodyText: data.body_text,
|
||||||
contentPage,
|
contentPage,
|
||||||
cta_text: data.cta_text,
|
ctaText: data.cta_text,
|
||||||
heading: data.heading,
|
heading: data.heading,
|
||||||
open_in_new_tab: !!data.open_in_new_tab,
|
openInNewTab: !!data.open_in_new_tab,
|
||||||
scripted_title: data.scripted_title,
|
scriptedTopTitle: data.scripted_title,
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user