fix(SW-2928): Added different margins on wellness content wrapper depending on which buttons are present

Approved-by: Christian Andolf
Approved-by: Matilda Landström
This commit is contained in:
Erik Tiekstra
2025-06-03 09:33:52 +00:00
parent be98c2faf6
commit 12b22ba8cd
2 changed files with 22 additions and 8 deletions

View File

@@ -1,3 +1,5 @@
import { cx } from "class-variance-authority"
import ButtonLink from "@/components/ButtonLink"
import SidePeek from "@/components/TempDesignSystem/SidePeek"
import { getIntl } from "@/i18n"
@@ -23,14 +25,19 @@ export default async function WellnessAndExerciseSidePeek({
return (
<SidePeek contentKey={SidepeekSlugs.wellness} title={heading}>
<div className={styles.wrapper}>
<div
className={cx(styles.wrapper, {
[styles.hasSpaPage]: spaPage,
[styles.hasWellnessExercisePage]: wellnessExercisePageUrl,
})}
>
{healthFacilities.map((facility) => (
<Facility key={facility.type} data={facility} />
))}
</div>
{(spaPage || wellnessExercisePageUrl) && (
{spaPage || wellnessExercisePageUrl ? (
<div className={styles.buttonContainer}>
{spaPage && (
{spaPage ? (
<ButtonLink
href={spaPage.url}
variant="Tertiary"
@@ -39,7 +46,7 @@ export default async function WellnessAndExerciseSidePeek({
>
{spaPage.buttonCTA}
</ButtonLink>
)}
) : null}
{wellnessExercisePageHref ? (
<ButtonLink
href={wellnessExercisePageHref}
@@ -53,7 +60,7 @@ export default async function WellnessAndExerciseSidePeek({
</ButtonLink>
) : null}
</div>
)}
) : null}
</SidePeek>
)
}

View File

@@ -2,9 +2,16 @@
display: flex;
flex-direction: column;
gap: var(--Spacing-x4);
margin-bottom: calc(
var(--Spacing-x4) * 2 + 80px
); /* Creates space between the wrapper and buttonContainer */
/* Creates space between the wrapper and buttonContainer depending on which buttons are present */
&.hasSpaPage,
&.hasWellnessPage {
margin-bottom: 125px;
}
&.hasSpaPage.hasWellnessExercisePage {
margin-bottom: 201px;
}
}
.buttonContainer {