feat(SW-66, SW-348): search functionality and ui
This commit is contained in:
@@ -4,8 +4,8 @@ import { useRouter } from "next/navigation"
|
||||
import { Button } from "@scandic-hotels/design-system/current"
|
||||
|
||||
import { renderOptions as currentRenderOptions } from "@/components/Current/currentRenderOptions"
|
||||
import DeprecatedJsonToHtml from "@/components/DeprecatedJsonToHtml"
|
||||
import Image from "@/components/Image"
|
||||
import JsonToHtml from "@/components/JsonToHtml"
|
||||
|
||||
import { renderOptions } from "./renderOptions"
|
||||
|
||||
@@ -42,7 +42,7 @@ export default function Puff({
|
||||
/>
|
||||
))}
|
||||
<section className={styles.content}>
|
||||
<JsonToHtml
|
||||
<DeprecatedJsonToHtml
|
||||
embeds={[]}
|
||||
nodes={text.json.children}
|
||||
renderOptions={{ ...currentRenderOptions, ...renderOptions }}
|
||||
@@ -71,7 +71,7 @@ export default function Puff({
|
||||
<header>
|
||||
<h3 className={styles.heading}>{title}</h3>
|
||||
</header>
|
||||
<JsonToHtml
|
||||
<DeprecatedJsonToHtml
|
||||
embeds={[]}
|
||||
nodes={text.json.children}
|
||||
renderOptions={{ ...currentRenderOptions, ...renderOptions }}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import styles from "./puff.module.css"
|
||||
|
||||
import type { EmbedByUid } from "@/types/components/jsontohtml"
|
||||
import type { EmbedByUid } from "@/types/components/deprecatedjsontohtml"
|
||||
import { RTETypeEnum } from "@/types/rte/enums"
|
||||
import type { RTEDefaultNode, RTENext } from "@/types/rte/node"
|
||||
import type { RenderOptions } from "@/types/rte/option"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import JsonToHtml from "@/components/JsonToHtml"
|
||||
import DeprecatedJsonToHtml from "@/components/DeprecatedJsonToHtml"
|
||||
|
||||
import { renderOptions } from "./../currentRenderOptions"
|
||||
|
||||
@@ -6,7 +6,7 @@ import type { TextProps } from "@/types/components/current/blocks/text"
|
||||
|
||||
export default function Text({ text }: TextProps) {
|
||||
return (
|
||||
<JsonToHtml
|
||||
<DeprecatedJsonToHtml
|
||||
embeds={text.content.embedded_itemsConnection.edges}
|
||||
nodes={text.content.json.children}
|
||||
renderOptions={renderOptions}
|
||||
|
||||
@@ -22,14 +22,14 @@ export default async function Header() {
|
||||
serverClient().contentstack.myPages.navigation.get(),
|
||||
])
|
||||
|
||||
if (!navigation || !languages || !data) {
|
||||
if (!navigation || !languages || !data?.header) {
|
||||
return null
|
||||
}
|
||||
|
||||
const homeHref = homeHrefs[env.NODE_ENV][getLang()]
|
||||
const { frontpage_link_text, logo, menu, top_menu } = data
|
||||
const { frontpageLinkText, logo, menu, topMenu } = data.header
|
||||
|
||||
const topMenuMobileLinks = top_menu.links
|
||||
const topMenuMobileLinks = topMenu.links
|
||||
.filter((link) => link.show_on_mobile)
|
||||
.sort((a, b) => (a.sort_order_mobile < b.sort_order_mobile ? 1 : -1))
|
||||
|
||||
@@ -37,13 +37,13 @@ export default async function Header() {
|
||||
<header className={styles.header} role="banner">
|
||||
<OfflineBanner />
|
||||
<TopMenu
|
||||
frontpageLinkText={frontpage_link_text}
|
||||
frontpageLinkText={frontpageLinkText}
|
||||
homeHref={homeHref}
|
||||
links={top_menu.links}
|
||||
links={topMenu.links}
|
||||
languageSwitcher={<LanguageSwitcher urls={languages.urls} />}
|
||||
/>
|
||||
<MainMenu
|
||||
frontpageLinkText={frontpage_link_text}
|
||||
frontpageLinkText={frontpageLinkText}
|
||||
homeHref={homeHref}
|
||||
links={menu.links}
|
||||
logo={logo}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import JsonToHtml from "@/components/JsonToHtml"
|
||||
import DeprecatedJsonToHtml from "@/components/DeprecatedJsonToHtml"
|
||||
|
||||
import { renderOptions as currentRenderOptions } from "./../currentRenderOptions"
|
||||
import Breadcrumbs from "./Breadcrumbs"
|
||||
@@ -25,7 +25,7 @@ export default function Preamble({
|
||||
/>
|
||||
<h1>{title}</h1>
|
||||
{preamble?.text ? (
|
||||
<JsonToHtml
|
||||
<DeprecatedJsonToHtml
|
||||
embeds={preamble.text.embedded_itemsConnection.edges}
|
||||
nodes={preamble.text.json.children}
|
||||
renderOptions={{ ...currentRenderOptions, ...renderOptions }}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import styles from "./preamble.module.css"
|
||||
|
||||
import type { EmbedByUid } from "@/types/components/jsontohtml"
|
||||
import type { EmbedByUid } from "@/types/components/deprecatedjsontohtml"
|
||||
import { RTETypeEnum } from "@/types/rte/enums"
|
||||
import type { RTEDefaultNode, RTENext } from "@/types/rte/node"
|
||||
import type { RenderOptions } from "@/types/rte/option"
|
||||
|
||||
@@ -3,7 +3,7 @@ import Link from "@/components/TempDesignSystem/Link"
|
||||
|
||||
import styles from "./currentRenderOptions.module.css"
|
||||
|
||||
import type { EmbedByUid } from "@/types/components/jsontohtml"
|
||||
import type { EmbedByUid } from "@/types/components/deprecatedjsontohtml"
|
||||
import { EmbedEnum } from "@/types/requests/utils/embeds"
|
||||
import type { Attributes } from "@/types/rte/attrs"
|
||||
import { RTEItemTypeEnum, RTETypeEnum } from "@/types/rte/enums"
|
||||
|
||||
Reference in New Issue
Block a user