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) {
|
||||
const lang = getLang()
|
||||
const hasImage = activitiesCard.background_image
|
||||
const hasImage = activitiesCard.backgroundImage
|
||||
|
||||
const updatedCard: CardProps = {
|
||||
...activitiesCard,
|
||||
id: activities[lang],
|
||||
theme: hasImage ? "image" : "primaryDark",
|
||||
scriptedTopTitle: activitiesCard.scripted_title,
|
||||
heading: activitiesCard.heading,
|
||||
bodyText: activitiesCard.body_text,
|
||||
backgroundImage: hasImage ? activitiesCard.background_image : undefined,
|
||||
primaryButton: hasImage
|
||||
? {
|
||||
href: activitiesCard.contentPage.href,
|
||||
title: activitiesCard.cta_text,
|
||||
title: activitiesCard.ctaText,
|
||||
isExternal: false,
|
||||
}
|
||||
: undefined,
|
||||
@@ -32,7 +29,7 @@ export default function ActivitiesCardGrid(activitiesCard: ActivityCard) {
|
||||
? undefined
|
||||
: {
|
||||
href: activitiesCard.contentPage.href,
|
||||
title: activitiesCard.cta_text,
|
||||
title: activitiesCard.ctaText,
|
||||
isExternal: false,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -47,13 +47,13 @@ export const activitiesCard = z.object({
|
||||
}
|
||||
}
|
||||
return {
|
||||
background_image: data.background_image,
|
||||
body_text: data.body_text,
|
||||
backgroundImage: data.background_image,
|
||||
bodyText: data.body_text,
|
||||
contentPage,
|
||||
cta_text: data.cta_text,
|
||||
ctaText: data.cta_text,
|
||||
heading: data.heading,
|
||||
open_in_new_tab: !!data.open_in_new_tab,
|
||||
scripted_title: data.scripted_title,
|
||||
openInNewTab: !!data.open_in_new_tab,
|
||||
scriptedTopTitle: data.scripted_title,
|
||||
}
|
||||
}),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user