feat/BOOK-755 alert content pages
* feat(BOOK-755): Added alert block on Collection pages * feat(BOOK-755): Added alert block on Content pages * feat(BOOK-755): Added alert functionality for RTE Approved-by: Bianca Widstam
This commit is contained in:
13
apps/scandic-web/components/Blocks/Alert/index.tsx
Normal file
13
apps/scandic-web/components/Blocks/Alert/index.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import { Alert } from "@scandic-hotels/design-system/Alert"
|
||||
|
||||
import type { AlertBlock } from "@scandic-hotels/trpc/types/blocks"
|
||||
|
||||
interface AlertBlockProps extends Pick<AlertBlock, "alert"> {}
|
||||
|
||||
export function AlertBlock({ alert }: AlertBlockProps) {
|
||||
if (!alert) {
|
||||
return null
|
||||
}
|
||||
|
||||
return <Alert {...alert} />
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
import { JsonToHtml } from "@scandic-hotels/design-system/JsonToHtml"
|
||||
import { BlocksEnums } from "@scandic-hotels/trpc/types/blocksEnum"
|
||||
|
||||
import { AlertBlock } from "@/components/Blocks/Alert"
|
||||
import CardsGrid from "@/components/Blocks/CardsGrid"
|
||||
import CarouselCards from "@/components/Blocks/CarouselCards"
|
||||
import DynamicContent from "@/components/Blocks/DynamicContent"
|
||||
@@ -30,6 +31,10 @@ export default function Blocks({ blocks }: BlocksProps) {
|
||||
key={`${block.typename}-${idx}`}
|
||||
/>
|
||||
)
|
||||
case BlocksEnums.block.Alert:
|
||||
return (
|
||||
<AlertBlock alert={block.alert} key={`${block.typename}-${idx}`} />
|
||||
)
|
||||
case BlocksEnums.block.CardsGrid:
|
||||
return (
|
||||
<CardsGrid
|
||||
|
||||
Reference in New Issue
Block a user