Merged in fix/accordion (pull request #1318)

Fix/accordion

* fix(SW-1621): show all children in accordion

* fix(SW-1621): change FAQ label


Approved-by: Erik Tiekstra
This commit is contained in:
Matilda Landström
2025-02-13 08:24:05 +00:00
parent 599c11ba37
commit 41cb32dd30
7 changed files with 10 additions and 22 deletions

View File

@@ -14,6 +14,7 @@ import styles from "./accordion.module.css"
import type { AccordionProps } from "@/types/components/blocks/Accordion"
import { HotelHashValues } from "@/types/components/hotelPage/tabNavigation"
import type { RTENode } from "@/types/transitionTypes/rte/node"
export default function AccordionSection({ accordion, title }: AccordionProps) {
const intl = useIntl()
@@ -36,10 +37,15 @@ export default function AccordionSection({ accordion, title }: AccordionProps) {
>
{accordion.map((acc) => (
<AccordionItem key={acc.question} title={acc.question}>
<JsonToHtml
embeds={acc.answer.embedded_itemsConnection.edges}
nodes={acc.answer.json?.children[0].children}
/>
{acc.answer.json.children.map(
(child: { children: RTENode[] }, idx: number) => (
<JsonToHtml
key={acc.question + idx}
embeds={acc.answer.embedded_itemsConnection.edges}
nodes={child.children}
/>
)
)}
</AccordionItem>
))}
</Accordion>
@@ -48,12 +54,6 @@ export default function AccordionSection({ accordion, title }: AccordionProps) {
<ShowMoreButton
loadMoreData={toggleAccordions}
showLess={allAccordionsVisible}
textShowMore={intl.formatMessage({
id: "See all FAQ",
})}
textShowLess={intl.formatMessage({
id: "See less FAQ",
})}
/>
) : null}
</SectionContainer>