fix(BOOK-661): Updated themes and correct variables for campaign hero
Approved-by: Matilda Landström
This commit is contained in:
@@ -27,7 +27,7 @@
|
|||||||
gap: var(--Space-x1);
|
gap: var(--Space-x1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.peach {
|
.theme-accent {
|
||||||
.content {
|
.content {
|
||||||
background-color: var(--Surface-Brand-Accent-Default);
|
background-color: var(--Surface-Brand-Accent-Default);
|
||||||
}
|
}
|
||||||
@@ -39,16 +39,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.text,
|
.text,
|
||||||
.campaignText {
|
.campaignText,
|
||||||
color: var(--Text-Brand-OnPrimary-1-Default);
|
|
||||||
}
|
|
||||||
|
|
||||||
.benefitList > li {
|
.benefitList > li {
|
||||||
color: var(--Surface-Brand-Primary-1-OnSurface-Accent-Secondary);
|
color: var(--Text-Brand-OnAccent-Default);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.burgundy {
|
.theme-primary-3 {
|
||||||
.content {
|
.content {
|
||||||
background-color: var(--Surface-Brand-Primary-3-Default);
|
background-color: var(--Surface-Brand-Primary-3-Default);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ export default async function CampaignHero({
|
|||||||
) : null}
|
) : null}
|
||||||
<Divider
|
<Divider
|
||||||
color={
|
color={
|
||||||
theme === "Peach"
|
theme === "Accent"
|
||||||
? "Border/Divider/Brand/OnAccent/Default"
|
? "Border/Divider/Brand/OnAccent/Default"
|
||||||
: "Border/Divider/Brand/OnPrimary 3/Default"
|
: "Border/Divider/Brand/OnPrimary 3/Default"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,36 +14,24 @@ export function getButtonColor(
|
|||||||
heroTheme: VariantProps<typeof campaignHeroVariants>["theme"],
|
heroTheme: VariantProps<typeof campaignHeroVariants>["theme"],
|
||||||
hotelTheme: Theme | null = Theme.scandic
|
hotelTheme: Theme | null = Theme.scandic
|
||||||
): ButtonVariants["color"] {
|
): ButtonVariants["color"] {
|
||||||
let buttonColor: ButtonVariants["color"] = "Inverted"
|
let buttonColor: ButtonVariants["color"] = "Primary"
|
||||||
|
|
||||||
switch (hotelTheme) {
|
switch (hotelTheme) {
|
||||||
case Theme.scandic:
|
case Theme.scandic:
|
||||||
if (heroTheme === "Peach") {
|
|
||||||
buttonColor = "Primary"
|
|
||||||
}
|
|
||||||
break
|
|
||||||
case Theme.scandicGo:
|
|
||||||
buttonColor = "Primary"
|
|
||||||
break
|
|
||||||
case Theme.grandHotel:
|
|
||||||
buttonColor = "Primary"
|
|
||||||
break
|
|
||||||
case Theme.hotelNorge:
|
case Theme.hotelNorge:
|
||||||
if (heroTheme === "Peach") {
|
|
||||||
buttonColor = "Primary"
|
|
||||||
}
|
|
||||||
break
|
|
||||||
case Theme.theDock:
|
case Theme.theDock:
|
||||||
if (heroTheme === "Peach") {
|
if (heroTheme === "Primary 3") {
|
||||||
buttonColor = "Primary"
|
buttonColor = "Inverted"
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
|
case Theme.marski:
|
||||||
case Theme.downtownCamper:
|
case Theme.downtownCamper:
|
||||||
case Theme.haymarket:
|
case Theme.haymarket:
|
||||||
case Theme.marski:
|
buttonColor = "Inverted"
|
||||||
case Theme.bassinSeven:
|
|
||||||
buttonColor = "Primary"
|
|
||||||
break
|
break
|
||||||
|
case Theme.bassinSeven:
|
||||||
|
case Theme.grandHotel:
|
||||||
|
case Theme.scandicGo:
|
||||||
default:
|
default:
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,12 +5,12 @@ import styles from "./hero.module.css"
|
|||||||
const config = {
|
const config = {
|
||||||
variants: {
|
variants: {
|
||||||
theme: {
|
theme: {
|
||||||
Peach: styles.peach,
|
Accent: styles["theme-accent"],
|
||||||
Burgundy: styles.burgundy,
|
"Primary 3": styles["theme-primary-3"],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
defaultVariants: {
|
defaultVariants: {
|
||||||
theme: "Burgundy",
|
theme: "Primary 3",
|
||||||
},
|
},
|
||||||
} as const
|
} as const
|
||||||
|
|
||||||
|
|||||||
@@ -58,7 +58,18 @@ export const blocksSchema = z.discriminatedUnion("__typename", [
|
|||||||
export const heroSchema = z.object({
|
export const heroSchema = z.object({
|
||||||
image: transformedImageVaultAssetSchema,
|
image: transformedImageVaultAssetSchema,
|
||||||
heading: z.string(),
|
heading: z.string(),
|
||||||
theme: z.enum(["Peach", "Burgundy"]).default("Peach"),
|
theme: z
|
||||||
|
.enum(["Peach", "Burgundy"])
|
||||||
|
.nullish()
|
||||||
|
.transform((theme) => {
|
||||||
|
switch (theme) {
|
||||||
|
case "Burgundy":
|
||||||
|
return "Primary 3"
|
||||||
|
case "Peach":
|
||||||
|
default:
|
||||||
|
return "Accent"
|
||||||
|
}
|
||||||
|
}),
|
||||||
benefits: z
|
benefits: z
|
||||||
.array(z.string())
|
.array(z.string())
|
||||||
.nullish()
|
.nullish()
|
||||||
|
|||||||
Reference in New Issue
Block a user