refactor(SW-302)

This commit is contained in:
Matilda Landström
2024-10-07 13:58:11 +02:00
parent cdb51bae73
commit 038fa81de2
2 changed files with 9 additions and 12 deletions

View File

@@ -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,
},
}