fix(BOOK-204): Added dynamic h1 to startpage
Approved-by: Christel Westerberg
This commit is contained in:
@@ -5,16 +5,28 @@ import {
|
||||
|
||||
import InfoCard from "@/components/ContentType/StartPage/InfoCard"
|
||||
import { Section } from "@/components/Section"
|
||||
import SectionHeader from "@/components/Section/Header/Deprecated"
|
||||
import { SectionHeader } from "@/components/Section/Header"
|
||||
import Card from "@/components/TempDesignSystem/Card"
|
||||
import Grids from "@/components/TempDesignSystem/Grids"
|
||||
import LoyaltyCard from "@/components/TempDesignSystem/LoyaltyCard"
|
||||
import TeaserCard from "@/components/TempDesignSystem/TeaserCard"
|
||||
|
||||
import type { CardsGridProps } from "@/types/components/blocks/cardsGrid"
|
||||
import type { CardsGrid as CardsGridBlock } from "@scandic-hotels/trpc/types/blocks"
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
|
||||
import type { headingVariants } from "@/components/Section/Header/headingVariants"
|
||||
import type { StackableGridProps } from "../TempDesignSystem/Grids/Stackable/stackable"
|
||||
|
||||
export default function CardsGrid({ cards_grid }: CardsGridProps) {
|
||||
interface CardsGridProps extends Pick<CardsGridBlock, "cards_grid"> {
|
||||
headingLevel?: "h1" | "h2"
|
||||
headingTypography?: VariantProps<typeof headingVariants>["typography"]
|
||||
}
|
||||
|
||||
export default function CardsGrid({
|
||||
cards_grid,
|
||||
headingLevel = "h2",
|
||||
headingTypography = "Title/sm",
|
||||
}: CardsGridProps) {
|
||||
let columns: StackableGridProps["columns"]
|
||||
|
||||
switch (cards_grid.layout) {
|
||||
@@ -34,10 +46,10 @@ export default function CardsGrid({ cards_grid }: CardsGridProps) {
|
||||
return (
|
||||
<Section>
|
||||
<SectionHeader
|
||||
title={cards_grid.title}
|
||||
heading={cards_grid.title}
|
||||
preamble={cards_grid.preamble}
|
||||
headingAs="h3"
|
||||
headingLevel="h2"
|
||||
headingLevel={headingLevel}
|
||||
typography={headingTypography}
|
||||
link={cards_grid.link}
|
||||
/>
|
||||
<Grids.Stackable columns={columns}>
|
||||
|
||||
Reference in New Issue
Block a user