Merged in feat/SW-1384-filterable-carousel-cards (pull request #1235)
feat(SW-1384): add CarouselCards block to start page * feat(SW-1384): add filterable carousel cards block to start page * fix(SW-1384): remove unnecessary link prop from SectionHeader * fix(SW-1384): remove uneeded undefined * fix(SW-1384): better type safety * feat(SW-1384): Add see all link to filterable carousel cards section header * refactor(SW-1384): Replace FilterableCarouselCards with CarouselCards block * fix(SW-1384): Remove CardsEnumType type definition * fix(SW-1384):Implement code review feedback to CarouselCards * refactor(SW-1384): Convert CarouselCardFilterEnum to const enum with type Approved-by: Christian Andolf
This commit is contained in:
35
components/Blocks/CarouselCards.tsx
Normal file
35
components/Blocks/CarouselCards.tsx
Normal file
@@ -0,0 +1,35 @@
|
||||
import SectionContainer from "@/components/Section/Container"
|
||||
import SectionHeader from "@/components/Section/Header"
|
||||
|
||||
import type { CarouselCardsProps } from "@/types/components/blocks/carouselCards"
|
||||
|
||||
export default function CarouselCards({ carousel_cards }: CarouselCardsProps) {
|
||||
const {
|
||||
heading,
|
||||
enableFilters,
|
||||
filterCategories,
|
||||
cards,
|
||||
defaultFilter,
|
||||
link,
|
||||
} = carousel_cards
|
||||
|
||||
return (
|
||||
<SectionContainer>
|
||||
<SectionHeader title={heading} link={link} />
|
||||
{enableFilters && (
|
||||
<details>
|
||||
<summary>Filter data</summary>
|
||||
<p>Todo: Add filter component here</p>
|
||||
<pre>
|
||||
{JSON.stringify({ filterCategories, defaultFilter }, null, 2)}
|
||||
</pre>
|
||||
</details>
|
||||
)}
|
||||
<details>
|
||||
<summary>Carousel cards</summary>
|
||||
<p>Todo: Add carousel cards component here</p>
|
||||
<pre>{JSON.stringify({ cards }, null, 2)}</pre>
|
||||
</details>
|
||||
</SectionContainer>
|
||||
)
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
import CardsGrid from "@/components/Blocks/CardsGrid"
|
||||
import CarouselCards from "@/components/Blocks/CarouselCards"
|
||||
import DynamicContent from "@/components/Blocks/DynamicContent"
|
||||
import ShortcutsList from "@/components/Blocks/ShortcutsList"
|
||||
import TextCols from "@/components/Blocks/TextCols"
|
||||
@@ -51,6 +52,13 @@ export default function Blocks({ blocks }: BlocksProps) {
|
||||
key={`${block.dynamic_content.title}-${idx}`}
|
||||
/>
|
||||
)
|
||||
case BlocksEnums.block.CarouselCards:
|
||||
return (
|
||||
<CarouselCards
|
||||
carousel_cards={block.carousel_cards}
|
||||
key={`${block.carousel_cards.heading}-${idx}`}
|
||||
/>
|
||||
)
|
||||
case BlocksEnums.block.HotelListing:
|
||||
const { heading, contentType, locationFilter, hotelsToInclude } =
|
||||
block.hotel_listing
|
||||
|
||||
Reference in New Issue
Block a user