Merged in feat/SW-2133-accordion (pull request #1799)
fix(SW-2133): rte in accordion * fix(SW-2133): rte in accordion Approved-by: Michael Zetterberg
This commit is contained in:
@@ -13,7 +13,6 @@ import styles from "./accordion.module.css"
|
|||||||
|
|
||||||
import type { AccordionProps } from "@/types/components/blocks/Accordion"
|
import type { AccordionProps } from "@/types/components/blocks/Accordion"
|
||||||
import { HotelHashValues } from "@/types/components/hotelPage/tabNavigation"
|
import { HotelHashValues } from "@/types/components/hotelPage/tabNavigation"
|
||||||
import type { RTENode } from "@/types/transitionTypes/rte/node"
|
|
||||||
|
|
||||||
export default function AccordionSection({ accordion, title }: AccordionProps) {
|
export default function AccordionSection({ accordion, title }: AccordionProps) {
|
||||||
const showToggleButton = accordion.length > 5
|
const showToggleButton = accordion.length > 5
|
||||||
@@ -34,15 +33,10 @@ export default function AccordionSection({ accordion, title }: AccordionProps) {
|
|||||||
>
|
>
|
||||||
{accordion.map((acc) => (
|
{accordion.map((acc) => (
|
||||||
<AccordionItem key={acc.question} title={acc.question}>
|
<AccordionItem key={acc.question} title={acc.question}>
|
||||||
{acc.answer.json.children.map(
|
<JsonToHtml
|
||||||
(child: { children: RTENode[] }, idx: number) => (
|
embeds={acc.answer.embedded_itemsConnection.edges}
|
||||||
<JsonToHtml
|
nodes={acc.answer.json.children}
|
||||||
key={acc.question + idx}
|
/>
|
||||||
embeds={acc.answer.embedded_itemsConnection.edges}
|
|
||||||
nodes={child.children}
|
|
||||||
/>
|
|
||||||
)
|
|
||||||
)}
|
|
||||||
</AccordionItem>
|
</AccordionItem>
|
||||||
))}
|
))}
|
||||||
</Accordion>
|
</Accordion>
|
||||||
|
|||||||
Reference in New Issue
Block a user