Switches out all the old icons to new ones, and moves them to the design system. The new icons are of three different types: Materialise Symbol, Nucleo, and Customized. Also adds further mapping between facilities/amenities and icons. Approved-by: Michael Zetterberg Approved-by: Erik Tiekstra
74 lines
2.0 KiB
TypeScript
74 lines
2.0 KiB
TypeScript
"use client"
|
|
|
|
import { useState } from "react"
|
|
|
|
import { MaterialIcon } from "@scandic-hotels/design-system/Icons"
|
|
|
|
import JsonToHtml from "@/components/JsonToHtml"
|
|
import Button from "@/components/TempDesignSystem/Button"
|
|
|
|
import Link from "../../Link"
|
|
import SidePeek from "../../SidePeek"
|
|
|
|
import styles from "./sidepeek.module.css"
|
|
|
|
import type { TeaserCardSidepeekProps } from "@/types/components/teaserCard"
|
|
|
|
export default function TeaserCardSidepeek({
|
|
button,
|
|
sidePeekContent,
|
|
}: TeaserCardSidepeekProps) {
|
|
const [sidePeekIsOpen, setSidePeekIsOpen] = useState(false)
|
|
const { heading, content, primary_button, secondary_button } = sidePeekContent
|
|
|
|
return (
|
|
<div>
|
|
<Button
|
|
onPress={() => setSidePeekIsOpen(true)}
|
|
theme="base"
|
|
variant="icon"
|
|
intent="text"
|
|
size="small"
|
|
wrapping
|
|
>
|
|
{button.call_to_action_text}
|
|
<MaterialIcon icon="chevron_right" size={20} color="CurrentColor" />
|
|
</Button>
|
|
<SidePeek
|
|
title={heading}
|
|
isOpen={sidePeekIsOpen}
|
|
handleClose={() => setSidePeekIsOpen(false)}
|
|
openInRoot
|
|
>
|
|
<JsonToHtml
|
|
nodes={content.json.children}
|
|
embeds={content.embedded_itemsConnection.edges}
|
|
/>
|
|
<div className={styles.ctaContainer}>
|
|
{primary_button && (
|
|
<Button asChild theme="base" intent="primary" size="small">
|
|
<Link
|
|
href={primary_button.href}
|
|
target={primary_button.openInNewTab ? "_blank" : undefined}
|
|
color="none"
|
|
>
|
|
{primary_button.title}
|
|
</Link>
|
|
</Button>
|
|
)}
|
|
{secondary_button && (
|
|
<Button asChild intent="secondary" size="small">
|
|
<Link
|
|
href={secondary_button.href}
|
|
target={secondary_button.openInNewTab ? "_blank" : undefined}
|
|
>
|
|
{secondary_button.title}
|
|
</Link>
|
|
</Button>
|
|
)}
|
|
</div>
|
|
</SidePeek>
|
|
</div>
|
|
)
|
|
}
|